【问题标题】:Localizing array and other special values in the Settings bundle在设置包中本地化数组和其他特殊值
【发布时间】:2012-08-11 17:51:16
【问题描述】:

我正在寻找一种方法来本地化 iOS 中 Settings.bundle 的不同字符串。虽然本地化常规字符串很简单,但我想知道您是否以及如何本地化:

  1. 数组。考虑以下 plist 条目:

    <dict>
      <key>DefaultValue</key>
      <string>Schedules</string>
      <key>Key</key>
      <string>defaultView</string>
      <key>Title</key>
      <string>Default View</string>
      <key>Titles</key>
      <array>
        <string>Schedules</string>
        <string>Tasks</string>
        <string>Patients</string>
        <string>Links</string>
      </array>
      <key>Type</key>
      <string>PSMultiValueSpecifier</string>
      <key>Values</key>
      <array>
        <string>Schedules</string>
        <string>Tasks</string>
        <string>Patients</string>
        <string>Links</string>
      </array>
    </dict>
    

    为了本地化标题,我添加

    "Default View" = "Translated Default View";
    

    到 Root.strings 文件。但是如何翻译 PSMultiValueSpecifier 的 Titles 呢?

  2. 页脚文本。 是否可以翻译以下条目的FooterText

    <dict>
      <key>Title</key>
      <string>Server Settings</string>
      <key>Type</key>
      <string>PSGroupSpecifier</string>
      <key>FooterText</key>
      <string>Can this text be translated?</string>
    </dict>
    

【问题讨论】:

  • "Can this text be translated?" = "Est-ce que ce texte peut etre traduit?" 应该可以解决问题。
  • 这确实对FooterText 有用,谢谢。数组有什么更新吗?

标签: ios localization settings plist bundle


【解决方案1】:

在我的应用程序中,我只是将标题字符串/翻译添加到 Root.strings:

"Schedules" = "Translated Schedules";
"Patients" = "Translated Patients";

等等,按预期工作。

【讨论】:

    猜你喜欢
    • 2015-10-28
    • 2020-09-27
    • 1970-01-01
    • 2011-09-16
    • 1970-01-01
    • 2018-01-23
    • 2016-09-24
    • 1970-01-01
    • 2019-09-16
    相关资源
    最近更新 更多