Hi UI5 developers,
I would like to introduce a helper tool we wrote for ui5 i18n(internationalization) process.
Being open source is an undisputable advantage in web development. I’m glad SAP went open source with ui5 technology and we are here to contribute back. I would like to thank MDP IT Consulting for enabling this work.
In short, it solves one major and three minor problems below and we find it useful as projects get bigger.
- There can be an i18n key in .view.xml which is not defined for a language(or all).
- There is no easy way to see where a property is used.
- There can be unnecessary properties that are unused in views.
- Property files can get disorganised.
This tool creates .help.properties file for each .properties file. Benefits are:
- There are entries at the top of the file for missing properties for each language.
- Usage location is written under each property.
- Unused properties are shown at the top of the file.
- Properties are grouped based on usage locations.
This tool doesn’t modify original property file for safety. We thought that it is better to let users change content manually.
Here is an example *.properties file(click for bigger image)
Here is the result *.help.properties file(click for bigger image)
Prerequisites: Node.js should be installed which comes with npm(link: Node.js)
Open cmd.exe or linux shell, install package:
npm install -g ui5-i18n-helper
Then go to project directory and execute helper tool with command:
And that is all! Your *.help.properties files should be created next to *.properties files. You can run this command repeatedly as you change project files.
Thanks for reading!