note_enojes

ResourceBundle properties and list classes from eno-locale json message catalog.

License

License

Categories

Categories

ORM Data
GroupId

GroupId

ws.nzen.format.eno
ArtifactId

ArtifactId

note_enojes
Last Version

Last Version

2.0
Release Date

Release Date

Type

Type

jar
Description

Description

note_enojes
ResourceBundle properties and list classes from eno-locale json message catalog.
Project URL

Project URL

https://github.com/Nzen/note_enojes
Source Code Management

Source Code Management

https://github.com/Nzen/note_enojes

Download note_enojes

How to add to project

<!-- https://jarcasting.com/artifacts/ws.nzen.format.eno/note_enojes/ -->
<dependency>
    <groupId>ws.nzen.format.eno</groupId>
    <artifactId>note_enojes</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/ws.nzen.format.eno/note_enojes/
implementation 'ws.nzen.format.eno:note_enojes:2.0'
// https://jarcasting.com/artifacts/ws.nzen.format.eno/note_enojes/
implementation ("ws.nzen.format.eno:note_enojes:2.0")
'ws.nzen.format.eno:note_enojes:jar:2.0'
<dependency org="ws.nzen.format.eno" name="note_enojes" rev="2.0">
  <artifact name="note_enojes" type="jar" />
</dependency>
@Grapes(
@Grab(group='ws.nzen.format.eno', module='note_enojes', version='2.0')
)
libraryDependencies += "ws.nzen.format.eno" % "note_enojes" % "2.0"
[ws.nzen.format.eno/note_enojes "2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
commons-cli : commons-cli jar 1.4
com.alibaba : fastjson jar 1.2.51

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar 5.3.2
org.junit.jupiter : junit-jupiter-api jar 5.3.2

Project Modules

There are no modules declared in this project.

Note Enojes

Note Enojes is a library to convert eno lang locale files to property or List- ResourceBundle files ready for use with java’s MessageFormatter. Uses Java v8 syntax and inncludes a Java v9 module descriptor via the multi-release jar mechanism.

Eno is a document / data structure specification. Its authors provide a tool for creating localization files for the programming languages they are familiar with. As it is written in node.js and this author is not familiar with doing so, this tool consumes the same input files to produce java combatible output, for use with ResourceBundle.

"Note Enojes" is a misspellt spanish phrase telling (informal)you not to get angry. I chose it partly as reference to the Enohar library, and because note is "some text" in english, which is relevant for translation. I said it to myself a couple of times, while implementing this.

© Nicholas Prado. Begun 2018. Released under MIT license terms.

Usage

Note enojes directly relies on Enohar and mini2Dx’s gettext libraries.

At runtime, it also expects some localization files for its own output. These exist in src/main/resources.

Note_enojes offers a cli interface. It assumes a user will prepare session arguments in a properties file. One can point to the file by providing the "-c" argument, followed by a filepath, ex -c "config/f.properties". Here follows an example properties body:

input_path = etc/messages.json

output_directory = usr

separate_by_category = true

resource_bundle_style = properties

output_into_package = true

java_package = org.eno_lang.locale

replace_variables = true

list_template_file = src/main/resources/template_lrb_class_upper.txt
  • input_path is a path to find the messages prepared by eno-locale; appends messages.json if provided a folder rather than a file

  • output_directory is a path to emit the resulting files to; falls back to input if output is invalid

  • separate\_by_category whether to create a file per group or one per language

  • resource\_bundle_style {list , properties} the style of file to emit: a properties file or a ListResourceBundle

  • output_into\_package whether the resulting files should be in subfolders from output corresponding to \_package_

  • java_package is a java package one may want to copy the files to; if bundle style is list, the classes will use this package

  • replace_variables indicates to replace variables like [MAXIMUM] with an escape string for MessageFormat output, ex {1,number}

  • list\_template\_file The location of a template file for starting ListResourceBundle classes

Maven pom dependence declaration

		<dependency>
			<groupId>
				ws.nzen.format.eno
			</groupId>
			<artifactId>
				note_enojes
			</artifactId>
			<version>
				2.0
			</version>
		</dependency>

Gradle dependence declaration

	'ws.nzen.format.eno:note_enojes:2.0'

Versions

Note Enojes publishes changes using a compatibility versioning scheme.

  • 1.0 - Produces list and property resource bundle files.

  • 1.1 - Produces an optional alias file.

  • 2.0 - Uses messages.json rather than separate gettext files.

Versions

Version
2.0