Skip to content

96 ‐ Contributing

LRVT edited this page Oct 2, 2024 · 4 revisions

New Languages

VoucherVault supports multiple languages already.

If your language is currently missing, I am happy for your translation contribution.

To do so, please clone the VoucherVault repository, add your new translations and create a pull request afterwards.

I'll then review the PR and likely merge it.

How to add new languages

  1. Identify the local name of your language to add. For example it for Italian.
  2. Add your new language to the LANGUAGES variable within the Django settings.py at /myproject/settings.py (see here).
  3. Create a new .po message file via django-admin makemessages -l it where it is the local name of your language.
  4. Add your translations to the .po file. Typically located at /locale/<locale>/LC_MESSAGES/django.po now. Ensure to translate all relevant strings.
  5. Compile the .po to .mo via django-admin compilemessages --locale it, where it is the local name of your newly added language.
  6. Spawn the VoucherVault app via python3 manage.py runserver --insecure. Validate that all strings are translated correcly by choosing your newly added language from the left sidebar. Adjust and recompile the .po file if necessary.
  7. If everything is translated, create a PR with your newly added language. Please file in the new directory created at /locale/ with your final .po and .mo files.

More details here:

https://docs.djangoproject.com/en/5.1/topics/i18n/translation/#localization-how-to-create-language-files

Warning

It may be that some keywords such as voucher, giftcard etc. are not translated everywhere.

If so, you can add such missing strings for translation manually to the .po file.

Typically, the following strings should be added at the end of the .po file and translated manually:

msgid "giftcard"
msgstr "<YOUR-TRANSLATION>"

msgid "loyaltycard"
msgstr "<YOUR-TRANSLATION>"

msgid "voucher"
msgstr "<YOUR-TRANSLATION>"

msgid "coupon"
msgstr "<YOUR-TRANSLATION>"

msgid "Threshold"
msgstr "<YOUR-TRANSLATION>"

New Features or Code Fixes

If you are a seasoned Django developer, I am happy to review and accept your Pull Request (PR).

To do so, please clone the VoucherVault repository, add your code changes or new features and create a pull request with a good description afterwards.

I'll then review the PR, if the SAST scanning by Bandit was successful. Likely merge, if the code is understandable and feature/change works.