Localization and Translation of Webwork Into Other Languages- Various Questions

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

by Danny Glin -
Number of replies: 0

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.



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

$pi = Real("pi");


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



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.