簡體   English   中英

iOS Storyboard的本地化:UITextView文本未本地化?

[英]Localization of iOS Storyboard: UITextView texts are not localized?

我有一個基於故事板的應用程序,從德語到英語本地化。

除了UITextViews中的所有文本外,UI中的大多數字符串都是從Main.strings文件中正確提取的,盡管它們確實出現在Main.strings文件中:

/* Class = "IBUITextView"; text = "Die Futtermenge kann bei Hunden ab 12 Monaten anhand des Schiebreglers von 2% auf 5% des Körpergewichts verstellt werden. Als Standart empfehlen wir 2% Futter vom Körpergewicht Ihres Hundes. Je nach Aktivität kann das abweichen. Wenn Sie bereits eine hohe Menge an Futter geben und Sie der Meinung sind, es ist nicht ausreichend, erhöhen Sie die Fettmenge im Futter. Mehr unter den Fragen & Antworten.\n \nFür Welpen und Junghunde gilt:\nWelpen 8 - 20 Woche: 7%\nJunghunde 21 - 35 Woche: 6%\nJunghunde 36 - 52 Woche: 5%"; ObjectID = "TAc-yh-nWQ"; */
"TAc-yh-nWQ.text" = "As of 12 months of age, you can use the slide ruler to adjust the food amount for dogs from 2% to 5% of body weight. As a baseline, we recommend 2% of your dog's weight to determine the amount of food. It will vary depending on activity. If you are already giving your dog a lot of food and you feel it is not sufficient, increase the fat content of the food. More information can be found in the FAQ section.\n \nFor puppies and young dogs:\nPuppies 8 - 20 weeks: 7%\nYoung dogs 21 - 35 weeks: 6%\nYoung dogs 36 - 52 weeks: 5%";
/* Class = "IBUILabel"; text = "Getreide:"; ObjectID = "VMF-xs-WfF"; */
"VMF-xs-WfF.text" = "Grains:";
/* Class = "IBUIButton"; normalTitle = "Gewicht aktualisieren..."; ObjectID = "WpP-c7-ipY"; */
"WpP-c7-ipY.normalTitle" = "Update weight...";

我的Main.strings有問題嗎? 以上是摘錄。

看起來這是一個長期存在的錯誤,在這里討論

您可以嘗試將“更改”可本地化字符串“添加到”界面生成器Cocoa Touch XIB“”方法,這似乎是一個奇怪的伏都教魔法,但嘿,如果它的工作原理。 否則,在運行時設置它似乎是必要的。

我的解決方案是使用Localizable.strings文件通過代碼本地化textviews。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM