Skip to content
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

Internationalization base #1246

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Talanor
Copy link
Contributor

@Talanor Talanor commented May 7, 2024

Say hello to our lord and savior: internationalization.

This is stable on my staging environment, but probably not production ready.
I'm mainly opening this for tracking purposes / discussion and feedback from users / maintainers (and to move on with my life).

--
Main points of contention :

  • Created a user Model, which will be useful and needed for future features, even though my deployment from testing to staging was smooth, can't guarantee it for other users since it alters the db in a non trivial way.
  • Django makemessages doesn't like manually tracked translations, but it also doesn't translate JS embedded in html templates. When running manage.py makemessages -a -d djangojs, it will comment out those translations. You can grep #~ in .po files and delete it to uncomment them before manage.py compilemessages
  • I'm not entirely happy with some translations including HTML, but languages are tricky and I don't see a way around that as of right now. Someone more knowledgeable will be needed in the long run.
  • Some translation blocks are not consistent (translating chunks vs translating the whole block with html) accross files. Not a major problem but not great.
  • A HOW_TO_translators.md should be added to explain the steps (even though it is well documented on django's doc)

Edit: Most FR translations were AI generated. Even though I reviewed most of it, some weird stuff might have escaped me.

Created a new user account
Rebased off of first divergent main commit
@Talanor Talanor changed the title Internationalisation base Internationalization base May 7, 2024
@yogeshojha
Copy link
Owner

Looks interesting, Thank you for the PR
which all languages are currently suppoted @Talanor ?

@Talanor
Copy link
Contributor Author

Talanor commented May 9, 2024

A few fixes are still needed, I'll get to them when I can.

But for now only french and english.
Any language can be added by copy/pasting the locale/**/en/django.po and locale/**/en/djangojs.po, editing them accordingly, relaunching makemessages and compilemessages.

@yogeshojha
Copy link
Owner

Thank you, I think FR, ES and EN would be a very good start.
Thank you again for initiating a great effort.

If there are some bugs to be fixed, do you mind keeping this MR in DRAFT please?

@Talanor

@Talanor Talanor marked this pull request as draft May 9, 2024 09:09
@Talanor Talanor marked this pull request as ready for review May 11, 2024 22:21
@Talanor
Copy link
Contributor Author

Talanor commented May 11, 2024

Ready for review / critiques / comments

@Talanor
Copy link
Contributor Author

Talanor commented May 13, 2024

Hey, regarding the push to 2.2.0, considering it's been 7 months since the last release (2.0 vs 2.1), I can't help but feel this PR will be discontinued and have to go through tremendous work to merge by then.

@yogeshojha
Copy link
Owner

@Talanor I am trying to go through the changes and release this asap.

I need to ask a few things,

  1. what are those locale/.mo and locale/.po binaries. I am afraid if we would want to push binaries to users. Problem is nobody knows what's inside them.

  2. How does someone change the language? Because I don't see that in UI.

  3. I see new app called Users. What's the purpose of that app?

@yogeshojha yogeshojha closed this Jul 1, 2024
@yogeshojha yogeshojha reopened this Jul 1, 2024
@yogeshojha
Copy link
Owner

Sorry I mistakenly closed this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants