How to load only part of the dictionary in AEM 6.0?

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

13-01-2016

Hello,

I'm using AEM6.0 with SP3.

In javascript we are loading part of the transation with CQ.I18n.getMessage method.

/libs/cq/i18n/dict.en_us.json returns only custom translation, but /libs/cq/i18n/dict.de_de.json in additional to our custom translation returns also AEM OOTB translations.

How I can prevent this for publish instance?

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,141 likes

Total Posts

3,167 posts

Correct reply

1,084 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,141 likes

Total Posts

3,167 posts

Correct reply

1,084 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

15-01-2016

Hi,

so do I understand you correct?

  • When you hit /libs/cq/i18n/dict.en_us.json with your browser, you get only the custom translations (= the translations you provided)
  • When you hit /libs/cq/i18n/dict.de_de.json with your browser, you get the custom translations plus the ootb german translations

Is this correct? And you have put your custom translations below /apps/my-project/i18.

Which version of AEM do you have? Can you provide the exact version of the bundle "org.apache.sling.i18n"?

kind regards,
Jörg

Answers (11)

Answers (11)

Avatar

Avatar
Boost 1
Level 1
sudheerssundala
Level 1

Likes

2 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
sudheerssundala
Level 1

Likes

2 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
sudheerssundala
Level 1

22-05-2018

We faced the similar requirement to fetch I18n values at client side using Granite.i18n Library

This is what I did.

1) Created a custom servlet which returns JSON response similar to ResourceBundleExportServlet

2) Loaded the bundle using basename and locale parameter - ResourceBundle resourceBundle = req.getResourceBundle(basename, pageLocale);

3) Added 'sling:basename="basename_constant"' in language specific i18n xml file which resides in /apps/project-name/i18n folder. In my case, I am setting the value of locale itself ex: "zh_cn"

4) In clientlibs javascript file setting Granite.I18n.setUrlPrefix("/bin/custom/i18n/dict."); to fetch from custom servlet URL.

Avatar

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mohanr80993572
Level 2

01-09-2016

Ok, thank you - Mohan

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

01-09-2016

We just deactivated /libs/wcm/core/i18n from publish instance

-Alex

Avatar

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mohanr80993572
Level 2

31-08-2016

Thanks Alex, for the info. Did you deactivate dictionaries at /libs/wcm/core/i18n in publish instance or using Guide Localization Service or overlayed  /libs/wcm/core/i18n with your custom or blank dictionaries?

- Mohan

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

31-08-2016

Hello,

We deactivated OOTB dictionaries from publish instance.

Thanks,

Alex

Avatar

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
mohanr80993572
Level 2

Likes

2 likes

Total Posts

24 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mohanr80993572
Level 2

31-08-2016

Hi Alex, could you find any solution for this? Even we are facing same issue.

Thanks,

Mohan

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

02-03-2016

Any updates?

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

18-01-2016

Hi,

>>When you hit /libs/cq/i18n/dict.en_us.json with your browser, you get only the custom translations (= the translations you provided)

>>When you hit /libs/cq/i18n/dict.de_de.json with your browser, you get the custom translations plus the ootb german translations

>>Is this correct? And you have put your custom translations below /apps/my-project/i18.

Correct.

>>Which version of AEM do you have?

AEM6.0 + SP3

Can you provide the exact version of the bundle "org.apache.sling.i18n"?

2.2.8

Thanks,

Alex

Avatar

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Alex_Popov1
Level 3

Likes

9 likes

Total Posts

78 posts

Correct reply

5 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Alex_Popov1
Level 3

15-01-2016

Hi Jörg,

/apps/my-project/i18n

Thanks,

Alex

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,141 likes

Total Posts

3,167 posts

Correct reply

1,084 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,141 likes

Total Posts

3,167 posts

Correct reply

1,084 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-01-2016

Hi,

where in the repository have you placed your custom translations?

kind regards,
Jörg

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,410 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,410 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

13-01-2016

The only info that I could find related to this question is located here:

https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/translator.html