3 Easy Steps to Localize Java Play Framework Projects

Localizing Java Play Framework projects can be quite tedious. Learn here how Phrase can help you translate your Play Framework app with ease!

Localizing Java Play Framework apps can be quite tedious. In this tutorial, we’ll show you how Phrase can aid the translation of your Play Framework projects.

Your Basic Setup for Localizing Java Play Framework Apps

The steps to internationalization are quite easy and can be followed by the i18n guide from Typesafe.

First, add the desired languages you would want to accept to your conf/application.conf with priority from important to a less important locale:

application.langs="en,de,fr"

Add the files messages.en, messages.de, and messages.fr to your /conf folder.
Now you can start translating/localizing by consulting the official Play Documentation.

Integrate with Phrase

Using the proper format for your localization files is important. Phrase supports the Play Properties format with UTF-8 encoding and without content escaping.

Other than that it is based on the Java Properties format.

Phrase renders all downloaded files with the file extension of the locale name you use within your project (like en_US, en-GB or de). See our Format Guide.

A sample valid Play Properties file:

# My Software Project (description)
project.name=Some Name
title1=AwesomeApp
# You can never have enough titles!
more_titles Another Title

You can now easily upload the locale file to Translation Center:

Uploading the locale file to the Translation Center | Phrase

… or through our phrase gem

phrase push conf/messages.en --format=play_properties --locale=en --tag=version_1

Along the lines with “push” the usage of phrase pull is straightforward. Simply type:

phrase pull en --format=play_properties --target=conf/ --tag=version_1

The tag option is optional but always nice. With this, you have a labeling system to manage your translations in manageable chunks (like Gmail).

In this example we explicitly deal with the en locale, you can also push directories or pull all locales and their translations by not typing a locale at all.

If Ruby does not suit your needs, just use our REST-based API directly.

Next Steps

Now that your application is up to speed with your latest translations you can start collaborating with your team members to edit your translations from within the Phrase Translation Center.

To invite your team members, go to our web frontend known as the “Translation Center” click on “Account” and go to your user management. Invite translators, developers or managers to your team all with their own permissions.

Your translators can work from within the Translation Center. Your developers might do some more background work with the API to regularly update translations by pushing first. Through pushing, the local translations added by your developers are transmitted to the Translation Center. By pulling the new content – created by your translators – it is updated in your local application, too. This needs to be done continuously especially when you ship often.

Further Reading

Be sure to subscribe and receive all updates from the Phrase blog straight to your inbox. You’ll receive localization best practices, about cultural aspects of breaking into new markets, guides and tutorials for optimizing software translation and other industry insights and information. Don’t miss out!

Keep exploring

Photo-realistic sheet music featuring developer-style translation code in place of musical notes. The staff lines show snippets like t('auth.signin.button') and JSON structures, combining the aesthetics of musical notation with programming syntax to illustrate the idea of “composable localization.”

Blog post

Localization as code: a composable approach to localization

Why is localization still a manual, disconnected process in a world where everything else is already “as code”? Learn how a composable, developer-friendly approach brings localization into your CI/CD pipeline, with automation, observability, and Git-based workflows built in.

A woman in a light sweater sits in a home office, focused on her laptop, representing a developer or content manager working on WordPress localization tasks in a calm, professional environment.

Blog post

How to build a scalable WordPress i18n workflow

WordPress powers the web, but translating it well takes more than plugins. Discover how to build a scalable localization workflow using gettext, best practices, and the Phrase plugin.

Blog post

Localizing Unity games with the official Phrase plugin

Want to localize your Unity game without the CSV chaos? Discover how the official Phrase Strings Unity plugin simplifies your game’s localization workflow—from string table setup to pulling translations directly into your project. Whether you’re building for German, Serbian, or beyond, this guide shows how to get started fast and localize like a pro.

Blog post

Internationalization beyond code: A developer’s guide to real-world language challenges

Discover how language affects your UI. From text expansion to pluralization, this guide explores key i18n pitfalls and best practices for modern web developers.

A digital artwork featuring the Astro.js logo in bold yellow and purple tones, floating above Earth's horizon with a stunning cosmic nebula in the background. The vibrant space setting symbolizes the global and scalable nature of Astro’s localization capabilities, reinforcing the article’s focus on internationalization in web development.

Blog post

Astro.js localization part 2: dynamic content localization

Learn how to localize your Astro.js website with static and dynamic content translation. Explore Astro’s built-in i18n features and Paraglide for handling UI elements, navigation, and dynamic text seamlessly.