TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Team Ada: Ada Programming Language Advocacy" <[log in to unmask]>
Sat, 27 Nov 2010 20:13:52 -0800
"Team Ada: Ada Programming Language Advocacy" <[log in to unmask]>
text/plain; charset=UTF-8
text/plain (105 lines)
Hi Folks,

I posted this to comp.lang.ada recent and assume most people on this list
check that group, just in case not, here the announcement.

This is the first release of the ZanyBlue Ada packages.  This release
includes the Text package which support localization of Ada applications
with Java style message formatting and .properties files.  The
released files are available at<>

There are two downloadable files:

1) The core release files: zanyblue-0.1.0b-r1663.tar.gz
2) Support files for testing (AUnit) and regneration of the built-in
localizations (CLDR) zanyblue-0.1.0b-r1663-libs3rd.tar.gz

The primary dev environment is Unix but has been tested on Windows.

Take care,

The readme is:

The ZanyBlue.Text Package

ZanyBlue.Text is an Ada 2005 package supporting localization support in Ada
by allowing the externalization of application messages into a properties
file which can be localized into additional languages, similar to Java. The
localized files include the locale string in the file name, e.g.,
the file "" is localized to ""
in French.

The locale string is

* A language abbreviation (2 or 3 alpha-numeric characters), e.g., "en" for
  English, "zh" for Chinese, "cop" for Coptic, etc.
* A script abbreviation (4 alpha-numeric characters), e.g., "Latn" for
Latin, "Hant" for Traditional Han, "Hebr" for Hebrew, etc.
* A territory abbreviation (2 or 3 alpha-numeric characters), e.g., "US" for

  US, "CN" for China, "142" for Asia, etc.

All components are optional, giving locale strings "" for the base locale,
"en" for English, "zh_Hant" for Traditional Chinese, "zh_TW" for Chinese in
Taiwan (also Traditional Chinese), and "zh_Hant_TW".

The externalized .properties files are compiled to an Ada 2005 package
containing the application strings (including localized strings) to be
compiled into an application.  The selection of locale by
ZanyBlue.Text is based on a locale argument which defaults to the locale
string value of the environment variable "ZB_LANG", or, if it's not defined,
"LANG". This allows applications to automatically switch the display
language (provided the application was localized into the selected locale).
E.g., the example application "moons" defaults to displaying English but can
be changed to using German, French or Spanish, e.g.,  to display is German:

    $ export ZB_LANG=de
    $ moons

The externalization of messages into a .properties files allows the
embedding of parameters references via index (also similar to Java), e.g.,
the message to print the value of a number, the message could be defined as

    00001=The value of the counter is {0} ticks.

The ZanyBlue.Text package supports the "passing" of argument values by
"boxing" the values into ZanyBlue.Text objects.  This particular message
could be printed, with an argument of 1904 as,

    Print_Line ("myapp", "00001", +1904);

The unitary "+" operator is overloaded by the ZanyBlue.Text package to
create the "boxed" object.  See the ZanyBlue documentation for details on
the types supported by the package.


The ZanyBlue packages have been build primarily on Unix systems using a
recent GCC (GCC 4.4) or on Windows using GNAT GPL 2010.

The build is make based.  To build on Unix:

   $ cd src
   $ make

To run the ZanyBlue tests for the Text package, use the "check" build
target.  The ZanyBlue tests use AdaCore's AUnit testing environment (also
included in the src/libs3rd directory with the lib3rd download), which is
compiled as part of the test application build, i.e.,

    $ make check

All the examples, except the "gtk" example, do not require additional
packages beyond the ZanyBlue library.  The "gtk" example requires the GtkAda
package from AdaCore.

For additional information contact Michael Rohan
<[log in to unmask]>