play.api.i18n
Contains the internationalisation API.
For example, translating a message:
val msgString = Messages("items.found", items.size)
Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
Attributes
- Supertypes
The Messages API.
Attributes
- Supertypes
Implicit conversions for using i18n with requests and results.
Implicit conversions for using i18n with requests and results.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait I18nSupportobject I18nSupport.type
Injection helper for i18n components
Injection helper for i18n components
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
Brings convenient implicit conversions from play.api.mvc.RequestHeader to Messages.
Brings convenient implicit conversions from play.api.mvc.RequestHeader to Messages.
Example:
import play.api.i18n.Messages
class MyController(val messagesApi: MessagesApi ...)
extends AbstractController(cc) with I18nSupport {
val action = Action { implicit request =>
val messageFromRequest = request.messages("hello.world")
Ok(s"$messageFromRequest")
}
}
Attributes
- Companion
- object
- Supertypes
A static object with type enrichment for request and responses.
A static object with type enrichment for request and responses.
import I18nSupport._
Attributes
- Companion
- trait
- Supertypes
- Self type
-
I18nSupport.type
A trait for extracting a Messages instance from Langs
A trait for extracting a Messages instance from Langs
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Manages languages in Play
Manages languages in Play
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class DefaultLangs
Internationalisation API.
Internationalisation API.
For example:
val msgString = Messages("items.found", items.size)
Attributes
A messages returns string messages using a chosen language.
A messages returns string messages using a chosen language.
This is commonly backed by a MessagesImpl case class, but does extend Product and does not expose MessagesApi as part of its interface.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class MessagesImpl
The internationalisation API.
The internationalisation API.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class DefaultMessagesApi
Provides messages for a particular language.
Provides messages for a particular language.
This intended for use to carry both the messages and the current language, particularly useful in templates so that both can be captured by one parameter.
Value parameters
- lang
-
The lang (context)
- messagesApi
-
The messages API
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Messagestrait MessagesProviderclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object Messages.type
This trait is used to indicate when a Messages instance can be produced.
This trait is used to indicate when a Messages instance can be produced.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes