是否可以更新本地化的故事板的字符串? [英] Is it possible to update a localized storyboard's strings?

查看:108
本文介绍了是否可以更新本地化的故事板的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过创建base.lproj故事板和3个字符串文件来本地化我的应用程序的一部分。这是一个月前,之后我向app添加了新的视图控制器,但是这个控制器的按钮和标签没有出现在字符串文件中

I localized a part of my application with creating a base.lproj storyboard and 3 string files for it. It was a month ago and after that I added new view controller to app, but this controller's buttons and labels not appear in string files

是否有可能更新这3个故事板附加的字符串文件或者我必须使用NSLocalizableString和Localizable.strings以编程方式添加新的字符串翻译?

Is it possible to update this 3 storyboard attached string files or I must add new strings translations programmatically with using NSLocalizableString and Localizable.strings?

推荐答案

有两种选择:

Xcode可以通过将文件转换为 [接口]来重新加载文件Builder Cocoa Touch Storyboard] 文件类型或 [Localizable Strings] 文件类型。

Xcode can "reload" the file by converting the file to either an [Interface Builder Cocoa Touch Storyboard] file type or a [Localizable Strings] file type.


  1. 选择Project Navigator中的基本故事板文件

  2. 在文件检查器中查找本地化部分

  3. 如果您的文件当前是a [Localizable Strings],将其更改为[Interface Builder Cocoa Touch Storyboard],反之亦然。

  4. Xcode应该已经转换了你的故事板支持当前版本,同时保留您原有的本地化工作。在这里,您可以根据需要将文件更改回原始文件类型。

  1. Select your base storyboard file from the Project Navigator
  2. Find the Localization section in the File Inspector
  3. If your file is currently a [Localizable Strings], change it to [Interface Builder Cocoa Touch Storyboard] or vice-versa.
  4. Xcode should have converted your storyboard to the current version, while preserving your old localization efforts. Here you can change the file back to the original file type if you would like.



选项2



使用ibtool提取故事板中的字符串。

Option 2

Use ibtool to extract the strings in your storyboard.


  1. 打开终端应用程序

  2. 找到您的Base.lproj目录

  3. 使用此行提取字符串:

  1. Open the Terminal application
  2. Locate your Base.lproj directory
  3. Use this line to extract the strings:

ibtool MainStoryboard.storyboard --generate-strings-file file_name.strings

ibtool将字符串提取到file_name后。字符串,您可以将其复制并粘贴到原始.strings文件中

After ibtool extracts the strings to file_name.strings, you can copy and paste it to your original .strings file

访问以获取更多信息: https://conyac.cc/business/columns/localization_guide_ios

Visit for more info: https://conyac.cc/business/columns/localization_guide_ios

这篇关于是否可以更新本地化的故事板的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆