WeBWorK Main Forum

Customizing phrasing

Customizing phrasing

by Alex Jordan -
Number of replies: 4

I'd like to customize some of the language that WeBWorK uses in certain messages and labels that students see. There are several things I'd like to change, but for the sake of an example, I'd like to change most instances of the word "problem" to "exercise".

Now, how to go about doing this? At first I thought to copy the en.po localization file to a new file, say pcc.po.  Make edits to pcc.po, and then set the "language" to pcc in localOverrides.conf. I did that and it works in the sense that the messages now use "exercise" instead of "problem".

However this simultaneously makes the site's HTML pages have lang="pcc" in their html root element. And that seems like something I shouldn't allow to happen.

Is there a good way to do what I am trying to do? I'm still using English, just modified from the distribution content. I could directly edit en.po, but I don't want conflicts with origin/main.



In reply to Alex Jordan

Re: Customizing phrasing

by Robert Mařík -

What about the file en_US.po ?


Robert

In reply to Robert Mařík

Re: Customizing phrasing

by Alex Jordan -

I could use that, but I'm trying to avoid messing with a file that is tracked by git.

I guess what I'm after is separating the language declaration in the HTML root from the localization file name. I should look at the code that makes the language declaration and see what can be done.

In reply to Alex Jordan

Re: Customizing phrasing

by Robert Mařík -
Hm , I thought that the name en_US.po is safe, since git uses en_us.po. Anyway could en_GB.po be the solution?
In reply to Robert Mařík

Re: Customizing phrasing

by Alex Jordan -

Oh I see what you mean. Sorry, I misunderstood.

I'll try that. Something is weird with how using en.po already makes en-US in the HTML attribute, but using (for example) pcc.po puts pcc in the HTML attribute.

Maybe I can get away with en_pcc.po? I'll experiment.