{"id":8624,"date":"2016-05-23T09:54:37","date_gmt":"2016-05-23T07:54:37","guid":{"rendered":"http:\/\/phraseapp.com\/blog\/?p=211"},"modified":"2024-02-15T15:47:33","modified_gmt":"2024-02-15T14:47:33","slug":"i18n-3-easy-steps-to-localize-java-play-applications","status":"publish","type":"post","link":"https:\/\/phrase.com\/blog\/posts\/i18n-3-easy-steps-to-localize-java-play-applications\/","title":{"rendered":"3 Easy Steps to Localize Java Play Framework Projects"},"content":{"rendered":"<p style=\"text-align: left;\">Localizing Java Play Framework apps can be quite tedious. In this tutorial, we&#8217;ll show you how Phrase can aid the translation of your Play Framework projects.<\/p>\n<h2 id=\"your-basic-setup\" style=\"text-align: left;\">Your Basic Setup for Localizing Java Play Framework Apps<\/h2>\n<p style=\"text-align: left;\">The steps to internationalization are quite easy and can be followed by the <a href=\"http:\/\/goo.gl\/DiIAVi\">i18n guide from Typesafe<\/a>.<\/p>\n<p>First, add the desired languages you would want to accept to your <code>conf\/application.conf<\/code> with priority from important to a less important locale:<\/p>\n<pre class=\"lang:default decode:true EnlighterJSRAW\" data-enlighter-language=\"generic\">application.langs=\"en,de,fr\"<\/pre>\n<p>Add the files <code>messages.en<\/code>, <code>messages.de<\/code>, and <code>messages.fr<\/code> to your \/conf folder.<br \/>\nNow you can start translating\/localizing by consulting the <a href=\"http:\/\/goo.gl\/mmtjym\">official Play Documentation.<\/a><\/p>\n<h2 id=\"integrate-with-phraseapp\" style=\"text-align: left;\">Integrate with Phrase<\/h2>\n<p style=\"text-align: left;\">Using the proper format for your localization files is important. Phrase supports the Play Properties format with UTF-8 encoding and without content escaping.<\/p>\n<p style=\"text-align: left;\">Other than that it is based on the Java Properties format.<\/p>\n<p style=\"text-align: left;\">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). <a href=\"https:\/\/support.phrase.com\/hc\/en-us\/articles\/5709621471516-Supported-File-Formats-TMS\"><span style=\"font-weight: 400;\">See our Format Guide<\/span><\/a>.<\/p>\n<p style=\"text-align: left;\">A sample valid Play Properties file:<\/p>\n<pre class=\"lang:default highlight:0 decode:true EnlighterJSRAW\" data-enlighter-language=\"generic\"># My Software Project (description)\nproject.name=Some Name\ntitle1=AwesomeApp\n# You can never have enough titles!\nmore_titles Another Title<\/pre>\n<p style=\"text-align: left;\">You can now easily upload the locale file to Translation Center:<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbnail alignnone\" src=\"https:\/\/31.media.tumblr.com\/1a5c8a453e0489569385978b2a64f254\/tumblr_inline_nd2me6gHuG1sdup2l.png\" alt=\"Uploading the locale file to the Translation Center | Phrase\" width=\"500\" height=\"704\" \/><\/p>\n<p style=\"text-align: left;\">\u2026 or through our <a href=\"http:\/\/goo.gl\/0Qyhh7\">phrase gem<\/a>\u2026<\/p>\n<pre class=\"lang:default decode:true EnlighterJSRAW\" data-enlighter-language=\"generic\">phrase push conf\/messages.en --format=play_properties --locale=en --tag=version_1<\/pre>\n<p style=\"text-align: left;\">Along the lines with \u201cpush\u201d the usage of phrase pull is straightforward. Simply type:<\/p>\n<pre class=\"lang:default decode:true EnlighterJSRAW\" data-enlighter-language=\"generic\">phrase pull en --format=play_properties --target=conf\/ --tag=version_1<\/pre>\n<p style=\"text-align: left;\">The tag option is optional but always nice. With this, you have a labeling system to manage your translations in manageable chunks (like Gmail).<\/p>\n<p style=\"text-align: left;\">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.<\/p>\n<p style=\"text-align: left;\">If Ruby does not suit your needs, just use our <a href=\"https:\/\/developers.phrase.com\/api\/\">REST-based API directly<\/a>.<\/p>\n<h2 id=\"next-steps\" style=\"text-align: left;\">Next Steps<\/h2>\n<p style=\"text-align: left;\">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.<\/p>\n<p style=\"text-align: left;\">To invite your team members, go to our web frontend known as the \u201cTranslation Center\u201d click on \u201cAccount\u201d and go to your user management. Invite translators, developers or managers to your team all with their own permissions.<\/p>\n<p style=\"text-align: left;\">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 &#8211; created by your translators &#8211; it is updated in your local application, too. This needs to be done continuously especially when you ship often.<\/p>\n<h2 id=\"further-reading\" style=\"text-align: left;\">Further Reading<\/h2>\n<ul style=\"text-align: left;\">\n<li><a href=\"https:\/\/phrase.com\/\">Phrase official site<\/a><\/li>\n<li><a href=\"http:\/\/goo.gl\/0Qyhh7\">Phrase GitHub<\/a><\/li>\n<li>Translating with Play Framework <a href=\"http:\/\/goo.gl\/DiIAVi\">Scala 2.0<\/a> or <a href=\"http:\/\/goo.gl\/tzbyC7\">Java 2.1<\/a><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><a href=\"https:\/\/phrase.com\/blog\/\"><span style=\"font-weight: 400;\">Be sure to subscribe<\/span><\/a> and receive all updates from the Phrase blog straight to your inbox. You\u2019ll 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\u2019t miss out!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Localizing Java Play Framework projects can be quite tedious. Learn here how Phrase can help you translate your Play Framework app with ease!<\/p>\n","protected":false},"author":61,"featured_media":2612,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_stopmodifiedupdate":true,"_modified_date":"","_searchwp_excluded":"","footnotes":""},"categories":[40],"class_list":["post-8624","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-localization"],"acf":[],"_links":{"self":[{"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/posts\/8624"}],"collection":[{"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/users\/61"}],"replies":[{"embeddable":true,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/comments?post=8624"}],"version-history":[{"count":6,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/posts\/8624\/revisions"}],"predecessor-version":[{"id":89372,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/posts\/8624\/revisions\/89372"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/media\/2612"}],"wp:attachment":[{"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/media?parent=8624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phrase.com\/wp-json\/wp\/v2\/categories?post=8624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}