-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 73.0.2
-
Fix Version/s: 73.4
-
Component/s: Resources, Studio Packaging
-
Sprint:NOS 9.10.2
-
Story Points:2
USE CASE
- a Studio project defines translation messages for the English language, so a file messages_en_US.properties was added to the Resources > i18 files.
- when users use another language (like French), the labels are not translated, because these messages are only appended to messages_en_US.properties and messages_en.properties global files by Studio:
<install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en_US.properties" addNewLine="true"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true"/> <delete path="${bundle.fileName}.tmp"/> </install>
Solution would be to add a new append command to contribute to the default messages.properties file:
- Go to "Advanced Settings > Deployment Extensions"
- Add similar instructions:
<install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true"/> <delete path="${bundle.fileName}.tmp"/> </install>
PROBLEM
The Studio build seems to be confused by these instructions, because the result is not valid in the final deployment-fragment.xml file generated by Studio:
<?xml version="1.0" encoding="UTF-8"?> <fragment version="1"> <extension target="application#MODULE"> <module> <java>${bundle.fileName}</java> </module> </extension> <require>all</require> <install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true"/> <delete path="${bundle.fileName}.tmp"/> <delete path="${bundle.fileName}.tmp"/> </install> <install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en_US.properties" addNewLine="true"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true"/> </install> </fragment>
This interferes with proper deployment of the nuxeo.war contributed files.
Expected result instead:
<?xml version="1.0" encoding="UTF-8"?> <fragment version="1"> <extension target="application#MODULE"> <module> <java>${bundle.fileName}</java> </module> </extension> <require>all</require> <install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en_US.properties" addNewLine="true"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages_en.properties" addNewLine="true"/> <delete path="${bundle.fileName}.tmp"/> </install> <install> <delete path="${bundle.fileName}.tmp"/> <unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp"/> <append from="${bundle.fileName}.tmp/data/i18n/messages_en_US.properties" to="nuxeo.war/WEB-INF/classes/messages.properties" addNewLine="true"/> <delete path="${bundle.fileName}.tmp"/> </install> </fragment>
(added custom contribution at the end, and moved around misplaced "delete" command)