maketext - patch so it works inside PG also #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moving drdrew42#86 to here.
This continues work started in drdrew42#66.
maketext
calls inside PG were not using the language requested by the API request, aslib/WeBWorK/lib/WeBWorK/PG.pm
sets(the language later used for
maketext
calls inside PG) and the$seed_ce
created by the Standalone renderer was not providing alanguage
setting.To fix the issue we add a
language
setting to the$seed_ce
which will get passed into PG.The change is done so that the core PG code pulled in from outside the Standalone repository does not need to be modified.
After this PR the
maketext
inside PG should hopefully work as well as they do in webwork2 and pg version 2.16. (The limitations ofmaketext
inWWSafe
probably still apply, somaketext
calls inside PG cannot use a parameter at present.)Testing can be done using via
localhost
when the renderer is running locally via Docker by checking the output of a page likehttp://localhost:3000/render-api?sourceFilePath=Library/Mizzou/Algebra/inverse_functions_and_relations/find_dom_range_inv_graph_01.pg&problemSeed=1&outputFormat=simple&language=heb
before and after the patch.Before the patch, you should see
You can earn partial credit on this problem.
in English just above the buttons (which will be in Hebrew) and after the patch (and a restart of the container) you should seeניתן לקבל ניקוד חלקי בשאלה זו.
in Hebrew.Before the patch:
After the patch:
At present, Hebrew is the only language other than English for which there is a PO translation dictionary for the renderer.
Use of any invalid value for
language
will causemaketext
to fall back to the default (English) phrases.