NAME

Text::MessageFormat - Language neutral way to display messages

SYNOPSIS

use Text::MessageFormat;

my $form = Text::MessageFormat->new('The disk "{1}" contains {0} file(s).');
print $form->format(3, 'MyDisk');

# output: The disk "MyDisk" contains 3 file(s).

DESCRIPTION

Text::MessageFormat is a Perl version of Java's java.text.MessageFormat and aims to be format-compatible with that class.

MesageFormat provides a means to produce concatenated messages in language-neutral way. Use this to construct messages displayed for end users.

See Data::Properties for java.util.Properties porting.

WARNINGS/TODO

  • Following FormatElements are all NOT implemented yet. Currently they interpolate exactly same as just {0}.

    {0,number,#.##}
    {0,date,short}
    {0,time,hh:mm:ss}
    {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}

    Patches are always welcome!

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

http://java.sun.com/j2se/1.4/docs/api/java/text/MessageFormat.html Data::Properties