Add support for setting text language and direction of the generated HTML page and the DIV containing the problems#67
Merged
Conversation
from https://github.com/openwebwork/webwork2 which provides support for setting page level and problem level language and text direction based on the course/request language and settings provided by the PG file. Have RenderApp/Controller/FormatRenderedProblem.pm use that, where we always force the "choice" for the main HTML page language based on the request parameter "language" (instead of a course setting) and attempt to use the language/direction requested by a PGproblem, falling back to English and LTR, as the OPL need that. Problems which need a language or direction set should use: SET_PROBLEM_LANGUAGE() and/or SET_PROBLEM_TEXTDIRECTION()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copy
lib/WeBWorK/Utils/LanguageAndDirection.pmfrom https://github.com/openwebwork/webwork2 which provides support for setting page level and problem level language and text direction based on the course/request language and settings provided by the PG file.Have
RenderApp/Controller/FormatRenderedProblem.pmuse that, where we always force the "choice" for the main HTML page language based on the request parameter "language" (instead of a course setting) and attempt to use the language/direction requested by a PG problem, falling back to English and LTR, as the OPL needs that.Problems which need a language or direction set should use:
SET_PROBLEM_LANGUAGE()and/orSET_PROBLEM_TEXTDIRECTION()A screenshot of a Hebrew PG problem (formatted from right-to-left, as needed) when the English feedback messages are in use (just the change from this PR):
A screenshot when the Hebrew feedback messages from #66 are also in use:

Here is a sample PG problem which can be used to test this: