Read the statement by Michael Teeuw here.
How to support multiple translations in different UI and API?
-
My modules would like to support multiple languages (e.g. zh-hk and zh-tw). But actually both language uses the same set of language (Traditional Chinese).
UI
I could support both language in the following function:
getTranslations: function () { return { ... "zh-hk": "translations/zh-tw.json" "zh-tw": "translations/zh-tw.json" };Is it possible that I could pre-map
zh-hktozh-twso that I only need to keepzh-twingetTranslations?API
The API also returned the localized value based on the language parameters. Therefore I would like to convert
zh-hkandzh-twintozh-hantrequired by the API (in two different lines). Currently I am doing the conversion in a hard-code way. Is it possible that I could pre-mapzh-hktozh-twso that I could translatezh-twintozh-hantin the API code?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login