I have created a page with empty editable template. I have structure page inside my application and following code throwing a js error : "Cannot read property setLocale of undefined"
if (typeof Granite !== "undefined") { | |
Granite.I18n.setLocale('en_US'); | |
} |
Any ideas ?
Thanks,
Sri
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Granite.I18n is defined in http://localhost:4502/etc.clientlibs/clientlibs/granite/utils.js
Can you check if this file is loaded for not?
in Author I didn't added any dependancy explicitly because this file is loaded due to dependency of cq.authoring.dialog and can see I18n in console
You can explicitly load this. category for utils.js is granite.utils
Thanks
Arun
Views
Replies
Total Likes
Hi,
Try below:
if (Granite !== 'undefined' || Granite !== null) {
Granite.I18n.setLocale('en_US');
}
Views
Replies
Total Likes
Granite is defined but not i18n.
Views
Replies
Total Likes
I am more interested in knowing if I need to any client libs as dependency for application client lib category.
Views
Replies
Total Likes
Hi,
Granite.I18n is defined in http://localhost:4502/etc.clientlibs/clientlibs/granite/utils.js
Can you check if this file is loaded for not?
in Author I didn't added any dependancy explicitly because this file is loaded due to dependency of cq.authoring.dialog and can see I18n in console
You can explicitly load this. category for utils.js is granite.utils
Thanks
Arun
Views
Replies
Total Likes
Correct. Added granite.utils as category dependency.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies