-
Notifications
You must be signed in to change notification settings - Fork 477
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
Added internationalization (german included atm) #184
Conversation
Robin @DarkSmile92 , sorry for taking a bit long to get back to you. |
Also, this poses another question: How should developers and translators work together? Meaning how can we allow more than 1 translators to work on each language? So they can cross-check each other to make sure the translation is correct? |
@@ -85,6 +91,18 @@ class App extends PureComponent { | |||
dispatch(UIActions.changeActiveTab(tabName)); | |||
} | |||
|
|||
changeLang(locale) { | |||
const { dispatch } = this.props; | |||
if (this.props.currentLanguage == 'en') { |
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.
Shouldn't this be the other way around? :)
React-intl should be used instead because it uses ICU message format and thus allows for crowd translating. :/ Also, coupling the locale to the redux store looks like a bad idea to me in term of performances |
I think your React knowledge is way more advanced than mine so I can't really tell how this would have an impact on the performance @SkyzohKey . I will trust your judgement. @hql287 : react-localize-redux seemed the simpliest way to integrate in the existing components without too much changes for me. As said before I am an experienced developer, but not so much with React. I checked the other two mentioned by you and now I think react-intl would be better (also based on the statement from @SkyzohKey ). So if you agree, I will revert the changes and implement them with React-intl during this week :-) |
@DarkSmile92: Thanks! 👍 Btw, I also just had it working with
It seems to me that the only thing that you need to do is to add the That said, I'll play with it some more to see if there's is any limitation. Will open the PR up later today so everyone can see. In the meantime, you're very welcome to try
@SkyzohKey: Agree! Have you tried |
@hql287 Sure let's do it that way and compare it. The decision is up to you in the end :) So I am happy to help out and curious which one will fit better to manta. I'll do my best to have it asap. |
@DarkSmile92 Great. Thanks! |
@DarkSmile92: Just created the PR #187, feel free to take a look and let me know what you think. |
@hql287 I just tried to implement react-intl last night. During a break I reviewed your PR with react-i18next and for my opinion With
I don't see an advantage in using Give me your thoughts on it! |
@DarkSmile92 This is exactly how I felt when I tried to integrate Anyway, looks like our comparison is already in place. Feel free to keep playing with
👍 I'm setting up Crowdin for Manta, will let you know when it's ready. Thanks. |
@hql287 I would rather help implementing |
@DarkSmile92: I just update #187 with detailed instruction on translating Manta using Crowdin. Feel free to transfer your translation from the PR to Crowdin when you're ready.
If you look at the TODOs in my PR, you'll see there's not much left to do actually. I think it would be easier for me to finish it and better for you to work on a new issue :) May I suggest this #178 and #177? They seem pretty interesting to me. Or, maybe you can work on some specific feature that would be helpful for German users? (I remember you mentioned some of them in our previous emails.) |
@DarkSmile92 You actually can create issues, comment and even host discussions with other translators directly on Crowdin. |
@DarkSmile92 @hql287 I recommended @DarkSmile92 About handling translation in a redux store, it cause performances bottlenecks because of how redux works. Even if you use 1 translation in a component, the store will still load ALL the translations in memory because of how a reducer/state works. + Once you change the locale at runtime, components will be queued for re-render from top-to-bottom and potentialy freeze the app on slower devices. ;) Anyway, I'm happy you found what suits best Manta and will happily translate it to french once I get time ;) |
Done with react-localize-redux.
comments with "// TRANSL:" means these lines must be customized to add more languages
Manta\app\helpers\form.js -> Messages not translated, did not find a nice way without passing too many arguments. Maybe you can find one?
ex.: Manta\app\middlewares\FormMW.jsx -> I think here is a good place to insert translation handler and pass to validateFormData()
Working on the rest of it.
Maybe you have some ideas on how to translate the middlewares and the form methods in a good way :)