Class Localization


  • public class Localization
    extends Object
    • Method Detail

      • getLocale

        public static final Locale getLocale()
        Returns the Locale object that is associated with ControlsFX.
        Returns:
        the global ControlsFX locale
      • setLocale

        public static final void setLocale​(Locale newLocale)
        Sets locale which will be used as ControlsFX locale
        Parameters:
        newLocale - null is allowed and will be interpreted as default locale
      • getString

        public static final String getString​(String key)
        Returns a string localized using currently set locale
        Parameters:
        key - resource bundle key
        Returns:
        localized text or formatted key if not found
      • asKey

        public static final String asKey​(String text)
        Converts text to localization key, currently by prepending it with the KEY_PREFIX
        Parameters:
        text -
        Returns:
        localization key
      • isKey

        public static final boolean isKey​(String text)
        Checks if the text is a localization key
        Parameters:
        text -
        Returns:
        true if text is a localization key
      • localize

        public static String localize​(String text)
        Tries to localize the text. If the text is a localization key - and attempt will be made to use it for localization, otherwise the text is returned as is
        Parameters:
        text -
        Returns: