Interface LocalizationManager


  • public interface LocalizationManager
    LocalizationManager holds and manages text translations (i18n)
    • Method Detail

      • setLanguage

        void setLanguage​(String lang)
      • getCurrentLanguage

        String getCurrentLanguage()
      • translate

        String translate​(Integer id)
        Returns a localized text
        Parameters:
        id - Default mod ("game-core") text identifier
        Returns:
        localized text
      • translate

        String translate​(String id)
        Returns a localized text
        Parameters:
        id - Text identifier. For default mod texts it's just the id, else it is also prefixed. Examples: "123", "prefix-123"
        Returns:
        localized text
      • translate

        String translate​(Integer id,
                         String defaultText)
        Returns a localized text
        Parameters:
        id - Default mod ("game-core") text identifier
        Returns:
        localized text or default text if localization id is not mapped
      • translate

        String translate​(String id,
                         String defaultText)
        Returns a localized text
        Parameters:
        id - Text identifier. For default mod texts it's just the id, else it is also prefixed. Examples: "123", "prefix-123"
        Returns:
        localized text or default text if localization id is not mapped