Google的搬运工

Android语言和文化适配

2017-12-27  本文已影响0人  Anonymous_NO1

https://developer.android.com/training/basics/supporting-devices/languages.html

Create Locale Directories and Resource Files

To add support for more locales, create additional directories inside res/. Each directory's name should adhere to the following format:

<resource type> -b+<language code>[+<country code>]

adhere vi. 坚持;依附;粘着;追随

为了国际化,需要在res/文件夹下创建不同文件夹,需要遵循如下格式。

例如

punctuation n. 标点;标点符号

Languages such as Arabic, Hebrew, Persian, and Urdu are written in an RTL direction overall. Some of their elements, however, such as numbers and embedded LTR text, are written in the LTR direction within the otherwise RTL text. Languages that use LTR scripts, including English, are also bidirectional because they can contain embedded RTL scripts that need to be displayed in an RTL direction.

Arabic n. 阿拉伯语

scripts n. 原稿,手稿(script的复数形式)

bidirectional adj. 双向的;双向作用的

embedded adj. 嵌入式的;植入的;内含的

阿拉伯等一些国家的文字是从右到左的,但是其中的以下数字等却是从左到右的,英语是从左到右的,但是其实也是双向性的,因为有时候也要包含一些从右到左的语法

解决方法

To solve this problem, use the unicodeWrap() method, found in the BidiFormatter class, on every piece of text that you insert into a localized message. The only times when you shouldn't use unicodeWrap() include the following:

1.The text is being inserted into a machine-readable string, such as a URI or a SQL query.

2.You already know that the piece of text is properly wrapped.

String mySuggestion = "15 Bay Street, Laurel, CA";

BidiFormatter myBidiFormatter = BidiFormatter.getInstance();

// The "did_you_mean" localized string resource includes

// a "%s" placeholder for the suggestion.

String.format(R.string.did_you_mean,        

myBidiFormatter.unicodeWrap(mySuggestion));

respectively adv. 分别地;各自地,独自地

specific adj. 特殊的,特定的;明确的;详细的;[药] 具有特效的

 legacy apps 老版本的app

logic n. 逻辑;逻辑学;逻辑性

demonstrates 示范

上一篇下一篇

猜你喜欢

热点阅读