From be6c57f53a798cd2b83ddbe9f6d6e836c93167df Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 23 Dec 2013 15:26:44 -0500 Subject: [PATCH] Mark XModule strings for i18n --- .../xmodule/js/src/annotatable/display.coffee | 15 +++++++++++---- .../xmodule/xmodule/js/src/capa/display.coffee | 10 +++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee index 8a32c8f51e..531ea91145 100644 --- a/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee @@ -160,7 +160,10 @@ class @Annotatable @hideTips visible toggleAnnotationButtonText: (hide) -> - buttonText = (if hide then 'Show' else 'Hide')+' Annotations' + if hide + buttonText = gettext('Show Annotations') + else + buttonText = gettext('Hide Annotations') @$(@toggleAnnotationsSelector).text(buttonText) toggleInstructions: () -> @@ -169,7 +172,10 @@ class @Annotatable @toggleInstructionsText hide toggleInstructionsButton: (hide) -> - txt = (if hide then 'Expand' else 'Collapse')+' Instructions' + if hide + txt = gettext('Expand Instructions') + else + txt = gettext('Collapse Instructions') cls = (if hide then ['expanded', 'collapsed'] else ['collapsed','expanded']) @$(@toggleInstructionsSelector).text(txt).removeClass(cls[0]).addClass(cls[1]) @@ -221,13 +227,14 @@ class @Annotatable makeTipTitle: (el) -> (api) => title = $(el).data('comment-title') - (if title then title else 'Commentary') + (if title then title else gettext('Commentary')) createComment: (text) -> $("
#{text}
") createReplyLink: (problem_id) -> - $("Reply to Annotation") + linktxt = gettext('Reply to Annotation') + $("#{linktxt}") findVisibleTips: () -> visible = [] diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index 967b980179..91b83e21f3 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -318,14 +318,16 @@ class @Problem @el.find('.problem > div').each (index, element) => MathJax.Hub.Queue ["Typeset", MathJax.Hub, element] - @$('.show-label').text 'Hide Answer(s)' + `// Translators: the word Answer here refers to the answer to a problem the student must solve.` + @$('.show-label').text gettext('Hide Answer(s)') @el.addClass 'showed' @updateProgress response else @$('[id^=answer_], [id^=solution_]').text '' @$('[correct_answer]').attr correct_answer: null @el.removeClass 'showed' - @$('.show-label').text 'Show Answer(s)' + `// Translators: the word Answer here refers to the answer to a problem the student must solve.` + @$('.show-label').text gettext('Show Answer(s)') @el.find(".capa_inputtype").each (index, inputtype) => display = @inputtypeDisplays[$(inputtype).attr('id')] @@ -403,6 +405,7 @@ class @Problem formulaequationinput: (element) -> $(element).find('input').on 'input', -> $p = $(element).find('p.status') + `// Translators: the word Answer here is about answering a problem the student must solve.` $p.text gettext("unanswered") $p.parent().removeClass().addClass "unanswered" @@ -431,7 +434,8 @@ class @Problem textline: (element) -> $(element).find('input').on 'input', -> $p = $(element).find('p.status') - $p.text "unanswered" + `// Translators: the word Answer here is about answering a problem the student must solve.` + $p.text gettext("unanswered") $p.parent().removeClass().addClass "unanswered" inputtypeSetupMethods: