/msg-simple

A lightweight, UTF-8 capable, printf() capable alternative to Java's ResourceBundle

Primary LanguageJavaOtherNOASSERTION

License LGPLv3 License ASL 2.0 Build Status Maven Central

Read me first

This project, as of version 1.0, is licensed under both LGPLv3 and ASL 2.0. See file LICENSE for more details. Versions 1.0 and lower are licensed under LGPLv3 only.

Note the "L" in "LGPL". LGPL AND GPL ARE QUITE DIFFERENT!

NOTE: this project uses Gradle as a build system. See the BUILD.md file for more details.

What this is

This is a lightweight, extensible message bundle API which you can use as a replacement to Java's ResourceBundle. It is also able to load legacy ResourceBundles.

Among features that this library offers which ResourceBundle doesn't are:

  • UTF-8 support,
  • printf()-like format for messages (in addition to the antique MessageFormat),
  • builtin assertions,
  • error resistant.

See below for more.

Versions

The current version is 1.2. Javadoc here.

See here for sample API usage.

Downloads and Maven artifact

Versions before 1.2 are available at groupId com.github.fge.

OBSOLETE You can download the jar directly on Bintray.

For Gradle:

dependencies {
    compile(group: "com.github.java-json-tools", name: "msg-simple", version: "yourVersionHere");
}

For Maven:

<dependency>
    <groupId>com.github.java-json-tools</groupId>
    <artifactId>msg-simple</artifactId>
    <version>your-version-here</version>
</dependency>

Features and roadmap

This library currently has the following features:

  • static or load-on-demand message sources, with configurable expiry;
  • property files read using UTF-8, ISO-8859-1 or any other encoding of your choice;
  • printf()-like message support in addition to MessageFormat support;
  • i18n/locale support;
  • stackable message sources;
  • builtin preconditions in bundles (checkNotNull(), checkArgument(), plus their printf()/MessageFormat equivalents);

The roadmap for future versions can be found here. Feature requests are of course welcome!