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 rao vặt miễn phí - 3:04 PM on Sep 26, 2013   Reply
    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).
  • By Luận Văn Tốt Nghiệp - 1:13 PM on Sep 27, 2013   Reply
    :) thank for this
    • By كلمات حب - 6:46 AM on Dec 23, 2013   Reply

      Thanks for a nice share you have given to us with such an large collection of information.
      • By حكم واقوال - 6:46 AM on Dec 23, 2013   Reply

        Thanks for a nice share you have given to us with such an large collection of information.

        ADD A COMMENT