diff --git a/bin/update-localization-files b/bin/update-localization-files new file mode 100755 index 000000000..9606050fa --- /dev/null +++ b/bin/update-localization-files @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +function print_help_exit +{ + printf "Usage: %s [options]\n" $(basename $0) >&2 + printf " Update the renderer.pot and language .po files with translation strings from the code.\n" >&2 + printf " options:\n" >&2 + printf " -p|--po-update Update po files as well. By default only the renderer.pot file is updated.\n" >&2 + printf " -l|--langauge Update the only given language in addition to updating the renderer.pot file.\n" >&2 + printf " -h|--help Show this help.\n" >&2 + exit 1 +} + +TEMP=$(getopt -a -o pl:h -l po-update,language:,help -n "$(basename $0)" -- "$@") + +eval set -- "$TEMP" + +UPDATE_PO=false +LANGUAGE="" + +while [ ! "$1" = "--" ] +do + case "$1" in + -p|--po-update) + UPDATE_PO=true + shift 1 + ;; + -l|--language) + LANGUAGE=$2 + shift 2 + ;; + -h|--help) + print_help_exit + ;; + *) + echo "Internal error!" + exit 1 + ;; + esac +done + +command -v xgettext.pl >/dev/null 2>&1 || { + echo >&2 "xgettext.pl needs to be installed. It is inlcuded in the perl package Locale::Maketext::Extract. Aborting."; + exit 1; +} + +cd "$( dirname "${BASH_SOURCE[0]}" )/.." + +LOCDIR=lib/WeBWorK/Localize + +echo "Updating $LOCDIR/renderer.pot" + +xgettext.pl -o $LOCDIR/renderer.pot -D lib/RenderApp -D lib/WeBWorK -D templates lib/RenderApp.pm + +if $UPDATE_PO; then + find $LOCDIR -name '*.po' -exec bash -c "echo \"Updating {}\"; msgmerge -qUN {} $LOCDIR/renderer.pot" \; +elif [[ $LANGUAGE != "" && -e "$LOCDIR/$LANGUAGE.po" ]]; then + echo "Updating $LOCDIR/$LANGUAGE.po" + msgmerge -qUN $LOCDIR/$LANGUAGE.po $LOCDIR/renderer.pot +fi diff --git a/docs/make_translation_files.md b/docs/make_translation_files.md deleted file mode 100644 index 9a6dee21f..000000000 --- a/docs/make_translation_files.md +++ /dev/null @@ -1,17 +0,0 @@ -# How to generate translation files - -- Go to the location under which the renderer was installed. -- You need to have `xgettext.pl` installed. -- This assumes that you are starting in the directory of the renderer clone. - -```bash -cd lib -xgettext.pl -o WeBWorK/Localize/standalone.pot -D PG/lib -D PG/macros -D RenderApp -D WeBWorK RenderApp.pm -``` - -- That creates the POT file of all strings found - -```bash -cd WeBWorK/Localize -find . -name '*.po' -exec bash -c "echo \"Updating {}\"; msgmerge -qUN {} standalone.pot" \; -``` diff --git a/lib/WeBWorK/Localize.pm b/lib/WeBWorK/Localize.pm index 3bbdd9c19..a238abe04 100644 --- a/lib/WeBWorK/Localize.pm +++ b/lib/WeBWorK/Localize.pm @@ -1,63 +1,35 @@ package WeBWorK::Localize; +use Mojo::Base 'Locale::Maketext', -strict; -use File::Spec; - -use Locale::Maketext; use Locale::Maketext::Lexicon; +use Mojo::File; -my $path = "$ENV{RENDER_ROOT}/lib/WeBWorK/Localize"; -my $pattern = File::Spec->catfile($path, '*.[pm]o'); -my $decode = 1; -my $encoding = undef; - -eval " - package WeBWorK::Localize::I18N; - use base 'Locale::Maketext'; - %WeBWorK::Localize::I18N::Lexicon = ( '_AUTO' => 1 ); - Locale::Maketext::Lexicon->import({ - 'i-default' => [ 'Auto' ], - '*' => [ Gettext => \$pattern ], - _decode => \$decode, - _encoding => \$encoding, - }); - *tense = sub { \$_[1] . ((\$_[2] eq 'present') ? 'ing' : 'ed') }; - -" or die "Can't process eval in WeBWorK/Localize.pm: line 35: " . $@; - -package WeBWorK::Localize; - -# This subroutine is shared with the safe compartment in PG to -# allow maketext() to be constructed in PG problems and macros -# It seems to be a little fragile -- possibly it breaks -# on perl 5.8.8 -sub getLoc { - my $lang = shift; - my $lh = WeBWorK::Localize::I18N->get_handle($lang); - return sub { $lh->maketext(@_) }; -} +Locale::Maketext::Lexicon->import({ + 'i-default' => ['Auto'], + '*' => [ Gettext => Mojo::File::curfile->dirname->child('Localize', '*.[pm]o')->to_string ], + _decode => 1, + _encoding => undef, +}); sub getLangHandle { my $lang = shift; - my $lh = WeBWorK::Localize::I18N->get_handle($lang); - return $lh; + return WeBWorK::Localize->get_handle($lang); } -# this is like [quant] but it doesn't write the number +# This is like [quant] but it doesn't write the number. # usage: [quant,_1,,,] - sub plural { my ($handle, $num, @forms) = @_; - return "" if @forms == 0; + return '' if @forms == 0; return $forms[2] if @forms > 2 and $num == 0; # Normal case: return ($handle->numerate($num, @forms)); } -# this is like [quant] but it also has -1 case +# This is like [quant] but it also has -1 case. # usage: [negquant,_1,,,,] - sub negquant { my ($handle, $num, @forms) = @_; @@ -70,9 +42,6 @@ sub negquant { return ($handle->numf($num) . ' ' . $handle->numerate($num, @forms)); } -%Lexicon = ('_AUTO' => 1,); - -package WeBWorK::Localize::I18N; -use base(WeBWorK::Localize); +our %Lexicon = ('_AUTO' => 1); 1; diff --git a/lib/WeBWorK/Localize/en.po b/lib/WeBWorK/Localize/en.po index 4a0c31840..605d592fa 100644 --- a/lib/WeBWorK/Localize/en.po +++ b/lib/WeBWorK/Localize/en.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: webwork2\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: 2021-03-09 17:00-0600\n" +"PO-Revision-Date: 2025-06-21 12:21-0700\n" "Last-Translator: \n" "Language: en_US\n" "MIME-Version: 1.0\n" @@ -15,231 +15,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. (wwRound(0, $answerScore*100) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:255 -msgid "%1% correct" +#: templates/RPCRenderFormats/default.json.ep:36 +msgid "Check Answers" msgstr "" -#. ($numBlanks) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:395 -msgid "%quant(%1,of the questions remains,of the questions remain) unanswered." +#: templates/RPCRenderFormats/default.html.ep:90 +msgid "PG warning messages" msgstr "" -#: PG/macros/PGbasicmacros.pl:1277 PG/macros/PGbasicmacros.pl:1286 -msgid "" -"(Instructor hint preview: show the student hint after the following number " -"of attempts:" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:386 -msgid "All of the answers above are correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:384 -msgid "All of the gradeable answers above are correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:289 -msgid "Answer Preview" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:391 -msgid "At least one of the answers above is NOT correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:291 -msgid "Correct Answer" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:288 -msgid "Entered" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:238 -msgid "FeedbackMessage" -msgstr "" - -#: PG/macros/problemRandomize.pl:185 PG/macros/problemRandomize.pl:186 -msgid "Get a new version of this problem" -msgstr "" - -#: PG/macros/compoundProblem.pl:470 -msgid "Go back to Part 1" -msgstr "" - -#: PG/macros/compoundProblem.pl:291 PG/macros/compoundProblem.pl:480 -#: PG/macros/compoundProblem.pl:491 -msgid "Go on to next part" -msgstr "" - -#: PG/macros/problemRandomize.pl:409 -msgid "Hardcopy will always print the original version of the problem." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint:" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint: " -msgstr "" - -#: PG/macros/problemRandomize.pl:408 -msgid "If you come back to it later, it may revert to its original version." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1226 -msgid "Instructor solution preview: show the student solution after due date." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:292 -msgid "Message" -msgstr "" - -#: PG/macros/problemRandomize.pl:382 PG/macros/problemRandomize.pl:407 -msgid "Note:" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:276 +#: templates/RPCRenderFormats/default.html.ep:60 +#: templates/RPCRenderFormats/default.json.ep:34 msgid "Preview My Answers" msgstr "" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:290 -msgid "Result" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:302 -msgid "Results for this submission" -msgstr "" - -#: PG/macros/problemRandomize.pl:187 -msgid "Set random seed to:" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:277 -msgid "Show correct answers" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1554 PG/macros/PGbasicmacros.pl:1555 -msgid "Solution:" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1553 -msgid "Solution: " -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:377 -msgid "Some answers will be graded later." +#: templates/RPCRenderFormats/default.html.ep:68 +#: templates/RPCRenderFormats/default.json.ep:38 +msgid "Show Correct Answers" msgstr "" -#: RenderApp/Controller/FormatRenderedProblem.pm:278 +#: templates/RPCRenderFormats/default.html.ep:64 msgid "Submit Answers" msgstr "" -#: PG/macros/compoundProblem.pl:502 -msgid "Submit your answers again to go on to the next part." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:379 -msgid "The answer above is NOT correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:375 -msgid "The answer above is correct." -msgstr "" - -#: PG/macros/problemRandomize.pl:407 -msgid "This is a new (re-randomized) version of the problem." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:3084 -msgid "This problem contains a video which must be viewed online." -msgstr "" - -#: PG/macros/compoundProblem.pl:602 -msgid "This problem has more than one part." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:248 -msgid "Ungraded" -msgstr "" - -#: PG/macros/PGanswermacros.pl:1693 -msgid "You can earn partial credit on this problem." -msgstr "" - -#: PG/macros/problemRandomize.pl:383 -msgid "You can get a new version of this problem after the due date." -msgstr "" - -#: PG/macros/compoundProblem.pl:610 -msgid "You may not change your answers when going on to the next part!" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:3079 -msgid "Your browser does not support the video tag." -msgstr "" - -#: PG/macros/compoundProblem.pl:603 -msgid "Your score for this attempt is for this part only;" -msgstr "" - -#. (wwRound(0, $problemResult->{score} * 100) -#: RenderApp/Controller/FormatRenderedProblem.pm:215 -msgid "Your score on this attempt is %1" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:217 -msgid "Your score was not recorded." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:645 PG/macros/PGbasicmacros.pl:656 -msgid "answer" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:669 -msgid "column" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:244 -msgid "correct" -msgstr "" - -#. ('j','k','_0') -#. ('j','k') -#: PG/lib/Parser/List/Vector.pm:35 PG/lib/Value/Vector.pm:278 -#: PG/macros/contextLimitedVector.pl:94 -msgid "i" -msgstr "" - -#: PG/macros/contextPiecewiseFunction.pl:774 -msgid "if" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:253 -msgid "incorrect" -msgstr "" - -#: PG/macros/contextPiecewiseFunction.pl:777 -msgid "otherwise" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:662 -msgid "part" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:651 -msgid "problem" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:668 -msgid "row" -msgstr "" - -#: PG/macros/compoundProblem.pl:470 PG/macros/compoundProblem.pl:480 -msgid "when you submit your answers" +#: templates/RPCRenderFormats/default.html.ep:79 +msgid "Warning messages" msgstr "" -#: PG/macros/compoundProblem.pl:604 -msgid "your overall score is for all the parts combined." +#. (% wwRound(0, $rh_result->{problem_result}{score} * 100) +#. (wwRound(0, $rh_result->{problem_result}{score} * 100) +#: templates/RPCRenderFormats/default.html.ep:42 +#: templates/RPCRenderFormats/default.json.ep:29 +msgid "You received a score of %1 for this attempt." msgstr "" diff --git a/lib/WeBWorK/Localize/heb.po b/lib/WeBWorK/Localize/heb.po index 6b18b61e2..5ced9374c 100644 --- a/lib/WeBWorK/Localize/heb.po +++ b/lib/WeBWorK/Localize/heb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: webwork2\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: 2021-08-12 17:00+0300\n" +"PO-Revision-Date: 2025-06-21 11:48-0700\n" "Last-Translator: Nathan Wallach\n" "Language: he\n" "MIME-Version: 1.0\n" @@ -16,232 +16,159 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % " "1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n" -#. (wwRound(0, $answerScore*100) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:255 -msgid "%1% correct" -msgstr "%1% נכון" - -#. ($numBlanks) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:395 -msgid "%quant(%1,of the questions remains,of the questions remain) unanswered." -msgstr "%quant(%1, מהשאלות לא נענתה, מהשאלות לא נענו)." - -#: PG/macros/PGbasicmacros.pl:1277 PG/macros/PGbasicmacros.pl:1286 -msgid "" -"(Instructor hint preview: show the student hint after the following number " -"of attempts:" -msgstr "(צפייה ברמז למורה: הראה לתלמיד את הרמז לאחר מספר זה של נסיונות:" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:386 -msgid "All of the answers above are correct." -msgstr "כל התשובות לעיל הן נכונות." - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:384 -msgid "All of the gradeable answers above are correct." -msgstr "כל התשבות לעיל שניתנות לבדיקה הן נכונות." - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:289 -msgid "Answer Preview" -msgstr "תצוגה מקדימה של תשובות" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:391 -msgid "At least one of the answers above is NOT correct." -msgstr "לפחות אחת מהתשובות למעלה היא לא נכונה." - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:291 -msgid "Correct Answer" -msgstr "תשובה נכונה" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:288 -msgid "Entered" -msgstr "הוזן" - +#: templates/RPCRenderFormats/default.json.ep:36 +msgid "Check Answers" +msgstr "" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:238 -msgid "FeedbackMessage" -msgstr "הודעת משוב" +#: templates/RPCRenderFormats/default.html.ep:90 +msgid "PG warning messages" +msgstr "" -#: PG/macros/problemRandomize.pl:185 PG/macros/problemRandomize.pl:186 -msgid "Get a new version of this problem" -msgstr "קבל גרסה חדשה של שאלה זו." +#: templates/RPCRenderFormats/default.html.ep:60 +#: templates/RPCRenderFormats/default.json.ep:34 +msgid "Preview My Answers" +msgstr "צפייה מוקדמת בתשובות שלי" -#: PG/macros/compoundProblem.pl:470 -msgid "Go back to Part 1" +#: templates/RPCRenderFormats/default.html.ep:68 +#: templates/RPCRenderFormats/default.json.ep:38 +msgid "Show Correct Answers" msgstr "" -#: PG/macros/compoundProblem.pl:291 PG/macros/compoundProblem.pl:480 -#: PG/macros/compoundProblem.pl:491 -msgid "Go on to next part" -msgstr "" +#: templates/RPCRenderFormats/default.html.ep:64 +msgid "Submit Answers" +msgstr "שלח תשובות לבדיקה" -#: PG/macros/problemRandomize.pl:409 -msgid "Hardcopy will always print the original version of the problem." +#: templates/RPCRenderFormats/default.html.ep:79 +msgid "Warning messages" msgstr "" -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint:" -msgstr "רמז:" +#. (% wwRound(0, $rh_result->{problem_result}{score} * 100) +#. (wwRound(0, $rh_result->{problem_result}{score} * 100) +#: templates/RPCRenderFormats/default.html.ep:42 +#: templates/RPCRenderFormats/default.json.ep:29 +msgid "You received a score of %1 for this attempt." +msgstr "" -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint: " -msgstr "רמז: " +#~ msgid "%1% correct" +#~ msgstr "%1% נכון" -#: PG/macros/problemRandomize.pl:408 -msgid "If you come back to it later, it may revert to its original version." -msgstr "" +#~ msgid "" +#~ "%quant(%1,of the questions remains,of the questions remain) unanswered." +#~ msgstr "%quant(%1, מהשאלות לא נענתה, מהשאלות לא נענו)." -#: PG/macros/PGbasicmacros.pl:1226 -msgid "Instructor solution preview: show the student solution after due date." -msgstr "הצגת פתרון למורה: הראה לתלמיד פתרון לאחר מועד ההגשה." +#~ msgid "" +#~ "(Instructor hint preview: show the student hint after the following " +#~ "number of attempts:" +#~ msgstr "(צפייה ברמז למורה: הראה לתלמיד את הרמז לאחר מספר זה של נסיונות:" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:292 -msgid "Message" -msgstr "הודעה" +#~ msgid "All of the answers above are correct." +#~ msgstr "כל התשובות לעיל הן נכונות." -#: PG/macros/problemRandomize.pl:382 PG/macros/problemRandomize.pl:407 -msgid "Note:" -msgstr "הערה:" +#~ msgid "All of the gradeable answers above are correct." +#~ msgstr "כל התשבות לעיל שניתנות לבדיקה הן נכונות." -#: RenderApp/Controller/FormatRenderedProblem.pm:276 -msgid "Preview My Answers" -msgstr "צפייה מוקדמת בתשובות שלי" +#~ msgid "Answer Preview" +#~ msgstr "תצוגה מקדימה של תשובות" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:290 -msgid "Result" -msgstr "תוצאות" +#~ msgid "At least one of the answers above is NOT correct." +#~ msgstr "לפחות אחת מהתשובות למעלה היא לא נכונה." -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:302 -msgid "Results for this submission" -msgstr "תוצאות של הגשה זו" +#~ msgid "Correct Answer" +#~ msgstr "תשובה נכונה" -#: PG/macros/problemRandomize.pl:187 -msgid "Set random seed to:" -msgstr "" +#~ msgid "Entered" +#~ msgstr "הוזן" -#: RenderApp/Controller/FormatRenderedProblem.pm:277 -msgid "Show correct answers" -msgstr "הראה תשובות נכונות" +#~ msgid "FeedbackMessage" +#~ msgstr "הודעת משוב" -#: PG/macros/PGbasicmacros.pl:1554 PG/macros/PGbasicmacros.pl:1555 -msgid "Solution:" -msgstr "פתרון"" +#~ msgid "Get a new version of this problem" +#~ msgstr "קבל גרסה חדשה של שאלה זו." -#: PG/macros/PGbasicmacros.pl:1553 -msgid "Solution: " -msgstr "פתרון: " +#~ msgid "Hint:" +#~ msgstr "רמז:" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:377 -msgid "Some answers will be graded later." -msgstr "חלק מהתשובות ינוקדו מאוחר יותר." +#~ msgid "Hint: " +#~ msgstr "רמז: " -#: RenderApp/Controller/FormatRenderedProblem.pm:278 -msgid "Submit Answers" -msgstr "שלח תשובות לבדיקה" +#~ msgid "" +#~ "Instructor solution preview: show the student solution after due date." +#~ msgstr "הצגת פתרון למורה: הראה לתלמיד פתרון לאחר מועד ההגשה." -#: PG/macros/compoundProblem.pl:502 -msgid "Submit your answers again to go on to the next part." -msgstr "שלח את התשובות שוב כדי להתקדם לחלק הבא." +#~ msgid "Message" +#~ msgstr "הודעה" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:379 -msgid "The answer above is NOT correct." -msgstr "התשובה לעיל היא לא נכונה." +#~ msgid "Note:" +#~ msgstr "הערה:" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:375 -msgid "The answer above is correct." -msgstr "התשובה למעלה נכונה." +#~ msgid "Result" +#~ msgstr "תוצאות" -#: PG/macros/problemRandomize.pl:407 -msgid "This is a new (re-randomized) version of the problem." -msgstr "הנה גרסה חדשה של השאלה." +#~ msgid "Results for this submission" +#~ msgstr "תוצאות של הגשה זו" -#: PG/macros/PGbasicmacros.pl:3084 -msgid "This problem contains a video which must be viewed online." -msgstr "השאלה מכילה וידיאו שיש לראות באופן מקוון." +#~ msgid "Show correct answers" +#~ msgstr "הראה תשובות נכונות" -#: PG/macros/compoundProblem.pl:602 -msgid "This problem has more than one part." -msgstr "" +#~ msgid "Solution:" +#~ msgstr "פתרון" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:248 -msgid "Ungraded" -msgstr "לא נוקד" +#~ msgid "Solution: " +#~ msgstr "פתרון: " -#: PG/macros/PGanswermacros.pl:1693 -msgid "You can earn partial credit on this problem." -msgstr "ניתן לקבל ניקוד חלקי בשאלה זו." +#~ msgid "Some answers will be graded later." +#~ msgstr "חלק מהתשובות ינוקדו מאוחר יותר." -#: PG/macros/problemRandomize.pl:383 -msgid "You can get a new version of this problem after the due date." -msgstr "" +#~ msgid "Submit your answers again to go on to the next part." +#~ msgstr "שלח את התשובות שוב כדי להתקדם לחלק הבא." -#: PG/macros/compoundProblem.pl:610 -msgid "You may not change your answers when going on to the next part!" -msgstr "לא ניתן לשנות תשובות כאשר אתה מתקדם לחלק הבא!" +#~ msgid "The answer above is NOT correct." +#~ msgstr "התשובה לעיל היא לא נכונה." -#: PG/macros/PGbasicmacros.pl:3079 -msgid "Your browser does not support the video tag." -msgstr "הדפדפן שלך לא תומך ב-video tag." +#~ msgid "The answer above is correct." +#~ msgstr "התשובה למעלה נכונה." -#: PG/macros/compoundProblem.pl:603 -msgid "Your score for this attempt is for this part only;" -msgstr "" +#~ msgid "This is a new (re-randomized) version of the problem." +#~ msgstr "הנה גרסה חדשה של השאלה." -#. (wwRound(0, $problemResult->{score} * 100) -#: RenderApp/Controller/FormatRenderedProblem.pm:215 -msgid "Your score on this attempt is %1" -msgstr "הציון שלך בהגשה זו הוא %1" +#~ msgid "This problem contains a video which must be viewed online." +#~ msgstr "השאלה מכילה וידיאו שיש לראות באופן מקוון." -#: RenderApp/Controller/FormatRenderedProblem.pm:217 -msgid "Your score was not recorded." -msgstr "הציון שלך לא נשמר." +#~ msgid "Ungraded" +#~ msgstr "לא נוקד" -#: PG/macros/PGbasicmacros.pl:645 PG/macros/PGbasicmacros.pl:656 -msgid "answer" -msgstr "תשובה" +#~ msgid "You can earn partial credit on this problem." +#~ msgstr "ניתן לקבל ניקוד חלקי בשאלה זו." -#: PG/macros/PGbasicmacros.pl:669 -msgid "column" -msgstr "עמודה" +#~ msgid "You may not change your answers when going on to the next part!" +#~ msgstr "לא ניתן לשנות תשובות כאשר אתה מתקדם לחלק הבא!" -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:244 -msgid "correct" -msgstr "נכון" +#~ msgid "Your browser does not support the video tag." +#~ msgstr "הדפדפן שלך לא תומך ב-video tag." -#. ('j','k','_0') -#. ('j','k') -#: PG/lib/Parser/List/Vector.pm:35 PG/lib/Value/Vector.pm:278 -#: PG/macros/contextLimitedVector.pl:94 -msgid "i" -msgstr "" +#~ msgid "Your score on this attempt is %1" +#~ msgstr "הציון שלך בהגשה זו הוא %1" -#: PG/macros/contextPiecewiseFunction.pl:774 -msgid "if" -msgstr "" +#~ msgid "Your score was not recorded." +#~ msgstr "הציון שלך לא נשמר." -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:253 -msgid "incorrect" -msgstr "לא נכון" +#~ msgid "answer" +#~ msgstr "תשובה" -#: PG/macros/contextPiecewiseFunction.pl:777 -msgid "otherwise" -msgstr "" +#~ msgid "column" +#~ msgstr "עמודה" -#: PG/macros/PGbasicmacros.pl:662 -msgid "part" -msgstr "חלק" +#~ msgid "correct" +#~ msgstr "נכון" -#: PG/macros/PGbasicmacros.pl:651 -msgid "problem" -msgstr "שאלה" +#~ msgid "incorrect" +#~ msgstr "לא נכון" -#: PG/macros/PGbasicmacros.pl:668 -msgid "row" -msgstr "שורה" +#~ msgid "part" +#~ msgstr "חלק" -#: PG/macros/compoundProblem.pl:470 PG/macros/compoundProblem.pl:480 -msgid "when you submit your answers" -msgstr "" +#~ msgid "problem" +#~ msgstr "שאלה" -#: PG/macros/compoundProblem.pl:604 -msgid "your overall score is for all the parts combined." -msgstr "" +#~ msgid "row" +#~ msgstr "שורה" diff --git a/lib/WeBWorK/Localize/renderer.pot b/lib/WeBWorK/Localize/renderer.pot new file mode 100644 index 000000000..31fc54178 --- /dev/null +++ b/lib/WeBWorK/Localize/renderer.pot @@ -0,0 +1,46 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: templates/RPCRenderFormats/default.json.ep:36 +msgid "Check Answers" +msgstr "" + +#: templates/RPCRenderFormats/default.html.ep:90 +msgid "PG warning messages" +msgstr "" + +#: templates/RPCRenderFormats/default.html.ep:60 templates/RPCRenderFormats/default.json.ep:34 +msgid "Preview My Answers" +msgstr "" + +#: templates/RPCRenderFormats/default.html.ep:68 templates/RPCRenderFormats/default.json.ep:38 +msgid "Show Correct Answers" +msgstr "" + +#: templates/RPCRenderFormats/default.html.ep:64 +msgid "Submit Answers" +msgstr "" + +#: templates/RPCRenderFormats/default.html.ep:79 +msgid "Warning messages" +msgstr "" + +#. (% wwRound(0, $rh_result->{problem_result}{score} * 100) +#. (wwRound(0, $rh_result->{problem_result}{score} * 100) +#: templates/RPCRenderFormats/default.html.ep:42 templates/RPCRenderFormats/default.json.ep:29 +msgid "You received a score of %1 for this attempt." +msgstr "" diff --git a/lib/WeBWorK/Localize/standalone.pot b/lib/WeBWorK/Localize/standalone.pot deleted file mode 100644 index b5f33b07b..000000000 --- a/lib/WeBWorK/Localize/standalone.pot +++ /dev/null @@ -1,241 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. (wwRound(0, $answerScore*100) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:255 -msgid "%1% correct" -msgstr "" - -#. ($numBlanks) -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:395 -msgid "%quant(%1,of the questions remains,of the questions remain) unanswered." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1277 PG/macros/PGbasicmacros.pl:1286 -msgid "(Instructor hint preview: show the student hint after the following number of attempts:" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:386 -msgid "All of the answers above are correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:384 -msgid "All of the gradeable answers above are correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:289 -msgid "Answer Preview" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:391 -msgid "At least one of the answers above is NOT correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:291 -msgid "Correct Answer" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:288 -msgid "Entered" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:238 -msgid "FeedbackMessage" -msgstr "" - -#: PG/macros/problemRandomize.pl:185 PG/macros/problemRandomize.pl:186 -msgid "Get a new version of this problem" -msgstr "" - -#: PG/macros/compoundProblem.pl:470 -msgid "Go back to Part 1" -msgstr "" - -#: PG/macros/compoundProblem.pl:291 PG/macros/compoundProblem.pl:480 PG/macros/compoundProblem.pl:491 -msgid "Go on to next part" -msgstr "" - -#: PG/macros/problemRandomize.pl:409 -msgid "Hardcopy will always print the original version of the problem." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint:" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1558 -msgid "Hint: " -msgstr "" - -#: PG/macros/problemRandomize.pl:408 -msgid "If you come back to it later, it may revert to its original version." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1226 -msgid "Instructor solution preview: show the student solution after due date." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:292 -msgid "Message" -msgstr "" - -#: PG/macros/problemRandomize.pl:382 PG/macros/problemRandomize.pl:407 -msgid "Note:" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:276 -msgid "Preview My Answers" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:290 -msgid "Result" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:302 -msgid "Results for this submission" -msgstr "" - -#: PG/macros/problemRandomize.pl:187 -msgid "Set random seed to:" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:277 -msgid "Show correct answers" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1554 PG/macros/PGbasicmacros.pl:1555 -msgid "Solution:" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:1553 -msgid "Solution: " -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:377 -msgid "Some answers will be graded later." -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:278 -msgid "Submit Answers" -msgstr "" - -#: PG/macros/compoundProblem.pl:502 -msgid "Submit your answers again to go on to the next part." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:379 -msgid "The answer above is NOT correct." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:375 -msgid "The answer above is correct." -msgstr "" - -#: PG/macros/problemRandomize.pl:407 -msgid "This is a new (re-randomized) version of the problem." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:3084 -msgid "This problem contains a video which must be viewed online." -msgstr "" - -#: PG/macros/compoundProblem.pl:602 -msgid "This problem has more than one part." -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:248 -msgid "Ungraded" -msgstr "" - -#: PG/macros/PGanswermacros.pl:1693 -msgid "You can earn partial credit on this problem." -msgstr "" - -#: PG/macros/problemRandomize.pl:383 -msgid "You can get a new version of this problem after the due date." -msgstr "" - -#: PG/macros/compoundProblem.pl:610 -msgid "You may not change your answers when going on to the next part!" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:3079 -msgid "Your browser does not support the video tag." -msgstr "" - -#: PG/macros/compoundProblem.pl:603 -msgid "Your score for this attempt is for this part only;" -msgstr "" - -#. (wwRound(0, $problemResult->{score} * 100) -#: RenderApp/Controller/FormatRenderedProblem.pm:215 -msgid "Your score on this attempt is %1" -msgstr "" - -#: RenderApp/Controller/FormatRenderedProblem.pm:217 -msgid "Your score was not recorded." -msgstr "" - -#: PG/macros/PGbasicmacros.pl:645 PG/macros/PGbasicmacros.pl:656 -msgid "answer" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:669 -msgid "column" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:244 -msgid "correct" -msgstr "" - -#. ('j','k','_0') -#. ('j','k') -#: PG/lib/Parser/List/Vector.pm:35 PG/lib/Value/Vector.pm:278 PG/macros/contextLimitedVector.pl:94 -msgid "i" -msgstr "" - -#: PG/macros/contextPiecewiseFunction.pl:774 -msgid "if" -msgstr "" - -#: WeBWorK/lib/WeBWorK/Utils/AttemptsTable.pm:253 -msgid "incorrect" -msgstr "" - -#: PG/macros/contextPiecewiseFunction.pl:777 -msgid "otherwise" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:662 -msgid "part" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:651 -msgid "problem" -msgstr "" - -#: PG/macros/PGbasicmacros.pl:668 -msgid "row" -msgstr "" - -#: PG/macros/compoundProblem.pl:470 PG/macros/compoundProblem.pl:480 -msgid "when you submit your answers" -msgstr "" - -#: PG/macros/compoundProblem.pl:604 -msgid "your overall score is for all the parts combined." -msgstr "" diff --git a/lib/WeBWorK/PreTeXt.pm b/lib/WeBWorK/PreTeXt.pm index da0401f77..5a557bcbe 100644 --- a/lib/WeBWorK/PreTeXt.pm +++ b/lib/WeBWorK/PreTeXt.pm @@ -16,12 +16,11 @@ sub render_ptx { return Mojo::IOLoop->subprocess->run_p(sub { my $pg = WeBWorK::PG->new( - showSolutions => 1, - showHints => 1, - processAnswers => 1, - displayMode => 'PTX', - language_subroutine => WeBWorK::PG::Localize::getLoc('en'), - problemSeed => $p->{problemSeed} // 1234, + showSolutions => 1, + showHints => 1, + processAnswers => 1, + displayMode => 'PTX', + problemSeed => $p->{problemSeed} // 1234, $p->{problemUUID} ? (problemUUID => $p->{problemUUID}) : (), $p->{sourceFilePath} ? (sourceFilePath => $p->{sourceFilePath}) : (), $source ? (r_source => \$source) : () diff --git a/lib/WeBWorK/RenderProblem.pm b/lib/WeBWorK/RenderProblem.pm index 44bbd9c88..78fc8992c 100644 --- a/lib/WeBWorK/RenderProblem.pm +++ b/lib/WeBWorK/RenderProblem.pm @@ -16,8 +16,6 @@ use lib "$ENV{PG_ROOT}/lib"; use WeBWorK::PG; use WeBWorK::Utils::Tags; -use WeBWorK::Localize; -#use WeBWorK::FormatRenderedProblem; ################################################## # create log files :: expendable @@ -223,7 +221,6 @@ sub standaloneRenderer { psvn => $inputs_ref->{psvn}, problemUUID => $inputs_ref->{problemUUID}, language => $inputs_ref->{language} // 'en', - language_subroutine => WeBWorK::Localize::getLoc($inputs_ref->{language} // 'en'), templateDirectory => "$ENV{RENDER_ROOT}/", htmlURL => 'pg_files/', tempURL => 'pg_files/tmp/',