Package play.i18n
Class Langs
- Object
-
- play.i18n.Langs
-
@Singleton public class Langs extends Object
Manages languages in Play
-
-
Constructor Summary
Constructors Constructor Description Langs(play.api.i18n.Langs langs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description play.api.i18n.Langs
asScala()
List<Lang>
availables()
The available languages.Lang
preferred(Collection<Lang> candidates)
Select a preferred language, given the list of candidates.
-
-
-
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.
-
-