2013-01-02 71 views
-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"; 
+0

什麼是你的問題? – Cocoanetics

+0

如何定位表 – fathik

+0

什麼「分析數據」你說的是分析數據?你上面顯示的字符串文件是你如何本地化字符串。 – Cocoanetics

回答

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