Constructor and Description |
---|
I18n(String translationsBundle)
Make an internationalisation object with the given bundle.
|
Modifier and Type | Method and Description |
---|---|
String |
getString(Locale locale,
String label,
Object... args)
Get a localized message for a given locale and label, and optionally arguments.
|
static String |
getString(String bundleName,
Locale locale,
String label,
Object... args)
Get a localized message for a given resource bundle, locale and label.
|
public String getString(Locale locale, String label, Object... args)
E.g.
I18N.getString(Locale.default, "job.unknown.id", 17)
In contrast to ResourceBundle.getString(java.lang.String)
, this method is forgiving on errors
locale
- The locale to get the string forlabel
- The label of the string in the resource bundleargs
- Any args required for formatting the labelArgumentNotValid
- on null or empty local or label.public static String getString(String bundleName, Locale locale, String label, Object... args)
In contrast to ResourceBundle.getString(java.lang.String)
, this method is forgiving on errors
I18n.getString("dk.netarkivet.common.Translations", Locale.default, "job.unknown.id", 17)
bundleName
- The name of the resource bundle, fully qualified, but without the properties. See
ResourceBundle.getBundle(String)
locale
- The locale to get the string forlabel
- The label of the string in the resource bundleargs
- Any args required for formatting the labelArgumentNotValid
- on null bundleName, locale or label.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.