Class Localization

    • Constructor Detail

      • Localization

        public Localization​(String prefix)
        Create a Localization object.
        Parameters:
        prefix - String; the prefix of the properties files to use.
    • Method Detail

      • getString

        public final String getString​(String key)
        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

        public final String getDefaultString​(String key)
        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