package i18n

Contains the internationalisation API.

For example, translating a message:

val msgString = Messages("items.found", items.size)
Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. i18n
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class DefaultLangs extends Langs
    Annotations
    @Singleton()
  2. class DefaultLangsProvider extends Provider[Langs]
    Annotations
    @Singleton()
  3. class DefaultMessagesApi extends MessagesApi

    The Messages API.

    The Messages API.

    Annotations
    @Singleton()
  4. class DefaultMessagesApiProvider extends Provider[MessagesApi]
    Annotations
    @Singleton()
  5. trait I18NSupportLowPriorityImplicits extends AnyRef

    Implicit conversions for using i18n with requests and results.

  6. trait I18nComponents extends AnyRef

    Injection helper for i18n components

  7. class I18nModule extends Module
  8. trait I18nSupport extends I18NSupportLowPriorityImplicits

    Brings convenient implicit conversions from to Messages.

    Brings convenient implicit conversions from 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")
      }
    }
  9. case class Lang(locale: Locale) extends Product with Serializable

    A Lang supported by the application.

  10. trait LangImplicits extends AnyRef

    A trait for extracting a Messages instance from Langs

  11. trait Langs extends AnyRef

    Manages languages in Play

  12. trait Messages extends MessagesProvider

    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.

    Annotations
    @implicitNotFound()
  13. trait MessagesApi extends AnyRef

    The internationalisation API.

  14. case class MessagesImpl(lang: Lang, messagesApi: MessagesApi) extends Messages with Product with Serializable

    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.

    lang

    The lang (context)

    messagesApi

    The messages API

  15. trait MessagesImplicits extends AnyRef
  16. trait MessagesProvider extends AnyRef

    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.

    Annotations
    @implicitNotFound()

Value Members

  1. object I18nSupport extends I18NSupportLowPriorityImplicits

    A static object with type enrichment for request and responses.

    A static object with type enrichment for request and responses.

    import I18nSupport._
  2. object Lang extends Serializable

    Utilities related to Lang values.

  3. object Messages extends MessagesImplicits

    Internationalisation API.

    Internationalisation API.

    For example:

    val msgString = Messages("items.found", items.size)