Package play.i18n

Class Langs


  • @Singleton
    public class Langs
    extends Object
    Manages languages in Play
    • Constructor Detail

      • Langs

        @Inject
        public Langs​(play.api.i18n.Langs langs)
    • Method Detail

      • availables

        public List<Lang> availables()
        The available languages.

        These can be configured in {$code application.conf}, like so:

         play.i18n.langs = ["fr", "en", "de"]
         
        Returns:
        The available languages.
      • preferred

        public Lang preferred​(Collection<Lang> candidates)
        Select a preferred language, given the list of candidates.

        Will select the preferred language, based on what languages are available, or return the default language if none of the candidates are available.

        Parameters:
        candidates - The candidate languages
        Returns:
        The preferred language
      • asScala

        public play.api.i18n.Langs asScala()
        Returns:
        the Scala version for this Langs.