-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(FEC-7681): add i18n support #269
Conversation
@@ -34,6 +35,8 @@ class UIManager { | |||
store: any; | |||
container: ?HTMLElement; | |||
root: React$Component<any, any, any>; | |||
_translations: {[langKey: string]: Object} = {en: en_translations}; |
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.
Create TranslationManager which will return u this object
* @private | ||
* @returns {void} | ||
*/ | ||
_setLocaleTranslations(config: UIOptionsObject): void { |
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.
TranslationManager logic?
@@ -141,7 +164,7 @@ class UIManager { | |||
// i18n, redux and initial player-to-store connector setup | |||
const template = ( | |||
<Provider store={this.store}> | |||
<IntlProvider definition={definition}> | |||
<IntlProvider definition={this._translations[this._locale]}> |
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.
translationManager.getTranslation()
translationManager will be a HoC in future release
Description of the Changes
adding full mapping and some re-org of components.
The translations can be added via the config object, currently only supporting setting the locale language on init of ui manager.
The config accepts:
the base config is english and any additional config dictionary with missing keys will inherit the english ones.
CheckLists