-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
First step to internationalization #5760
Conversation
@shipko Don't you need a localization file to match the strings to localize? |
Hi @shipko nice to meet you! I've always wanted to pursue multilingual support. Wouldn't it be better to start with the models rather than the templates? |
@damiencarol on first step it's not require. Django will use words wrapped in translatization function. If somebody wants to use other language can execute django-admin makemessages -l , replace LANGUAGE_CODE in settings.dist.py and translate language file |
@devGregA of course. This not last commit. After that I will start edit models.py |
@devGregA wrapped models.py to translatization form. |
wow. this will be a big DB migration. (every model that have some description) |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
That's all @devGregA @damiencarol Also i notice that no required migration, because we changed 'verbose_name' and 'help_text' parameters. Please approve my PR or write that I need to fix. Because I don't want to resolve merge conflicts in soon |
@shipko could you add some languages files? I want to test this PR (adding a new language, changing the data, etc..) |
@damiencarol of course! I want to notice, that this files from test branch will not be merged in dev branch. |
@damiencarol you have news? |
I'm still testing. I need to catch-up with the team as it will impact the whole UI. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@damiencarol I agree with @valentijnscholten and want to use If you're ok about this, I won't change anything |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@shipko ok. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@damiencarol @devGregA @valentijnscholten please leave feedback about this pr. I constantly resolve merge conflicts. It's boring |
I understand. I have no experience with i18n, especially not in Django. I guess if this PR follows the docs it should be OK. I've pinged the rest of the team to look at the PR, but I'm good with it. |
@shipko looking at this now |
@Maffooch would you also please review? |
It's good enough for me as a first step. I made a couple of tests by adding a new language. I will accept it before the end of the week if everything is ok. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done a quick performance test with this to be sure making translations via the templates would not be too impacting. Django's template loader can be super slow with certain operations.
I found that there really is no discernible difference, and that this is the standard way of doing django internalization. Approving for now
@Maffooch thanks! @damiencarol @valentijnscholten @devGregA what about you? |
Hi guys!
I want to add localization in project.
Why it need?
This will make it possible to translate the interface on other language. If company needs interface on other language - it can generate locale file.
On first step I decided prepare base.html file. If my pull request will be interesting for you, I continue work