Messages and internationalization in Play 2.4.x


Knoldus

In this blog we would discuss about Messages and internationalization in Play Framework which would drive us through the implementation and testing of the Play MessagesAPI.

Messages and internationalization

Play supports Internationalization (i18n) out of the box by leveraging the underlying internationalization support. With Play you are able to customize the text that appears in a view based on the user’s Locale.

Specifying languages supported by your application

A valid language code is specified by a valid ISO 639-2 language code, optionally followed by a valid ISO 3166-1 alpha-2 country code, such as fr or en-US.

To start you need to specify the languages supported by your application in the conf/application.conf file:

play.i18n.langs =["en","en-US","fr"]

File Externalization

You can externalize messages in the conf/messages.xxx files.

messages_files

The default conf/messages file matches all languages. Additionally you can specify language-specific…

View original post 474 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s