如何将故事板的本地化更改为字符串文件
How to change localisation from storyboard to strings file
TLDR:Xcode 为每种语言生成故事板,但我想要“旧”(?) *.strings 文件。怎么样?
我目前正在本地化我的故事板。在我启用所有内容后,Xcode 在原始(英文)故事板旁边生成了另一个故事板供我本地化。我很惊讶,我期待一个 Localizable.strings 文件,就像 apple documentation 截至 2021 年 4 月 3 日的状态一样:
For storyboard and XIB interfaces, select the user interface files (files with a .storyboard or .xib filename extension). Xcode adds a strings file to the localization folder that contains the text to translate, as well as comments that describe the user interface components. For example, if you add German to an iOS app that uses storyboards, LaunchScreen.storyboard becomes a group containing a LaunchScreen.storyboard (Base) and LaunchScreen.strings (German) file.
我在互联网上搜索过,在 Apple 开发者论坛中,在 Xcode 中观看了 WWDC18 和 19 关于本地化的讨论,但没有找到翻译故事板的任何提及。
初始翻译后,由于只需填写所有内容非常简单,因此效果很好,但它会令人沮丧,因为每种语言的每次布局更改都需要重复。这不是故意的,一定有更好的办法吧?可悲的是,我什么也没找到。即使是关于这些情节提要副本的文档的提示也将不胜感激。谢谢!
有一些屏幕截图显示了通过下拉菜单转换这两种格式的可能性,例如 this post 中的第三张图片。但是对我来说,当我点击情节提要时,语言项目旁边没有下拉菜单,无论是在组上,还是在个人基地或本地化的基地上:
这是一个错误还是我在这里遗漏了什么?我正在使用带有 Xcode 12.4 (12D4e) 的 macOS Big Sur 11.2.3。
事实证明,您需要使用基本本地化功能,然后会出现下拉菜单,您可以将现有故事板转换为 *.strings
文件。
TLDR:Xcode 为每种语言生成故事板,但我想要“旧”(?) *.strings 文件。怎么样?
我目前正在本地化我的故事板。在我启用所有内容后,Xcode 在原始(英文)故事板旁边生成了另一个故事板供我本地化。我很惊讶,我期待一个 Localizable.strings 文件,就像 apple documentation 截至 2021 年 4 月 3 日的状态一样:
For storyboard and XIB interfaces, select the user interface files (files with a .storyboard or .xib filename extension). Xcode adds a strings file to the localization folder that contains the text to translate, as well as comments that describe the user interface components. For example, if you add German to an iOS app that uses storyboards, LaunchScreen.storyboard becomes a group containing a LaunchScreen.storyboard (Base) and LaunchScreen.strings (German) file.
我在互联网上搜索过,在 Apple 开发者论坛中,在 Xcode 中观看了 WWDC18 和 19 关于本地化的讨论,但没有找到翻译故事板的任何提及。
初始翻译后,由于只需填写所有内容非常简单,因此效果很好,但它会令人沮丧,因为每种语言的每次布局更改都需要重复。这不是故意的,一定有更好的办法吧?可悲的是,我什么也没找到。即使是关于这些情节提要副本的文档的提示也将不胜感激。谢谢!
有一些屏幕截图显示了通过下拉菜单转换这两种格式的可能性,例如 this post 中的第三张图片。但是对我来说,当我点击情节提要时,语言项目旁边没有下拉菜单,无论是在组上,还是在个人基地或本地化的基地上:
这是一个错误还是我在这里遗漏了什么?我正在使用带有 Xcode 12.4 (12D4e) 的 macOS Big Sur 11.2.3。
事实证明,您需要使用基本本地化功能,然后会出现下拉菜单,您可以将现有故事板转换为 *.strings
文件。