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

Preparing localization for all UI messages and russian localization #450

Merged
merged 11 commits into from
Jul 24, 2021

Conversation

belonesox
Copy link
Contributor

  • Preparing localization for all UI messages («trans», «blocktrans»)
  • Add russian localization for all these messages

@marksweb
Copy link
Collaborator

Impressive @belonesox! Thank you for the contribution, will check this out properly soon.

@marksweb
Copy link
Collaborator

@belonesox Could you delete the .mo files and add .mo to the git ignore please?

They're generated files & typically a generated file isn't committed to git.

@belonesox
Copy link
Contributor Author

OK, done, but there are different rules for these, and I follow that
https://github.com/groveco/django-sql-explorer/blob/master/explorer/locale/zh_Hans/LC_MESSAGES/django.mo
included in your git, your setup.py missed compilemessages flow, and now for all who would install django-sql-explorer from pip russian localization will not work out the box.

@marksweb
Copy link
Collaborator

@belonesox in my experience, packages don't need to ship with mo files because the Django project using the app will define its supported languages and the person deploying the app runs compile messages which then creates the mo files.

One of the main packages I use in this circumstance being Django allauth.

I can certainly build the command into the release pipeline. That way they'd go into the pip package.

@belonesox
Copy link
Contributor Author

packages don't need to ship with mo files

Theoretically, it possible to not store it (I cannot remember a project with such paradigm, just checked almost all my django deps wheels — and cannot find such project), but then setup.py should:

  • have big deps in setup_requires (big django staff) and provide build flow in setup.py for building these mo-files.
  • of course publish whl-builds in pypi with compiled mo-files.

because the Django project using the app will define its supported languages, and the person deploying the app runs compile messages which then creates the mo files.

  • compilation «po → mo» (django_admin compilemessages) compiles '''all''' available language po-files, it does not depend of locales supported/selected by application.
  • If user run django_admin compilemessages, it compiles locale only for user application, not for django applications that use this app.

@marksweb
Copy link
Collaborator

@belonesox Ah ok, if django stores it's mo files in git, then lets keep things consistent & do the same, if you don't mind?

Thanks for providing that extra info!

@belonesox
Copy link
Contributor Author

OK, return "mo" back.

@belonesox
Copy link
Contributor Author

Is something else need to merge this?

@marksweb
Copy link
Collaborator

@belonesox I added some comments about the way you've added the translation tags. Feel free to share any thoughts or I could merge & then make changes myself.

@belonesox
Copy link
Contributor Author

I added some comments about the way you've added the translation tags

Sorry, I dont see them. There I should read these comments?

Copy link
Collaborator

@marksweb marksweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@belonesox Hopefully you can see comments here.

explorer/templates/explorer/preview_pane.html Show resolved Hide resolved
explorer/templates/explorer/query.html Outdated Show resolved Hide resolved
explorer/templates/explorer/query_confirm_delete.html Outdated Show resolved Hide resolved
@marksweb marksweb merged commit c99ef70 into explorerhq:master Jul 24, 2021
@marksweb marksweb mentioned this pull request Jul 24, 2021
@marksweb
Copy link
Collaborator

@belonesox I've released this is 2.3

SunnyYangg added a commit to SunnyYangg/djangoexplorer that referenced this pull request Jul 5, 2022
* First translation of all message already prepared for localication

* add trans/blocktrans tags for all UI literals in templates

* add trans/blocktrans tags for all UI literals in templates. Add russian translation for all this staff

* Sorry fix a typo

* generated localization files excluded from git

* generated localization files excluded from git

* force store compiled russian messages

* Enable mo files back

* add load i18n to some templates, now tests OK

* fix explorerhq/sql-explorer#450 (comment)

* fix explorerhq/sql-explorer#450 (comment)
AppleJin512 pushed a commit to AppleJin512/django-sql-explorer that referenced this pull request Feb 21, 2023
* First translation of all message already prepared for localication

* add trans/blocktrans tags for all UI literals in templates

* add trans/blocktrans tags for all UI literals in templates. Add russian translation for all this staff

* Sorry fix a typo

* generated localization files excluded from git

* generated localization files excluded from git

* force store compiled russian messages

* Enable mo files back

* add load i18n to some templates, now tests OK

* fix explorerhq/sql-explorer#450 (comment)

* fix explorerhq/sql-explorer#450 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants