-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Migration from webL10n to i18next #4459
base: master
Are you sure you want to change the base?
Conversation
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests:
|
I am not sure why you changed the _() function to t(). It is quite an invasive and seemingly unnecessary change. |
@walterbender I switched from |
@walterbender If you were referring to encoding issues in es.po (if I assumed that correctly), I ran a thorough check on the PO files, including es.po, and didn't find any encoding issues using a custom script that detects unescaped quotes and encoding errors. The only issues found were in other files, like ayc.po, quz.po, and te.po, where unescaped double quotes were present. |
I think keeping the _() wrapper is a good idea. |
look t your es.json file and you'll see that it is no longer utf-8. It is some weird encoding. "Are you sure you want to clear the workspace?": "¿Estás segura de que quieres borrar el espacio de trabajo?", Should be: "Are you sure you want to clear the workspace?": "¿Estás segura de que quieres borrar el espacio de trabajo?"", |
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests:
|
Not sure what you are doing to fix the encodings, but it is not correct. There should not be any strings with "Â" in them. It is not a glyph used in Spanish. |
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests:
|
@walterbender Could you please let me know the encoding format used in the PO files? This will help me improve the Python script for conversion and avoid similar issues in the future. |
Everything should be utf-8 |
@ac-mmi I saw many tests failures please try to resolve those along with the PR only. |
@walterbender do we really need this change currently as I don't feel so |
@walterbender do we really need this change currently as I don't feel so currently |
It needs work. |
✅ All Jest tests passed! This PR is ready to merge. |
@walterbender i have made changes in the _() functionality catering to i18next functions and also passing the test suits of the repo |
ES is still broken. Now all of the non-ASCII characters are just missing. |
✅ All Jest tests passed! This PR is ready to merge. |
….js so that renderLanguageSelectIcon() works correctly
✅ All Jest tests passed! This PR is ready to merge. |
@walterbender I see that the Kana/Kanji situation is currently handled in the LanguageBox class by splitting them into separate options (ja for Kanji and kana for Kana). Do you more integrated approach, like combining them under a single "Japanese" option with a sub-preference? |
The default should be from the browser, but the user should be able to override it with the language selector. As for JA, it is a bit complicated. I think we prob. need to keep separate PO files, but if there are better approaches, I am open to suggestions. |
@walterbender The current implementation in |
@walterbender For handling the Kana/Kanji situation, I suggest using a single
In the UI, we can check the user's Kana/Kanji preference and based on that, it would select the appropriate sub-key (kanji or kana) when updating the text content. |
What is the standard practice with PO files for "nesting"? I don't think it is prudent to invent a novel solution to a common problem. |
@walterbender in
|
✅ All Jest tests passed! This PR is ready to merge. |
✅ All Jest tests passed! This PR is ready to merge. |
1 similar comment
✅ All Jest tests passed! This PR is ready to merge. |
✅ All Jest tests passed! This PR is ready to merge. |
✅ All Jest tests passed! This PR is ready to merge. |
1 similar comment
✅ All Jest tests passed! This PR is ready to merge. |
✅ All Jest tests passed! This PR is ready to merge. |
@walterbender I’ve successfully merged the Kana and Kanji translations into a single JSON file and implemented the necessary logics to handle the scenario correctly. The system now distinguishes between them without requiring separate files. |
Seems there a many unrelated changes to activity.js I like the way that you've structured the ja JSON file. What changes need to occur in the PO files. What changes did you make to es.po? @pikurasa do we want any untranslated KANA to use the KANJI or EN? @ac-mmi can you please describe the new workflow for translation? |
@walterbender New Workflow for translation: 1. i18next Language Initialization & Loading 2. Handling Language Preferences in 3. Language Selection Logic in 4. Translation Key Lookup with Fallback (customTranslate) 5. Updates to Previously, Kana and Kanji translations were stored in separate JSON files. Now, they have been merged into a single JSON file under |
What changes, if any, need to be made to the PS files? Presumable we don't need localization.ini any more? |
@walterbender No changes are needed in the .po files since I created a Python script to handle the conversion automatically. |
@walterbender I have successfully migrated the internationalization system in Music Blocks from webL10n to i18next. I have tested the implementation, and it is working as expected. The only remaining task is to update the test suites, which are currently tailored for webL10n, to support the new i18next standards.
I made the following changes:
loader.js
: Added i18next initialization with i18nextHttpBackend to load translations from JSON files stored in the locales folder. This change allows the application to switch languages dynamically.activity.js,block.js,blocks.js,ActionBlocks.js,BooleanBlocks.js
and more...)locales
containing converted PO files into JSON format, supporting i18next's structure for managing translations.