Package org.djunits.locale
Class Localization
java.lang.Object
org.djunits.locale.Localization
- All Implemented Interfaces:
Serializable
public class Localization extends Object implements Serializable
Localization object for language specific reporting of units.
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Localization(String prefix)
Create a Localization object. -
Method Summary
-
Constructor Details
-
Localization
Create a Localization object.- Parameters:
prefix
- String; the prefix of the properties files to use.
-
-
Method Details
-
getString
Retrieve a string from a locale bundle. If retrieval fails the value of key string, surrounded by exclamation marks is returned.- Parameters:
key
- String; the key for the locale in the properties file- Returns:
- String; localized string, or, if a translation could not be found return the key surrounded by exclamation marks
-
getDefaultString
Retrieve a string from the default locale bundle. If retrieval fails the value of key string, surrounded by exclamation marks is returned.- Parameters:
key
- String; the key for the locale in the properties file- Returns:
- String; localized string, or, if a translation could not be found return the key surrounded by exclamation marks
-
isDefault
public boolean isDefault()Return whether the current locale is the default (English) locale.- Returns:
- boolean; true if the current locale is the default; false if the current locale is not the default
-
toString
-