New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add translations to QATrack+ #620
base: translations
Are you sure you want to change the base?
Conversation
Message will now only show after 3 failed pings. Ping interval is configurable with PING_INTERVAL_S setting and message is less intrusive.
Some reports were not taking into account the active status of the unit as well as the active status of the UTC. This patch resolves that problem. Fixes issue qatrackplus#554
…n attempt to alleviate auto save contention exceptions in SQL Server
Update Added localization of datetime formatsTo do so, Note: there are some hard-coded datetime formats in a couple of the templates, e.g.:
We should probably find a way in the future that these can be customized in the future. For the moment, they are being localized by Django when a view is rendered, but they can be a little inconsistent with the choices made by the translator in Included more detailed docs on translationsBasic instructions on how to add a translation, and a new entry in the config docs for translating the Translating |
Awesome! I have currently merged this in the branch 3.2.0_translations. A few minor merge conflicts but overall the merge went very smoothly. I'm out of time for now but will test things more later and merge into 3.2.0. Thanks for all the hard work that went into this so far! |
This pull request is for a first version of QATrack+ with working translations and an initial partial translation to French.
In this work, the following was done:
locale
directories were created in the root of the project and in each app subdirectory to be translated; this allows Django to find the message files and generate per-app message files instead of one big message files for all stringssettings.py
:LOCALE_PATHS
variable was properly set to allow Django to find all message filesLANGUAGES
variable was set to English and French (with translatable strings)"Do not treat"
DEFAULT_WARNING_MESSAGE
was made translatableCommonMiddleware
was placed afterSessionMiddleware
as per https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#how-django-discovers-language-preference-1django-admin makemessages
(or alternativelypython manage.py makemessages
)django-admin compilemessages
(or alternativelypython manage.py compilemessages
)makefile
was updated with minor changes toyapf
andflake8
targets and new targetsmessages
andmake-messages
urls.py
,path('i18n/', include('django.conf.urls.i18n'))
, was added. This could be considered for future use and could be removed or commented out for the moment. See https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#the-set-language-redirect-viewFor the moment, the language is set globally via
local_settings.py
by using, for example,LANGUAGE_CODE = "fr"
.There is support in Django for using a display language based on the browser preferences or by including a widget in the frontend, but this was not activated at present.
LANGUAGE_CODE = "en"
was added totest_settings.py
so that tests would pass even if another language is used inlocal_settings.py
.The partial translations to French were made using a local instance of Weblate.
Note that as per the developer guide, yapf was run, which produced a lot of diffs.