-
-
Notifications
You must be signed in to change notification settings - Fork 301
Multi-Language Version #1327
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
Multi-Language Version #1327
Conversation
...isplay informations this is just a first version that is not yet efficient and must be implemented to be more efficient
Looks like a nice feature. Where's the french translation? How would people provide custom translations for their own rules, like cz-emoji?
Thoughts @Lee-W @noirbizarre ?
Looks like a nice feature. Where's the french translation? How would people provide custom translations for their own rules, like cz-emoji?
Thoughts @Lee-W @noirbizarre ?
You can choose your translation on the command line. If it merge by typing : cz -language fr commit
. With this sentence you will have the explanation in French, if you want other language, you can change the fr
and if you want to stay with the English version you do not need to write -language
. For the cz-emoji version, it could be a bit hard because my way of doing is to use a translator API. So if you want to make the cz-emoji, you have to add the datas/sentences into de cache-memories. Sorry if there is some mistakes in my code, I can already see that there is some issue about the python-check, this is my first contribution to an open source projects. I'm here to help you make this feature available if you wish so.
That's very interesting! I worked in French administrations and some teams/projects have french as a unique and mandatory language, so I can definitively see the use cases!
I worked a lot with translations and making them opt-in, including for extension, is straightforward with https://docs.python.org/fr/3/library/gettext.html
The idea would be:
- keep all
name
keys in english - call
gettext
on display on the key:- either there is a translation provided, then it is displayed instead of the english one
- either there is none, and the english one is displayed
- extensions/plugins can provide their translation using a shared convention (often
translations/{iso}/messages.po
)
gettext
has many advantages over json
as it handles complex logic that are unavoidable when it comes with translating, like pluralization (in Python, given in some other languages there are libs offering these kind of features on JSON).
It is also a good idea to bind the default on LANG
env var instead of en
as it will fallback on en
if the language does not exist.
To help with translations, translation services like transifex offer a free tier for open-source projects, but https://weblate.org is open source itself and free for open-source project.
For emojis, this is a special case which will require some design choices, but given it is already using the emoji library which is already supporting localization, it won't be that difficult to handle.
Anyway, I think this feature would be great, and I am ready to help on this one if required.
In general, I like the idea, but we probably have a better tool for dealing with this i18n thing. Instead of doing it ourselves, we probably should delegate the logic to those tools. what we need to do is providing the script for each of the languages
Hi @Vlor999 do we still need this one? or should we review https://github.com/commitizen-tools/commitizen/pull/1328/files instead?
@noirbizarre Hello, I'm currently a student and searching for an internship in France. I know this is absolutely not the place but if you are interesting, please contact me on my mail. :
willem.adnet@grenoble-inp.org
Uh oh!
There was an error while loading. Please reload this page.
Description
Sorry for the last pull request, it was a mistake. The idea is the people may want to use commitizen to make commits but some people may not speak English. This is where the idea came to introduce a language option. The idea is just to give the opportunity to users to have better understanding of the selection of possibility.
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
This new feature must increase the understanding and improve commits for users.
Steps to Test This Pull Request
Additional context