Skip to content

How to translate language switcher? #190

Answered by jrwats
mrtnzlml asked this question in Q&A
Discussion options

You must be logged in to vote

You essentially want to "fetch" the appropriate translation for your given instance based on the locale itself.

fbt is really optimized for one language/locale on the entire page and pulls the locale from the one set globally on IntlViewerContext. Today, you could override getTranslatedInput with the initialization function (init).

https://github.com/facebook/fbt/blob/master/runtime/nonfb/fbtInit.js#L39

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jrwats
Comment options

@mrtnzlml
Comment options

@jrwats
Comment options

Answer selected by mrtnzlml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants