Lang

play.api.i18n.Lang
See theLang companion class
object Lang

Utilities related to Lang values.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Lang.type

Members list

Type members

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(code: String): Lang

Create a Lang value from a code (such as fr or en-US) and throw exception if language is unrecognized

Create a Lang value from a code (such as fr or en-US) and throw exception if language is unrecognized

Attributes

def apply(language: String, country: String, script: String, variant: String): Lang

Create a Lang value from a code (such as fr or en-US) and throw exception if language is unrecognized

Create a Lang value from a code (such as fr or en-US) and throw exception if language is unrecognized

Attributes

def get(code: String): Option[Lang]

Create a Lang value from a code (such as fr or en-US) or none if language is unrecognized.

Create a Lang value from a code (such as fr or en-US) or none if language is unrecognized.

Attributes

Concrete fields

lazy val defaultLang: Lang

The default Lang to use if nothing matches (platform default).

The default Lang to use if nothing matches (platform default).

Pre 2.6.x, defaultLang was an implicit value, meaning that it could be used in implicit scope resolution if no Lang was found in local scope. This setting was too general and resulted in bugs where the defaultLang was being used instead of a request.lang, if request was not declared as implicit.

Attributes

val logger: Logger

Implicits

Implicits

implicit val jsonTagReads: Reads[Lang]
implicit val jsonTagWrites: Writes[Lang]