-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Add react-i18next for multi-language support #917
Conversation
The main pain point right now is the warning in the console for the auto complete component. If you can fix that before/during introduction of i18n it would be great. |
@HarelM Thanks. I'll check out the auto complete component while I'm working on this, but doing a cursory search, it looks like there might not be much to translate in the auto complete component? I think it's just being used for values in the style itself -- not for field labels, etc? Unless I'm misunderstanding something? |
It's less about the i18n of the auto complete component, it more about replacing it with something that doesn't create console warning. |
Thanks for taking the time to open this PR! |
Also I'm not sure what should happen for RTL languages - i.e. translating to Hebrew and Arabic requires more than simple string substitution, and that's why I asked about using a component library that supports i18n, or something similar. |
Update Japanese translation
I'm speaking Hebrew so I can help out in terms of RTL. |
I've added Hebrew translation, please remove the survey translations and the relevant component as it is no longer in use. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #917 +/- ##
==========================================
+ Coverage 57.23% 58.31% +1.08%
==========================================
Files 104 105 +1
Lines 2932 3025 +93
Branches 667 669 +2
==========================================
+ Hits 1678 1764 +86
- Misses 1254 1261 +7 ☔ View full report in Codecov by Sentry. |
…led by tranlating the style spec itself in the future)
Thanks for taking care of the Firefox annoying test failures. |
Can you also delete the following file and remove references to it? |
Let me know if there is anything else I should brush up. |
Let's push it and see how it behaves :-) |
P.S. the word Language should be kept in english, otherwise if you accidentally change the language, it's hard to understand where to click in order to revert to English. |
Ah: I forgot. The maplibre controls only pick up the translation on initialization, so if you refresh the page, it should work. It has to do with the controls being outside of React's area of control, so I'll have to listen for the i18next events to make switching working with them. I think we should make a tracking issue? or individual issues? for fixes like these? What do you think? |
Sure, tracking issues should be better. If the map controls are hard to update I wouldn't stress about them, your call. |
This is a rough start on adding react-i18next. I'll be working on adding more translatable strings and translations in the coming days. I'm going to need to wrap class components in HOCs, so let me know if there's something I should be fixing before doing that. I'm thinking now to keep the exported class names exactly the same, and rename the existing classes by prefixing an
I
(for internal). For example:becomes
I'll be able to contribute Japanese strings (I've talked to a couple people on my team and they'll be happy to help as well), so that's the language I decided to go with in this PR.
Closes #746