Message Compiler

Message Compiler

Released 2 years ago , Last update 9 months ago

The Message Compiler is a programming tool, used to internationalize applications, by compiling a message file, which contains text definitions and documentation in different languages. It produces several output files, like resource files, programming language specific class or header files with constant definitions for the text keys and HTML documentation pages.

Internationalize Your Application

The Message Compiler helps you to internationalize your application in different programming environments. It compiles a message source file, which contains the texts to be localized and documentation in different languages. The texts are identified by a message key. The Message Compiler produces several output files, i.e. resource files containing the localized texts, programming language specific class or header files with constant definitions for the message keys and HTML documentation pages. The message key constants provide a safe way to access the localized text strings in the reource files.

The Message Compiler is required by each professional project implementing an application, which shows any kind of text to a user. Even when your application supports only one language, the Message Compiler is useful, to separate text from your source code. It makes it easy then to add text in additional languages later, without affecting your source code.

See also the detailed documentation of the message compiler for the command line syntax and the syntax of the message source file.

Benefits

  • one source

    Define your localized text strings for the different languages in one message source file. The Message Compiler creates all files, required for your programming environment, from this single source file.
  • safe message access

    The Message Compiler creates key constants used to access the localized strings for different programming languages. Using these constants in your source code is a much safer way than using plain strings.

  • 100% Java

    The Message Compiler is a simple command line tool written in 100% Java. It has no dependencies to other libraries. The only requirement is a JRE with the minimum version 1.5.

  • integrable

    The Message Compiler can easily be integrated in the various IDE's. The bundle contains an ANT script, which can be used to integrate the Message Compiler in popular Java IDE's like Eclipse or JDeveloper.

  • Easy Installation

    The Message Compiler is contained in a ZIP archive, which is just un-zipped into an installation folder.
  • Extensible

    The Message Compiler uses so called output processors to produce the different output files. It can easily extended by implementing another output processor for your needs and placing it into the installation folder.

Features

  • Create Resource files

    The Message Compiler creates language specific resource files, like Java property resource files or string table files for OSX/IOS environments, from the text definitions in the message source file.
  • Create key constants

    The Message Compiler creates constant definitions for the keys, used to access the localized strings in the resource files for different programming environments, like Java, Objective-C and Swift. The constants may be preceded by a comment block, created from the documentation in the message source file.
  • create html documenTation

    The Message Compiler creates language specific documentation in HTML format from the documentation of the texts defined in the message source file. This is especially useful for error messages.
  • categorize messages

    The message texts in the source file may be categorized by the severities SUCCESS, INFORMATION, WARNING,  ERROR and FATAL.
  • syntax checking

    The Message Compiler performs an extensive syntax checking and the error messages contain the line number where the error is located in the message file.  It also checks for duplicate message keys and duplicate language definitions.
  • status codes

    The Message Compiler exits with different status codes, which can be used by the caller to determine if the compilation was successful or which kind of error occurred.

 

Output Processors

The Message Compiler bundle includes the following output processors to create the output files. See also the detailed documentation of the Message Compiler for more information on the output processors.

  • JavaResource - An output processor, which creates a Java property resource file for each language occurring in the message definitions, which can be accessed by the Java class java.util.ResourceBundle.
  • JavaClass - An output processor, which creates a Java class file containing string constants for the message keys. The constants can be used to access the texts in the Java property resource files calling the methods of the class java.util.ResourceBundle.
  • JavaEnum - An output processor, which creates a Java enum file containing enumeration values for the message keys. The values can be used to access the texts in the Java property resource files calling the methods of the class java.util.ResourceBundle.

  • OSXStringTable - An output processor, which creates an OSX string table file for each language occurring in the message definitions. The strings in these files can be accessed calling the method localizedStringForKey:value:table() of the class NSBundle.
  • ObjectiveC - An output processor, which creates an Objective-C header file containing string constants for the message keys. The constants can be used to access the texts in the OSX string table files calling the method localizedStringForKey:value:table() of the class NSBundle.

  • SwiftEnum - An output processor, which creates a Swift enum file containing enumeration values for the message keys. The values can be used to access the texts in the OSX string table files calling the method localizedStringForKey:value:table() of the class NSBundle.

  • HtmlTable - An output processor, which creates a HTML documentation file for each language occurring in the message definitions.

Installation

The Message Compiler is installed by just unzipping the downloaded ZIP archive. Before you unzip the archive, you should create an installation directory for the Message Compiler used as target directory for the unzip command:

unzip MessageCompiler.zip -d <installation-directory>

The installation directory contains now the following sub-directories:

  • documentation - contains the Java documentation of the Message Compiler and the output processors. Open the file index.html with a web browser to read the documentation. This is also the detailed documentation of the Message Compiler.
  • messagecompiler - the main package directory of the Message Compiler containing the class files and the help (readme) files.
  • sample - the directory containing the sample message file t.msf.
  • scripts - the directory containing the general ANT script file MessageCompilerAntScript.xml, which can be used by your project specific ANT scripts to compile message files to create Java class or enum files, Java resource files and HTML documentation files. The ANT script TestAntScript.xml, also contained in this directory, shows how the general message compiler ANT script is invoked to compile the test message file t.msf. The directory further contains the windows batch file MessageCompiler.bat, which invokes the MessageCompiler to compile the test message file t.msf. You may need to adjust the directories in these script files before you can use it.

To check if the installation was successfull and if the Message Compiler works, you may issue the following command:

java -classpath <installation-directory> messagecompiler.

This command shows the help text of the message compiler and all output processors. You may also compile the sample message file t.msf located in the sub-directory sample with the following command:

java -classpath <installation-directory> messagecompiler.MessageCompiler \
<installation-directory>/sample/t.msf \
JavaClass { -className TestStringMessageKeys -dir testOutput } \
JavaEnum { -enumName TestEnumMessageKeys -dir testOutput } \ JavaResource { -fileName testOutput/TestMessages } \
HtmlTable { -fileName testOutput/TestMessages } \
OSXStringTable { -dir testOutput -fileName TestMessages.strings } \
ObjectiveC { -fileName testOutput/TestMessageKeys.h } \
SwiftEnum { -dir testOutput -enumName TestMessageKeys }

This command creates all output files in the sub-directory testOutput. See also the detailed documentation of the Message Compiler for the command line syntax.

Sample Message Definition

A message definition in the message file may look like this:

.MESSAGEKEY=MYAPP_EXC_IO_FILE_NOT_FOUND
.SEVERITY=ERROR
.LANGUAGE=en
.TEXT
The file {0} does not exist
.END
.DOCUMENTATION
The specified file doesn't exist.
.END
.LANGUAGE=de
.TEXT
Die Datei {0} ist nicht vorhanden
.END
.DOCUMENTATION
Die angegebene Datei ist nicht vorhanden.
.END

See also the detailed documentation of the Message Compiler for the syntax of the message source file.

Pricing

14 day 14-day money-back guarantee

$49.99

Message Compiler, one user license

  • Perpetual license

  • Commercial use

  • 6 months support

$399.99

Message Compiler, 10 user license

  • Perpetual license

  • Commercial use

  • 6 months support

$1,749.99

Message Compiler, 50 user license

  • Perpetual license

  • Commercial use

  • 6 months support

$2,999.99

Message Compiler, 100 user license

  • Perpetual license

  • Commercial use

  • 6 months support

Need custom services for this product? Get a quote
5 licenses, starting from From » $49.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

or Get a quote

for customization or integration services


Or enter your name and Email
No comments have been posted yet.