ReactNativeLocalization
ReactNativeLocalization copied to clipboard
List of codes for 1 language
Hello
First of all, thanks for cool module! :)
I just want to ask is there any easy way to use 1 language for list of codes. Example:
uk - uk strings ru, be, kk, lt, lv - ru strings default - en strings
I just dont want to ctrl+c->ctrl+v list of string and trying to find rational solution
I've done with local variables, but dont like it anyway :)
Maybe there is any chance to do something like this:
ru, be, kk, lt, lv : { test1: testString1, test2: testString2 }
+1
This would be great.
Interim solution:
const cnLanguageCodes = [
"zh-Hans-CN",
"zh-Hant-CN",
"zh-HK-CN",
"zh-Hans",
"zh-Hant",
"zh-HK",
"zh",
]
const cnTexts = {
title: "运单",
subtitle: "创建并监控运单",
SD_title: "运单",
};
export const titleTexts = new LocalizedStrings({ ...cnLanguageCodes.reduce((prev, curr) => (prev[curr] = cnTexts), {}),
});