Closed enigmathix closed 2 years ago
Thanks! I'd like to accept this as it seems useful for other teams who may want to run non-English hunts. However, these changes are extensive; we'll do our best to keep strings translated when we make changes or add features, but we won't have the resources to thoroughly verify that we haven't missed or broken anything. I'm not going to put you on the hook for maintenance, but if you'd like, you could add yourself to the README as a point of contact for any teams who may need i18n help.
I added my address in the README file.
I'd be glad to help with possible issues but the worst that could happen is if new strings are added and the existing i18n syntax is not followed (e.g. _(...)
in python and {% translate ... %}
in templates), then those would be harder to track down. Regardless, it won't break anything though, the English text would just appear on the site.
Thanks.
I think I addressed all the changes mentioned above. Let me know if I missed any.
Thank you!
This is the i18n version of gph-site, so that a puzzle hunt can easily be made in any language by creating a translation file and changing the LANGUAGE_CODE setting. The updated README explains the process. The code was tested with a real world French puzzle hunt. The code changes fall into 3 categories:
_(...)
(_
is the usual alias for the gettext function from django.utils.translation){% translate ... %}
or{% blocktranslate ... %}...{% endblocktranslate %}
A few more code changes were necessary:
gph/formats/<lang>/formats.py
. django uses this for the admin interface as well.u'...'
)puzzles/models.py and puzzles/__init__.py
include verbose table and field names (including plurals) so they can be translated for the admin interface__doc__
field in shortcuts now dynamically filled in so that it can be translated (this was hacky anyway)locale/fr_FR/LC_MESSAGES/django.po
andlocale/fr_FR/LC_MESSAGES/djangojs.po
If you merge this, please squash the commits.