This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-d4bb77fd-56d7-4ea3-81cb-d67b72485752 XWIKI-25651 Open

Load the translations of xwiki.js with the xwiki-l10n module

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-e52a9f03-4f34-4bbf-ac7f-5601011d77c2 Charpentier Lucas created this issue on 04/Nov/26 14:32
 
Summary: Load the translations of xwiki.js with the xwiki-l10n module
Issue Type: cid:jira-generated-image-avatar-d4bb77fd-56d7-4ea3-81cb-d67b72485752 Improvement
Affects Versions: 17.10.14
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 04/Nov/26 14:32
Priority: cid:jira-generated-image-static-major-6d512e80-a703-47f2-b3dc-f716a94f620a Major
Reporter: Charpentier Lucas
Description:

xwiki.js renders its translations server-side with Velocity, as JavaScript string literals: for instance platform.core.rendering.error.readTechnicalInformation for the rendering errors, edit for the section edit links, and core.create.popup.loading / core.create.ajax.error for the create dialog. The other front-end modules load their translations on the client with the xwiki-l10n RequireJS plugin (e.g. lightbox.js), which keeps the translation keys in one place per module and avoids escaping the translated messages into JavaScript code.

All the translations of xwiki.js should be loaded with xwiki-l10n, at the same time, so that the file keeps a single way of getting them.

This was discussed in https://github.com/xwiki/xwiki-platform/pull/4670#discussion_r4402257734.