Can I get entire i18n labels of specific dictionary

后端 未结 4 1114
耶瑟儿~
耶瑟儿~ 2021-01-15 07:42

I am facing an issue with i18n labels.

My application reads few i18n labels at js frontend using Granite.I18n.get(\'\') function. The entire dictionary gets downloa

4条回答
  •  我在风中等你
    2021-01-15 08:24

    I ended up writing a custom implementation as I didnt get much help from Adobe tickets as well on this issue.

    • OTB dictionary json is rendered by ResourceBundleExportServlet
    • I created a custom sling servlet that ll prepare and return json similar to ResourceBundleExportServlet
    • Modified /etc/clientlibs/granite/utils/source/I18n.js to call the custom servlet rather than otb servlet.
    • Custom servlet is coded to return only specific data dictionary and not all dictionaries.

    This solved my problem. Though am not convinced as proper solution. There needs to an otb way of rendering this clean.

提交回复
热议问题