-
Notifications
You must be signed in to change notification settings - Fork 16
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
[RFC] Support for multi-language #478
Comments
+1 to this. As we've multiple ways for this implementation, as next steps, would be great if you can share how the API will be for a user that want to add multi-languague. I'd keep the API as it's right now for users who don't need multi language. |
We can use a specific library to do that, there are some of them out there [1] and it seems react-intl is the most used. It allows to include non-intrusive code to translate text and use different files for each supported language. The unique change is to change the current messages to message ids to be referenced from the language files. |
I guess C4R exports a props interface to change the texts, so the responsibility is derived from the app and the multi-language is out. An example: <CategoryWidgetUI
...
texts={{
unlock: 'Unlock',
lock: 'Lock',
clear: 'Clear',
allSelected: (data) => `${data.length ? data.length : 'All'} selected`,
}}
/> The
|
Target Use Case
In PS we are facing the project Telus Insight which has a requirement to support widgets and UI components in both English and French.
Implementation Proposal
The default behavior for UI labels could be as is working right now, but we can add the ability to switch to another language just by putting a properties file with the translation in the root folder.
The text was updated successfully, but these errors were encountered: