@Singleton
public class Langs
extends java.lang.Object
Constructor and Description |
---|
Langs(play.api.i18n.Langs langs) |
Modifier and Type | Method and Description |
---|---|
play.api.i18n.Langs |
asScala() |
java.util.List<Lang> |
availables()
The available languages.
|
Lang |
preferred(java.util.Collection<Lang> candidates)
Select a preferred language, given the list of candidates.
|
public java.util.List<Lang> availables()
These can be configured in application.conf, like so:
play.i18n.langs = ["fr", "en", "de"]
public Lang preferred(java.util.Collection<Lang> candidates)
Will select the preferred language, based on what languages are available, or return the default language if none of the candidates are available.
candidates
- The candidate languagespublic play.api.i18n.Langs asScala()