Package net.sourceforge.plantuml.utils
Class I18n
- java.lang.Object
-
- net.sourceforge.plantuml.utils.I18n
-
public class I18n extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description I18n()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getLocalizedValue(java.lang.String language, java.lang.String key, java.lang.String defaultValue)
Retrieves a localized value for a given language and key, with the option to specify a default value.
-
-
-
Method Detail
-
getLocalizedValue
public static java.lang.String getLocalizedValue(java.lang.String language, java.lang.String key, java.lang.String defaultValue)
Retrieves a localized value for a given language and key, with the option to specify a default value.- Parameters:
language
- the language code (e.g., "en", "cn", "fr"); if null, the default locale's language is usedkey
- the key for the message to retrieve; must not be nulldefaultValue
- the fallback value to return if no translation is found; must not be null- Returns:
- the localized value corresponding to the key, or the
defaultValue
if no match is found - Throws:
java.lang.IllegalArgumentException
- ifkey
ordefaultValue
is null
-
-