WeBWorK Main Forum

: Issues Translating WeBWorK to Traditional Chinese Interface

: Issues Translating WeBWorK to Traditional Chinese Interface

by wquantium Huang -
Number of replies: 6

I attempted to translate WeBWorK into a Traditional Chinese interface. However, I noticed discrepancies in the .pot file between the text and its location or description within the system. For example:

  • Email instructor -> Email Instructor

  • /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm:995 -> 996

After correcting these discrepancies, I still encountered two unresolved issues:

  1. Assignment Dates Cannot Be Selected via Calendar After Switching Language In the English interface (or other languages provided in WeBWorK), dates can be selected using the calendar icon. However, after switching the language to my new .po file, the dates disappear, and clicking the calendar icon does not bring up the date selection interface.

  2. Variable Documentation Remains in English The Variable Documentation within the system does not switch to Traditional Chinese. I have checked the text and line numbers in the file locations to ensure they match, but the issue persists.

Are there additional settings I need to adjust to ensure these elements display in the translated language? Thanks in advance for your assistance!


In reply to wquantium Huang

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by Glenn Rice -

Note that the line numbers in the po file don't matter.  They are only there to help translators determine how to translate a string by looking in the code at the given location.  That is not used to find the translation when the app runs.

The reason that the variable documentation help text is not translated is because there is a missing maketext call in templates/ContentGenerator/Instructor/Config/config_help.html.ep.

I am not sure about the date issue.  What is the name of the po file that you are using?  I am guessing zh-HK.po, but am not certain.

In reply to Glenn Rice

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by wquantium Huang -
I tried translating the system into the traditional Chinese used in Taiwan instead of just selecting zh-HK from the system menu. I named the .po file zh-TW and followed the instructions from the website (https://webwork.maa.org/wiki/Instructions_for_translators) to place the .po file in the corresponding folder. That’s when I ran into the date issue I mentioned earlier.

Later, I tested using zh-HK and de directly from the system menu, and everything worked fine. But if I create a copy of an existing language in Localize and name it something like en-cp (essentially just a duplicate with a different name), I encounter the same problem when switching to en-cp. Please see https://imgur.com/a/FEamLaD. (Sorry, I’m not sure how to insert images into a reply.)

In addition, thank you for your reply regarding the variable documentation issue. I’ll try again to see if the problem gets resolved. Thanks again!
In reply to Glenn Rice

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by wquantium Huang -
I found a file named config_help.html.ep in the folder. Could you let me know which similar folder and file I should refer to in order to copy the maketext file for use? Figure link: https://imgur.com/taiMu59
(Apologies, I’m not an IT professional, so I’m not very familiar with the related terminology.)
In reply to wquantium Huang

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by Glenn Rice -

To fix the variable documentation not being translated change line 29 of of config_help.html.ep from

<div><%== $configObject->{doc2} || $configObject->{doc} %></div>

to

<div><%== maketext($configObject->{doc2} || $configObject->{doc}) %></div>

We will also make sure that is fixed for the next release of webwork.

As to the date issue, the thing is that the dates only work for the languages that are supported by webwork.  So if you create a new file name zh-TW.po, then there are other changes to the code that are needed to make everything work.  One change that needs to be made is to add a date/time format for 'zh-TW' to the datetimeFormats object in htdocs/js/DatePicker/datepicker.js.  The same change is also needed in htdocs/js/ProblemSetList/problemsetlist.js (that is the one that affects the page you were looking at).  Note that it is essential that the JavaScript format match the Perl DateTime::Locale format or things will not work right.

There may be some other changes needed for other things, but those are the changes needed to fix the date/time selectors.

In reply to Glenn Rice

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by wquantium Huang -
The translation for the variable documentation has been accurately presented! Thanks to your help sincerely, I have now completed the entire Traditional Chinese interface translation. During this semester's courses, I plan to review and refine the translated content, hoping to convey the original text's information clearly while expressing it in terminology commonly used in Taiwan. Additionally, I hope that in future updates of WeBWorK, the zh-TW language support can be included.

To confirm, should I now email the zh-TW.po and zh-TW.mo files (which were created) as attachments to Mike Gage? Or are there other channels where I also need to simultaneously transmit these files?
In reply to wquantium Huang

Re: : Issues Translating WeBWorK to Traditional Chinese Interface

by Glenn Rice -
Instead of emailing the files to someone, you should create a pull request at https://github.com/openwebwork/webwork2/pulls. If you don't know how to do that, then you could email the files to me or one of the other developers. Probably not Mike since he is not active with development much anymore.