Class LocalizationService

    • Constructor Detail

      • LocalizationService

        public LocalizationService​(BotConfig botConfig)
    • Method Detail

      • getLocaleForGuild

        public Locale getLocaleForGuild​(long guildId)
        Finds the locale specific to the given guild.
        Parameters:
        guildId - the guild id
        Returns:
        the locale used by the guild
      • setLocaleForGuild

        public void setLocaleForGuild​(long guildId,
                                      @Nullable
                                      Locale locale)
        Sets a locale specific for the given guild. If one was already set for the same guild, it is overwritten.
        Parameters:
        guildId - the guild id
        locale - the new locale. May be null, in which case the locale is removed.
      • getSupportedLocales

        public Set<Locale> getSupportedLocales()
        Gets the set of locales supported by this service.
        Returns:
        the locales supported
      • getLocale

        public Locale getLocale()
        Description copied from interface: Translator
        Gets the locale used by this translator.
        Specified by:
        getLocale in interface Translator
        Returns:
        the locale