Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

sling:message customization per project using i18n

$
0
0

Hi all,

 

 

I saw this post on the sling message boards, which is the same question as mine, but I didn't see a resolution:

http://apache-sling.73963.n3.nabble.com/Overriding-of-sling-messages-i n-sling-i18n-td4020615.html

 

In our scenario, this is more about site localization than internationization, in that we may re-use components in multiple sites, but want to be able to customize header text using i18n.

 

For example, the default component, and the jsp for it, may live in:

 

/apps/defaultsite/components/mycomponent

 

under that component I have:

 

/en/

     key1 (sling:key="Lorem", sling:message="ipsum")

 

For a specific site that will be using that component, I want to override key 1 to use something different for the message, I create a new component at:

 

/apps/customsite/components/mycomponent  and have it's sling:resourceSuperType reference the component listed above (/apps/defaultsite/components/mycomponent)

 

I then create my sling message under my new component:

 

/en/

     key1 (sling:key="Lorem", sling:message="customsite")

 

The behavior I see (which the other post also mentions) is that whatever translation was saved last is what gets rendered onto the page, the logic for i18n doesn't look like it can be set at multiple places and then have the sling:resourceType and resourceSuperType resolution be used to figure out which value to use.

 

 

Is there another approach to use so I can override sling messages at the component level when a component inherits from another component that already was using the same sling:message?

 

Thanks!


Viewing all articles
Browse latest Browse all 12476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>