-1

我正在做本地化。我得到了一些关于它的信息,即在 Localizable.strings 中编辑标签文本。但我想本地化解析数据。我在下面使用来编辑 Localizable.strings 中的标签文本。对此有任何想法吗?

label1.text=NSLocalizedString(@"One", @"The Number1");
label2.text=NSLocalizedString(@"Two", @"The Number 2");

......

Data is editing in 
 /* The Number 5 */
 "Five" = "Five";

/* The Number 4 */
"Four" = "Four";

/* The Number1 */
"One" = "One";

/* The Number 3 */
"Three" = "Three";

/* The Number 2 */
"Two" = "Two";
4

1 回答 1

1

看这个例子:

Localizable.strings(English)

"Home" = "Home";

Localizable.strings(Danish)

"Home" = "Hjem";

从以下位置获取密钥Localizable.strings

currentKey = NSLocalizedString(@"Home", nil);

让你的 yourParseDataDictionary :

value = "ABCD" for key = Home
value = "EFGH" for key = Hjem

然后你可以得到价值:

currentValue = [yourParseDataDictionary objectForKey:currentKey];

// currentValue = [yourParseDataDictionary objectForKey:@"Home"]; // In english
// currentValue = [yourParseDataDictionary objectForKey:@"Hjem"]; // In Danish
于 2013-01-02T10:04:45.467 回答