How to Simplify App Localization Using Nuiton I18n

Written by

in

Nuiton I18n is a lightweight, open-source Java library designed to simplify the internationalization (i18n) and localization of Java applications. Originally created by the French development group CodeLutin, it enhances Java’s standard ResourceBundle system by pairing it with a streamlined API and build-tool automation. Core Architecture

The framework is split into two primary components to handle both runtime translations and build-time pipeline tasks:

I18n API (nuiton-i18n): The core runtime library containing Java classes used to initialize and fetch localized strings within code.

I18n Maven Plugin (i18n-maven-plugin): A build-automation plugin that automates the heavy lifting of parsing code for translatable keys and maintaining resource bundles. Key Features

Simplified Localization Syntax: Replaces complex Java bundle lookups with direct, readable syntax (e.g., I18n.(“Your text here”)).

Automated Key Extraction: The Maven plugin parses Java source code, GWT (Google Web Toolkit) files, and validation definitions to find strings needing translation.

Bundle Generation: Automates creating, updating, and merging localization .properties files during the application build phase.

CSV Interoperability: Features built-in goals to export translation keys into simple CSV files for external translators, and import them back into localized bundle files.

Flexible Initialization: Supports direct application configuration to specify default bundles and target user locales. Technical Details & Implementation

Nuiton I18n is licensed under the GNU Lesser General Public License (LGPL). It is frequently used alongside other Java frameworks in the Nuiton ecosystem, such as the ToPIA persistence layer and the JAXX user interface framework.

To use it in a project, you initialize the helper class at application startup and call the translation wrapper:

// Initialize the bundle framework I18n.init(new DefaultI18nInitializer(“myBundle”), Locale.FRANCE); // Fetch a translated string System.out.println(I18n.(“This text will be translated”)); Use code with caution.

You can view project updates, dependencies, and configuration templates on the org.nuiton.i18n Maven Repository page.

If you are planning to add this to your project, let me know: What build system you use (Maven, Gradle, or Ant)?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *