【问题标题】:How to translate string-array using the Android Studio Translations Editor如何使用 Android Studio Translations Editor 翻译字符串数组
【发布时间】:2021-01-10 10:43:53
【问题描述】:

在我的 strings.xml 中,我有几个字符串数组。我想以与翻译其他字符串相同的方式翻译它们 - 使用 Android Studio 中的翻译编辑器。但是,我在翻译编辑器中看不到字符串数组。有什么办法可以将翻译编辑器用于字符串数组和字符串?翻译字符串数组的最佳做法是什么?

【问题讨论】:

    标签: android string language-translation


    【解决方案1】:

    让数组使用strings.xml中的字符串,如下所示:

    在arrays.xml中:

    <string-array name="countries">
        <item>@string/contry_option_0</item>
        <item>@string/contry_option_1</item>
    </string-array>
    

    在strings.xml中:

    <string name="country_option_0">Japan</string>
    <string name="country_option_1">Thailand</string>
    

    完成后,您可以在翻译编辑器中看到键 contry_option_0contry_option_1

    【讨论】:

      猜你喜欢
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 2015-02-12
      • 1970-01-01
      • 2016-09-19
      • 1970-01-01
      • 2015-09-04
      • 1970-01-01
      相关资源
      最近更新 更多