Skip to Content

Introduction

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 Medepia 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.

  1. There can be an i18n key in .view.xml which is not defined for a language(or all).
  2. There is no easy way to see where a property is used.
  3. There can be unnecessary properties that are unused in views.
  4. Property files can get disorganised.

This tool creates .help.properties file for each .properties file. Benefits are:

  1. There are entries at the top of the file for missing properties for each language.
  2. Usage location is written under each property.
  3. Unused properties are shown at the top of the file.
  4. 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.

At the time of writing, the tool doesn’t read controller or javascript view files for i18n strings. Maybe in the future we can bring this feature based on our needs and your feedback.(pull request anyone?)

Example

Here is an example *.properties file(click for bigger image)

/wp-content/uploads/2016/06/medepia_ui5_i18n_helper_1_966851.png

Here is the result *.help.properties file(click for bigger image)

/wp-content/uploads/2016/06/medepia_ui5_i18n_helper_2_966852.png

Usage

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:

ui5i18n

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!

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply