Scout Neon: Display the keys for the localized texts in your application.
Eclipse Scout applications are multilingual per default. Scout developers work with text keys in the code and the application itself shows the translated texts in the language of the logged in user. When users asks to fix a specific text it can be tricky to find the right text key to improve the translated version of the text. In this blog post we offer a solution to force the application to show the text keys in the user interface instead of the translated text.
Eclipse Scout Applications contains out-of-the-box a mechanism to localize the user interface depending on the locale settings. It is based on Text properties files located in your code.
The Scout SDK provides a nice Editor to find the entries and to edit the text files directly as shown below:
However, it is not always easy to identify what is the text key corresponding to a label in the user interface.
The Text provider mechanism is built on top of the Scout bean manager. It is pretty easy to add an additional provider (see code bellow) having a smaller order than the other providers. This Provider just displays the key and the parameters instead of the localized text loaded from the properties files. This way you can see the labels in your application:
Such a text provider can be implemented according to the listing provided below: