Are ICU resource bundles meant for message translation resources

眉间皱痕 提交于 2019-12-21 04:09:03

问题


I understand the localization part of ICU - date, time and currency formats, collation, etc. When it comes to message translation, I see people stating that ICU does not provide functionality for message translation - check for example this SOF question.

However, when checking ICU docs, we find that it provides resources bundles, and the documentation does seem to hint to using them for message translation:

In PHP intl documentation for example:

Localized software products often require sets of data that are to be customized depending on current locale, e.g.: messages, labels, formatting patterns. ICU resource mechanism allows to define sets of resources that the application can load on locale basis, while accessing them in unified locale-independent fashion.

The documentation here: http://userguide.icu-project.org/locale/resources describes functionality similar to a key-value store, with text sources that can be compiled into binary format.

My question is whether ICU resource bundles (including the access functionality and the storage format) are meant for - or it is part of their purpose - to be used for message translation - for example like gettext and .po files are. If such, is there any resources or tutorials that discuss this usage.

Or a rewording: in its design goals, is the ICU meant to be used in conjunction with a separate message translation facility, or does it strive to provide such functionality itself, or is it that both options are possible.


回答1:


Yes ICU resource bundles are meant to be used for the purpose of retrieving messages. The answer to the other SOF question is incorrect as regards ICU. The link you provided is correct, and also mentions converting ICU resource bundle formats in and out of XLIFF. ICU also provides a catgets() style wrapper in http://icu-project.org/apiref/icu4c/ucat_8h.html

ICU wouldn't prevent you from using a separate message retrieval facility, but it is certainly meant to be one- and is used that way.

-Steven, ICU project

Edit ICU does not currently/officially have an xgettext like extraction facility. Perhaps that is some of the source of the distinction?

Edit 2 more details in: http://userguide.icu-project.org/locale/localizing



来源:https://stackoverflow.com/questions/8051104/are-icu-resource-bundles-meant-for-message-translation-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!