Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are ICU resource bundles meant for message translation resources

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.

like image 607
Basel Shishani Avatar asked Nov 08 '11 13:11

Basel Shishani


1 Answers

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

like image 66
Steven R. Loomis Avatar answered Oct 14 '22 04:10

Steven R. Loomis