简体   繁体   English

localized.strings文件中的超链接 - 目标c

[英]hyperlink in localized.strings file - objective c

Is it possible to embed a working html hyperlink inside a localized string file? 是否可以在本地化的字符串文件中嵌入一个工作的html超链接? And if so, how? 如果是这样,怎么样?

When I try to create this link I get an error: 当我尝试创建此链接时,出现错误:

read failed: The data couldn't be read because it has been corrupted. 读取失败:无法读取数据,因为它已损坏。

I think it is in the " of the url. Reading this character the strings file "thinks" the string has ended. "*http://... 我认为它是在 url。读取此字符的字符串文件”认为“字符串已经结束。”* http:// ...

Please advice. 请指教。

Edit: "Disclaimer" = "Door het .... Voor meer informatie zie ook: hier \\n\\n\\n"; 编辑: “免责声明”=“门he V ....有关信息zie ook: hier \\ n \\ n \\ n”;

Quotation marks inside "key" = "value"; "key" = "value";内的引号"key" = "value"; in the strings file have to be escaped with a backslash character: 必须使用反斜杠字符转义字符串文件:

"link" = "<a href=\"http://stackoverflow.com\">stackoverflow</a>";

In your case: 在你的情况下:

"Disclaimer" = "Door het .... Voor meer informatie zie ook: <a href=\"http://www.apple.com/legal/internet-services/itunes/appstore/dev/stdeula/\">hier</a> \n\n\n";

Check the following: 检查以下内容:

  • That your strings in the Localizable.strings file are NOT prefixed with "@". 您在Localizable.strings文件中的字符串不以“@”为前缀。
  • That every line ends in ";". 每一行都以“;”结尾。
  • The file is UTF-16 encoded (you can check that running file Localizable.strings from Terminal. 该文件是UTF-16编码的(您可以从终端检查正在运行的file Localizable.strings

Example of line in Localizable.strings : Localizable.strings的行示例:

"My awesome string" = "Mi estupenda cadena"; “我很棒的字符串”=“Mi estupenda cadena”;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM