简体   繁体   English

如何使用 Android Studio Translations Editor 翻译字符串数组

[英]How to translate string-array using the Android Studio Translations Editor

In my strings.xml I have several string-arrays.在我的 strings.xml 中,我有几个字符串数组。 I would like to translate them in the same way as I have translated other strings - using the Translations Editor in Android Studio.我想以与翻译其他字符串相同的方式翻译它们 - 使用 Android Studio 中的翻译编辑器。 However, I cannot see the string-arrays in the Translations Editor.但是,我在翻译编辑器中看不到字符串数组。 Is there any way how can I use the Translations Editor for the string-array as well as for strings?有什么办法可以将翻译编辑器用于字符串数组和字符串? What is the best practise for translating string-arrays?翻译字符串数组的最佳实践是什么?

Let the array to use the string in strings.xml like following:让数组使用 strings.xml 中的字符串,如下所示:

In arrays.xml:在 arrays.xml 中:

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

In strings.xml:在strings.xml中:

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

After doing that, you can see the key contry_option_0 and contry_option_1 in Translations Editor.之后,您可以在 Translations Editor 中看到键contry_option_0contry_option_1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM