numbas / editor

An editor for the Numbas e-learning system.
http://numbas.mathcentre.ac.uk
Apache License 2.0
59 stars 61 forks source link

Translation for templates and forms #509

Open johnyoonh opened 4 years ago

johnyoonh commented 4 years ago

I found two <blocktrans> tags in the templates, but they were not done extensively. I was about to undertake the task of tagging more of these texts with {% trans%} tags, as well as using ugettext_lazy in python files. I am thinking about using _ notation:

from django.utils.translation import ugettext_lazy as _

I was wondering how the maintainer wants to handle the resulting .po files. They will diverge from the json files that Numbas compiler generates. If kept separate, it will result in a diverged effort in translating on poeditor.com; combining them could be a maintenance hassle and an extra dependency. Two repositories are already coupled, and perhaps guidance on how de-coupled they need to be would be helpful.

The primary motivation behind the effort is how I disagree with the term "Group," "Exam," "Question." I want to use "Section," "Deck," and "Slide" instead. I think they are more generic. For URL endpoints, LocalMiddleware can be used, but this is not a priority.

If there are other details I should read over, let me know! I will catch up with the documentation soon.

christianp commented 4 years ago

Yes, there isn't any real translation at the moment. I haven't prioritised it, but it should be done at some point. I think the Numbas runtime translation can be considered completely separate to the editor. I certainly don't want to have to include strings that are only to do with the editor in the Numbas runtime.