Content deleted Content added
Padrecamara (talk | contribs) No edit summary |
Padrecamara (talk | contribs) No edit summary |
||
Line 15:
Resource bundles are essentially text files. The most common type of content in a resource bundle is a list of strings. Each string has a “key” to identify it, which is the same in all the different resource bundles. When writing the code for the application, only the key is mentioned (this is why we say that the code is locale-independent). Using the methods provided in the Java API for the ResourceBundle class<ref>[http://java.sun.com/j2se/1.5.0/docs/api/ Java API ResourceBundle Class]</ref> , we can access the string (i.e. the "value") associated with the key. Depending on which locale the application is handling, it will call the adequate resource bundle at [[runtime]]<ref>Esselink, B. ''A Practical Guide to Software Localisation'', John Benjamins Publishing (1998).</ref>.
For instance, our resource bundle for the UK English locale can contain “firstKey = Localisation” and our US English one can contain “firstKey = Localization”. We will refer only to “firstKey” in the code and, according to the current locale settings, the application will use either “Localization” or “Localisation”.
|