Locali – a smart Hybris plugin

Erstellt von Tess Antony am 19. Feb 2018

Resource Bundle in Java

A resource bundle is a Java.properties file that contains locale-specific data. It is a way of internationalizing a Java application by making the code locale-independent. Resource bundles contain locale-specific objects. Extracting locale-sensitive objects such as strings from the code means that the application can handle multiple locales without having to write different code for each locale. It also means that translators can deal with just the translatable text and not the programming code. Therefore, using resource bundles improves the internationalization and the localization process of a software product.

Each parameter is stored as a pair of strings, one storing the name of the parameter (called the key/map), and the other storing the value.

Resource Bundle in Hybris

The Translations API provides the functionality to retrieve a Hybris resource bundle for specific locales. It provides Hybris resource bundles which is a set of key-value pairs representing localized content. The Translations API leverages the standard Hybris fallback languages. This means that if a resource bundle key does not have a matching message for the specified locale, then a message for a fallback locale will be provided.

Currently in Hybris

Functional text generally goes into the base.properties resource files, but when we need to change this text, this would necessitate a full re-deploy.

Using WCMS/Smart Edit you can change page components, their attributes but some messages are still not editable. If you need to change them, you need to ask the developers, because these files are part of the codebase. It can be said that these messages are hard-coded, but it is good that all of them are in the same place and tagged, but the truth is that they are not editable by administrators.

If you need to edit these messages when your website is up and running, it can take hours to fix that. In this case, you need to create a patch and apply it to the cluster. Hence you need to ask the developer or the person responsible to restart the server.

Solution

We have a solution in our hand which is Locali (beta-version) which pulls the messages from the database instead of the file system. It also allows administrators to manage the localized properties using the backoffice interface. All changes are immediately applied to the storefront. The important feature of this solution is that it is fully compatible with the existing templates. Locali is created using version 6.4.0.

Features

  •  All the localized properties can be updated on the go.
  • Will keep track of the changes.
  • Can be plugged to the project easily.
Backoffice view showing all the properties files used in our sample project
Backoffice view showing all the properties along with its file
Backoffice view for how to update the properties
Backoffice view for how to update the properties

More Info/Get Extension

Contact Us

 

Schreibe einen Kommentar

Kontaktieren Sie uns!
Nach oben scrollen