Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:10:29+00:00 2026-06-10T07:10:29+00:00

Internalization in Play2 can be done with Message.get(home.title) and language files. What about when

  • 0

Internalization in Play2 can be done with Message.get("home.title") and language files. What about when you internalizate a page full of textual content and not just one specific header or link?

For example doing Messagefile for a long page representing e.g. product info:

_First header_ 
Some paragraphs of text
...
_Tenth header_
Tenth paragraph and more text*

Messagefile

a)
product.info = "<many paragraphs of text including headers>"

or splitting one page into html elements

b)

   product.info.h1 = "<first header>"
   product.info.p1 = "<first para>"
   product.info.p2 = "<2nd para>"

For me both solutions doesn’t sound right. In first having a vast value for a single key seems bad convention and in latter separating a single page into dozens of keys doesn’t sound good either.

Big websites often follow the convention http://www.site.com/en-us/product/1 of having the language in the URL. So the question is, how do i do in this way and is doing in this way a better way at all? I could easily end up not just translating to dozen languages but doing also dozen times layout changes.

I could use global codesnippets using Messagefile for elements that have a little text and doesn’t change often e.g. navigation /view/global/header/somenavbar.scala.html but then i end up only having a complex folder structure.

Another way, a best practise, in Play 2 for internalization than messagefile?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:10:30+00:00Added an answer on June 10, 2026 at 7:10 am

    Take a look to the Joscha Feth’s solution in play_authenticate Java sample.

    There are templates for emails in 3 languages for email confirmation, password reseting etc.

    Template for each ‘type’ of email && each language is kept in single file ie:

    • _password_reset_en.scala.html
    • _password_reset_de.scala.html
    • _password_reset_pl.scala.html
    • _verify_email_en… etc

    And for each ‘type’ there is an ‘parent’ template, which contains a condition (common Scala’s match check the Tags section of template doc) which returns rendered view depending on detected language:

    • password_reset.scala.html

    Finally, yes, at the beginning I also thought that some kind of madness, but believe me, that technique can be useful. There’s field for further improvements I think. Maybe it would be better to move the language conditioning to the controller, hm I think that depends on many factors and it will be great if you’ll find a time to investigate this topic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys i have a question about Internalization and the terms and condition: in
The subject is in the topic - I can't figure out what is the
I have a problem with internalization of doctrine objects' forms in administration. Forms worked
I have a Flex panel, in InDesign, from which I drag an URL. If
I would like to ask if it is possible to develop my own XHTML
I'm building a Wordpress theme, and I would like it to work without having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.