This application is created to easily manage all translation keys and values needed to localize a website in multiple languages. Unlike i18n, this application works with the translation keys from a repo in Enonic XP, making it possible to update without building a new application and deploying.
You need to be on Enonic XP 7.9.2 or higher.
Install the app via Enonic market in the applications tool or build it yourself.
git clone https://github.com/seeds/text-translation-manager-xp.git
cd text-translation-manager-xp
./gradlew clean buildThe application jar should be in /build/libs as translationmanager-x.x.x.jar
The application includes an admin tool "Text Translation Manager". This is where you set keys for your sites to use for localization. The application also needs to be added to the sites that will use the localization keys. The app exposes a JSON API with all translation keys to external sources. [YOUR SITE]/api/translate
When installing the application from Enonic Market, translations are done front-end using a specific data tag to inject the translated keys.
In the "Text Translation Manager", add a key to your site, and give it a value, for instance: my.special.label = My label!
To automatically translate this on a component that uses this key we need to add the following data tag to the HTML element you want to localize:
<div data-translate-manager="my.special.label">"My label!" will be inserted here</div>The Enonic Processor included in the app on the site will automatically find what keys are used on the site and include the localized values in a JSON object. When the page loads in your browser, the translate script will find all keys being used and replace innerHTML of any DOM element with the data tag.
| Version | XP version |
|---|---|
| 1.0.0 | 7.9.2 |
A license is required to use this application. Once the app is installed, the Admin Tool will be blocked until a license is provided.
You can contact Seeds to request a license. If a valid license is not found in the system, it can be installed by clicking the button Upload license in the Admin Tool.
Made by Seeds Consulting
This application was built together with the Norwegian Directorate of Health. They made the development of this application possible, and allowed us to share it as an open source project. Thank you for sharing!
- Various libs form Enonic XP, License: GPL 3.0 & Apache 2.0
- Bootstrap, License: MIT
- Semantic UI, License: MIT
- JSON Java, License: Public Domain