将新的字符串资源添加到 Android 应用程序中的多个(本地化)strings.xml 文件中
我有一个支持多种不同语言的应用程序。
现在假设我想添加一个新功能,这通常需要添加新的字符串资源。
添加新字符串资源(将自动添加到所有本地化字符串文件中)的方法是什么(或者有)? (意味着我只需要翻译字符串的内容,而不是为每个本地化文件创建具有相同密钥的新字符串) 因为当您有大量本地化文件时,手动复制粘贴它没有任何意义......
I have an app with support for several different languages.
Now lets say I want to add a new feature, which will usually will require new string resources to be added.
What is the (Or is there) way to add new string resources that will be added automatically to all the localization strings files? (Means i'll just need to translate the content of the string and not to create new one with the same key for each localization file)
Because it dosen't make any sense to copy-paste it manually when you have a lot of localization files...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您遵循 Android 本地化规则,除了手动添加到每种语言的 strings.xml 文件之外,没有其他方法。您可以编写此脚本,但随后您必须编写脚本。所以,我的建议是硬着头皮去做。
正如您所说,如果有很多文件,那么编写脚本是最好的方法,即使这样您可能也必须手动将本地化的字符串值添加到每个文件中。
If you follow Android localization rules, there isin't any other way other than manually adding to each language strings.xml file. You can script this but then you will have to write the script. So, my suggestion is to bite the bullet and do it.
As you said if there are a lot of files, then scripting it is best way, even then you may have to manually add the localized string values to each file.
您所指的是常见的本地化问题。它不仅仅是 strings.xml 和 Android 平台相关。
正如您可能猜到的那样,人们实际上找到了解决该问题的方法。通常,您只需将英文文件发送给翻译人员(翻译供应商),他们将使用翻译记忆库< /a> 软件。
或者,如果您是独立软件开发人员,您可能希望使用一些众包平台进行翻译,例如 Launchpad, BabelZilla 或 人群。这些平台还充当翻译记忆库,因此您无需手动同步各个语言文件。
What you refer to is common Localization problem. It is not just strings.xml and Android platform related.
As you might be guessing, people actually found ways to resolve it. Typically, you will send just the English file to translators (translation vendors) and they will update it using Translation Memory software.
Or if you are independent Software Developer, you may want to use some crowd-sourcing platform for your translations, like Launchpad, BabelZilla or Crowdin. These platforms also act as Translation Memory, so you won't have to manually synchronize individual language files.