Community contributed extensions

Importing/Exporting i18n resource files from Nemrod

With this module, you can export your i18n resource files from Nemrod.
See here for more information about Nemrod : Nemrod

Install the ‘nemrod’ module

typing 'play install nemrod':

~$ play install nemrod
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2, http://www.playframework.org
~
~ Will install nemrod-1.0
~ This module is compatible with: 1.2.3
~ Do you want to install this version (y/n)? y
~ Installing module nemrod-1.0...
~
~ Fetching http://www.playframework.org/modules/nemrod-1.0.zip
~ [--------------------------100%-------------------------] 0.0 KiB/s
~ Unzipping...
~
~ Module nemrod-1.0 is installed!
~ You can now use it by add adding this line to application.conf file:
~
~ module.nemrod=${play.path}/modules/nemrod-1.0
~

Import i18n resource file from Nemrod

Now you can import your i18n resource file from Nemrod. When importing from Nemrod you will download all the messages* files for every languages you choosed to support.

~$ play nemrod:import
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2, http://www.playframework.org
~
~ Import:
~ Project: Nemrod
~ login: myuser
~ url: http://live.localizeyourapps.com/
~
~
12:15:02,161 INFO  ~ Download file=E:\Developpement\checkout\hakatech\Nemrod\conf\messages.fr - OK
12:15:03,950 INFO  ~ Download file=E:\Developpement\checkout\hakatech\Nemrod\conf\messages.en - OK
~ copy E:\Developpement\checkout\hakatech\Nemrod\conf\messages.fr to default bundle
# ------------ Nemrod ------------------
# project name to retrieve on nemrod
nemrod.project.name=Nemrod
# nemrod apikey
nemrod.apikey=fzemflsfdglmkdrgaaajfdkjnkjnkdfhksjduio
# nemrod url
nemrod.url=http://live.localizeyourapps.com/
# export only approved values
nemrod.onlyapprovedvalues=False
# export empty values
nemrod.exportemptyvalues=False
nemrod.defaultlang=fr
# i18n
# ~~~~~
# Define locales used by your application.
# You can then place localized messages in conf/messages.{locale} files
application.langs=fr,en

Note that it is possible to give url on the command line parameters instead of setting the parameters in the configuration file.

~$ play nemrod:import --url http://live.localizeyourapps.com

Sync master resource file to Nemrod

It is possible to synchronize your i18n master resource file to Nemrod. The master file corresponds to the default bundle.
When synchronizing to Nemrod, every new messages in the conf/messages will be added to Nemrod and old translations will be updated if needed.

~$ play nemrod:sync
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2, http://www.playframework.org
~
~ Sync:
~ Project: Nemrod
~ login: myuser
~ url: http://live.localizeyourapps.com/
~
~
12:15:02,161 INFO  ~ Sync master file=E:\Developpement\checkout\hakatech\Nemrod\conf\messages - OK

The configuration is identical to the configuration described in previous section.

Note that it is possible to give url on the command line parameters instead of setting the parameters in the configuration file.

~$ play nemrod:sync --url http://live.localizeyourapps.com