-
Notifications
You must be signed in to change notification settings - Fork 79
Internalization: Add your local language #57
Comments
I will take up of translating it to hindi (ISO 639-1 code: hi). |
Awesome @ChiragTutlani 🎉 please do not hesitate to reach oit if you need any assistance 👌 |
@ChiragTutlani I made an update to describe how to translate |
I added Simplified Chinese (zh-Hans) work in progress in the locales folder , |
Hi! I Would like to Take Translation to Sinhala (Code: si). |
I would like to add German (code:de) translation! |
Are you a chinesse speaker ? Please only add a language if you are a native speaker. |
Are you a german speaker or do you know a good german speaker willing to help you ? |
Great, first make sure the langage is supporter https://developers.facebook.com/docs/messenger-platform/messenger-profile/supported-locales |
@elinguiuriel being a native speaker is not necessary IMHO! Anyone who can correctly translate the messages is welcomed to open a PR as far is he's capable of completing it! Anyone who find issues on translation can submit improvements afterwards |
I'm a speaker , I know german as an additional language.If required I can ask a native speaker for PR review too. @elinguiuriel |
@aboullaite I Began the translation process for the Sinhala (Si). I have one question. there are some English words that have native words but those are less used and not understood by General Public. Should I made the translations in Pure Sinhala or Can I do it in Modern Sinhala? |
I'm a Native Speaker. |
Just we have to make sure to not sacrifice on quality when pushing translation in production. Because we have no way of controling translation quality ! If someone is not fluent enough in a language I prefer that his translation should be validate by a fluent speakers before being merged. |
I am a german speaker too, but a very bad speaker. If you can find someone fluent to validate the first version, it will be great. |
@elinguiurie, faor enough,l we could require review from devc community before merging! But bring a native speaker should not be the only criteria to suggest a PR 👍 |
Fluent or Native Speaker. Flask-Babel can refuse bad translation, that is what I want to avoid! |
French translation working for the menu but not working inside the bot. Seems that the translation process not applied while in the chat. |
I suspect that your Facebook language is not "Français (France)" or any other version or french, and your phone is localized in french. Make sure you have french everywhere |
This is not all or nothing situation . |
@prilcool you have a great point here! Please feel free to translate any language you are fluent in. The translation is a small part of the project, and it is not the easiest, it's quite a time-consuming and error-prone. Because we are a large global community as you said, what do you think about letting such specialized tasks to people most able to understand their translation even if they use Google Translate as a helper? Google Translate gives a good result, but some texts in the app are challenging and informal, and some word must be kept in English. These precautions are taken to avoid wasting contributor's precious time and the frustration of doing work that will not be merged or will required too many corrections. It is easier to do it at the beginning than when the work is already started. But if you or anyone are confident about translating a language, please go ahead! Or we will rather redirect contributors to quick wins amongst issues |
@prilcool if you read carefully the discussion here, you should mention that exactly what I was advocating for and what we agreed to do from now on. Relying solely on GT for translating to other languages will generate a negative experience as mentioned by @elinguiuriel |
@aboullaite @elinguiuriel Ah i see now, after testing with other language apart from Chinese, for some language gt translate is not so good and funny ok we leave translation to native speakers . |
I would like to add Kinyarwanda (code:rw) translation! |
I would like to translate it to Gujarati (India) |
Hi, I would like to add spanish (code: es) translation! |
@LuisFerTR please yourself 👍 |
I would like to add Urdu language. ur_PK |
Hi! I am a native Russian speaker and I would like to add Russian language. |
I will add Kannada (INDIA) transcript with code |
I ran this code [ (venv) $ pybabel extract -F babel.cfg -k lazy_gettext -o locales/messages.pot .] in my git but showed the below error. Please provide me some fixes: I installed the anaconda and python 3.10.2 properly with the path. But still getting this error $ pybabel extract -F babel.cfg -k lazy_gettext -o locales/messages.pot . Traceback (most recent call last): |
Is your feature request related to a problem? Please describe.
For more information about the translation process look at the official Flask-Babel documentation
By default, the bot interact with users with English. We can customize the user experience by adding support for i18n. If you're interested in adding support for a language, please follow the steps below:
Translate Greeting and Persistant Menu
Get your supported
YOUR_LANGUAGE_CODE
hereIn the file profile.py add a new object related to your language in
GREETINGS
PERSISTENT_MENU
Update
GREETINGS
andPERSISTENT_MENU
For that use cURL like this
(venv) $ curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<YOUR VERIFY TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe&init_bot=true"
after that check the logs to see if all the request return
success
Adding a new language
The
ISO 639-1
standard defines two-letter codes for languages. Find the two-letter codes of the language you want to add here.Make sure your language is not already supported
(venv) $ pybabel extract -F babel.cfg -k lazy_gettext -o locales/messages.pot .
.po translation files are generated from .pot template files using pybabel init.
Add your translation manually or by using software like poedit
got to the newly generated file and start i18n process. you can get inspired from
src/locales/fr/LC_MESSAGES/messages.po
Compile .po file to .mo
Compile your .po translation file by doing:
Make sure your Facebook account develop language is set to
<LANGAUGE_CODE>
. Run the app in your test environment, and verify that the bot answers you in your selected languageUpdating an existing language
After a change in the code that affect the text, you have to do this process
(venv) $ pybabel extract -F babel.cfg -k lazy_gettext -o locales/messages.pot .
After this you will have to translate the
../src/locales/<LANGUAGE_CODE>/LC_MESSAGES/messages.po
Make sure your Facebook account develop language is set to
<LANGAUGE_CODE>
. Run the app in your test environment, and verify that the bot answers you in your selected languageThe text was updated successfully, but these errors were encountered: