Created

Sep 16, 2013

i18n and the comment parameter

Posted by Feike Visser

Today I had a small issue to implement a translation for an i18n call, via this post I want you to show the issue and how to resolve it.

It has to do that you can specify a 'comment' in your i18n call to give the translators more context.

This was the i18n content I wanted to translate. This is located in the ratings-component.

i18n.get("I love it", "Rating meaning for 5 stars")

My thinking was that a sling:key with the value of 'I love it' should be enough.

Well it is not, because of the comment that is specified (Rating meaning for 5 stars).

When you have a comment, the i18n-api expects the following sling:key "I love it ((Rating meaning for 5 stars))"

Below an example with a nice Dutch translation.

ratings2

Related docs

i18n Javadoc

 

Happy coding.

@heervisscher

COMMENTS

  • By Tattoos - 4:43 PM on Jun 08, 2014   Reply
    Many Thanks.
  • By Obat Keputihan - 9:38 AM on Jun 22, 2014   Reply
    Many Thanks.
    • By Judi Online - 8:02 AM on Jul 21, 2014   Reply
      After read a couple of the articles on your website these few days, and I truly like your style of blogging. I tag it to my favorites internet site list and will be checking back soon. Please check out my web site also and let me know what you think.
      • By Judi Bola Online - 8:07 AM on Jul 21, 2014   Reply
        You may post on the professional credentials for the blog owner. You could express it's outstanding. Your blog experience can springboard your click through.
        • By Klasemen Liga Spanyol - 8:12 AM on Jul 21, 2014   Reply
          This web site is really a walk-through for all of the info you wanted about this and didn’t know who to ask. Glimpse here, and you’ll definitely discover it….

          ADD A COMMENT