gpt4 book ai didi

objective-c - 未检测到我的本地化字符串

转载 作者:行者123 更新时间:2023-11-29 04:59:14 25 4
gpt4 key购买 nike

我正在尝试在 Xcode 4 中本地化我的字符串,但我得到的唯一结果是键,而不是值。

我已使用 NSLocalizedString(key, comment) 本地化了字符串。我已经使用命令行中的 genstrings 生成了文件 Localizable.strings 。我已将 Localized.strings 从 Finder 拖放到 Xcode(放入 Resources 文件夹中)。我已本地化 Localized.strings 并添加了适当的国家/地区。我已经确定编码是UTF-16。我已经为每个国家/地区翻译了不同的 Localized.strings。我重新检查了一下,编码还是UTF-16。我已经检查过 Localized.strings 中的每个语句都以分号结尾。

仍然无法工作。

知道我错过了什么吗?

编辑

这是我的 Localized.strings 的一部分

/* Text displayed on the comment button if there are more than one comment. */
"CommentButtonTextPlural" = "comments";

/* Text displayed on the comment button if there is exacly one comment. */
"CommentButtonTextSingular" = "comment";

/* Text displayed on the post button. */
"CommentViewPostButtonLabel" = "Post";

/* Default text displayed in the area where the user types in a comment. */
"CommentViewWriteAComment" = "Write a comment...";

/* Error message explaining that a document isn't viewable on the user's device. */
"DocumentRendererStatusDetailedErrorText" = "This document is not viewable on this device.";

/* Message explaining that the document is downloading. */
"DocumentRendererStatusDownloadingText" = "Downloading...";

最佳答案

您可能将 Localized.strings 文件放在错误的位置,因此它使用默认翻译。

当您添加新语言时,Xcode 会在您的应用程序目录中创建一个以 .lproj 结尾的新文件夹(因此对于英语,该文件夹将为 en.lproj),这就是您的英语 Localized.strings 文件所在的位置。

如果您想要法语,请添加法语,Xcode 将生成一个 fr.lproj 目录,这就是法语 Localizes.strings 文件所在的位置。

根据您的描述,将其放在资源文件夹中是不正确的。

关于objective-c - 未检测到我的本地化字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7335857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com