Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a standard algorithm for locale resolution?

In support of software internationalization, many programming languages and platforms support a means of obtaining localized resources to be used in the UI that is shown to the user (e.g. Java's java.util.ResourceBundle class). Often, if resources for the user's preferred locale are not available, then there is a fallback mechanism, or locale resolution process, that will attempt to locate the nearest-matching resources from the sets of available resources. For example, if resources for en-US are not available, then commonly the system attempts to find resources for en.

The locale resolution process seems nearly the same for many languages' and platforms' resource bundle solutions. Are they following some standard locale resolution algorithm, or, if not, does such a standard exist?

like image 868
Daniel Trebbien Avatar asked Dec 27 '11 17:12

Daniel Trebbien


People also ask

What is use Locale default?

The default locale is appropriate for tasks that involve presenting data to the user. In this case, you want to use the user's date/time formats, number formats, rules for conversion to lowercase, and so on. In this case, it's safe to use the convenience methods.

What is a Locale localization?

Language localisation (or language localization) is the process of adapting a product's translation to a specific country or region.


1 Answers

There is apparently RFC 4647, Matching of Language Tags, which describes the syntax of "language-ranges" for specifying the list of a user's preferred languages, as well as the "filtering" and "lookup" mechanisms for comparing and matching language-ranges to RFC 4646 language tags. RFC 4647 describes these mechanisms as:

Filtering produces a (potentially empty) set of language tags, whereas lookup produces a single language tag.

like image 79
Daniel Trebbien Avatar answered Sep 27 '22 19:09

Daniel Trebbien