Miscellaneous

Localization and Translation of Webwork Into Other Languages- Various Questions

Localization and Translation of Webwork Into Other Languages- Various Questions

by Ioannis Souldatos -
Number of replies: 1
Hello everyone,

I have various questions about the localization and translation of Webwork into other languages.

Objective: I have used Webwork as an instructor for more than 10 years. I am pretty familiar with its features. I have also installed Webwork a few times in various servers. A couple of years ago I started the localization and translation of Webwork into Greek with the help of various volunteers. We made some progress following the instructions from https://webwork.maa.org/wiki/Instructions_for_translators

However, various issues arose. I need some direction where to start and how difficult the problem seems to you.

Localization of Webwork

Issues
  • Is it possible to have Greek course names? E.g. "Ανάλυση" versus "Analysis". 
My first thought is to play around with the database settings. I am not sure what exactly is needed, but is it just an issue with the database? Or, do we have to adjust the Webwork code accordingly?
  • Same question for Greek assignment names.
  • The problems with radio buttons gave us problems when the various options were in Greek. I am assuming the radiobuttons.pg file will have to be rewritten. Any thoughts?
  • Is there a server-wide option so that Greek is the default language for any new course? I know I can change every course "by hand". So this is not an urgent need, but it would save a lot of time.
  • I need to translate the options "dne" and "(-)inf" into Greek. Any good starting point?
  • I would like to use the Greek names for trigonometric functions. E.g. "ημ(χ)" versus "sin(x)".
  • Related to the previous question is the need to use Greek variables. E.g. "χ" (Greek- chi) versus "x" (English- ex).
I tried adding a new variable into the context, but it gave me an error message. Similarly, we got error messages when using Greek in the commands Compute("...") and Formula("...") (this was expected). On the good side we can use Greek into Tex, e.g. $ημ(χ)=1$ will parse. 

  • I am not sure if I missed it, but we need "," (comma) to be the symbol for the decimal point. E.g. 3,141 indicates a number between 3 and 4.

Translation of Webwork Problems

So far we have translated about 2500 problems from the OPL into Greek, mainly Calculus problems. We would like to continue with Pre-Calculus problems and Algebra problems.

Issues
  • If the Greek problems are incorporated into the OPL is there a good way for someone to search ONLY for problems in Greek?
  • On a similar note, we would like the drop-down menus for the problems, e.g. "Calculus-single variable> Differentiation> Derivatives of Inverse Functions" to be translated into Greek.
Sorry if there are too many issues. I wrote all of them in one place. As I mentioned before, I need some direction where to start and how difficult the problem seems to you. I know some of these problems do not have an easy fix. But we are willing to put in some effort, even do some computer programming.
Thank you in advance.
In reply to Ioannis Souldatos

Re: Localization and Translation of Webwork Into Other Languages- Various Questions

by Danny Glin -

I can give some general comments here, and hopefully some of the community members with more experience using WeBWorK in other languages can fill in more info.

Regarding course names and assignment names, the WeBWorK code enforces that these only be made up of English letters, numbers, underscores and hyphens.  Historically this was to prevent issues with filenames and storing things in the database.  

Since WeBWorK now supports utf8 it's possible that those types of issues won't crop up when using letters from another alphabet.  You could test this by looking for regular expressions in the code that involve "a-z" or "\w" and rewriting them to include Greek letters as well.  Note that this could easily break things.  While some of the reasons for this limitation may not still apply, there could still be things that behave unpredictably.


If you want to change the language for all of the courses on your server, you can uncomment and edit the $language variable in /opt/webwork/webwork2/conf/localOverrides.conf.  This can always be overridden from the Course Configuration menu within an individual course.


In terms of using characters of other languages in problems, the results here will probably be mixed.  When the PG language was first created translations weren't taken into consideration, so it's likely that some things will just work, while others won't.

In terms of using Greek letters as variables, the following code snippet seemed to work for me using WeBWorK 2.17, though I haven't tested it extensively.

Context("Numeric");

Context()->variables->are('χ'=>"Real");

$f = Compute("χ^2");

$pi = Real("pi");

BEGIN_PGML

Enter the function [`[$f]`] in terms of the variable [`χ`]

[_____]{$f}

END_PGML


In terms of the names of functions and constants, if PG accepts Greek characters then it should be possible to redefine all of these to use their Greek names (or create aliases) within the Context, though this is not a very robust solution since this would have to be applied to every problem.  The better approach would be to work on proper internationalization of the PG libraries (MathObjects in particular) so that a user could supply a list of translations of all of the built in constants and functions and PG would just use the translated versions.  I don't know how big of a project this would be.


I'm a little surprised that WeBWorK doesn't handle using a comma as a decimal point since this is common in many languages, but I'm not aware of support for it at this point.