ReactNativeLocalization icon indicating copy to clipboard operation
ReactNativeLocalization copied to clipboard

List of codes for 1 language

Open jsoutherner opened this issue 7 years ago • 2 comments

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 }

jsoutherner avatar Jan 24 '18 14:01 jsoutherner

+1

zhaiyjgithub avatar Feb 14 '18 01:02 zhaiyjgithub

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), {}),
});

wkoutre avatar Oct 30 '18 19:10 wkoutre