There is an OOTB function CQ.I18n.getDictionary() to get translations, but it always gets the whole dictionary to the UI, which puts much load on the visitor's browser. This reuest is to provide a function that retrieves only the requested translations. E.g. it could accept key name(s) and language name as parameters.
Use-case:
Use localized strings in custom JS code on user-facing pages.
Current/Experienced Behavior:
Improved/Expected Behavior:
Environment Details (AEM version/service pack, any other specifics if applicable):
This request has been raised to the product team via the Jira CQ-4331470. The product team will triage this request to verify feasibility based on the prioritization model. This post will be updated according to the Jira request status.