在Android应用程序本地化资源原料 [英] localizing raw resources in android app

查看:124
本文介绍了在Android应用程序本地化资源原料的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的应用程序的本地语言内容。我读在res .txt文件/使用的FileReader原始文件夹(缓冲之一)。我已阅读,Android的可自动转化为价值/ strings.xml档案文本。

I want to serve local language content in my app. I am reading a .txt file in res/raw folder using FileReader (Buffered one). I have read that Android can automatically translate text for values/strings.xml file.

是一样可能对原材料的文本文件。我找最低code的变化。

Is the same possible for raw text files. I am looking for minimal code changes.

推荐答案

的Andr​​oid并不会自动转化的任何文件。

Android does not automatically translate any files.

您作为开发人员可以翻译它们,将资源放在适当资格文件夹像值恩值-FR 等。

You as a developer can translate them and put the resources in appropriately qualified folders, like values-en, values-fr and so on.

这些预选赛上的所有文件夹下的工作 RES ,其中原材料文件夹中。

These qualifiers work on all folders under res, including the raw folder.

没有code改变是必需的,因为Android将自动在运行时选择正确的文件。然而,你应该始终保持在默认文件夹的副本没有的情况下,该应用程序为你没有可用的内容的设备上运行的资格。

No code changes are required, as Android will automatically pick the correct file upon runtime. However, you should always keep a copy in the default folder with no qualifications in case the app is run on a device for which you do not have content available.

这篇关于在Android应用程序本地化资源原料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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