Skip to content

99x/text-translation-manage-xp

Repository files navigation

Text Translation Manager

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.

Prerequisites

You need to be on Enonic XP 7.9.2 or higher.

Installation

Install the app via Enonic market in the applications tool or build it yourself.

Building

git clone https://github.com/seeds/text-translation-manager-xp.git
cd text-translation-manager-xp
./gradlew clean build

The application jar should be in /build/libs as translationmanager-x.x.x.jar

How to use

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

Implementation

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.

Releases and Compatibility

Version XP version
1.0.0 7.9.2

License and credits

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

Thanks

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!

This app utilizes the following open source libraries:

About

Text Translation Manager for Enonic XP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •