Locale-TextDomain-OO folder example
===================================

This is the explanation which file shows what.

------------------------------------------------------------------------------
If you run and read this examples realize, that some modules are only written
to be compatible. If you port some big old applications it is easy to change
step by step. After every step you have a running application.

Module Locale::TextDomain::OO::Maketext implements the compatibility to
maketext. You have a maketext method too.

Module Locale::TextDomain::OO::FunctionalInterface was written because
module Locale::TextDomain has a functional interface. Use this module only if
your application must have a functional interface.

Module Locale::TextDomain::OO::MessagesStruct was written because some
applications have not stored the internationalization data in mo files.
------------------------------------------------------------------------------

01_locale_textdomian_utf-8.pl
    This example does not use module Locale::Text-Domain::OO. It shows, how to
    use Unicode, the internal representation as chars. Module Locale::Messages
    and Locale::TextDomain only transport UTF-8 bytes, not Unicode chars. All
    this recodes running like subroutine from_to (Encode).
    The filter (output filter) allows to change the output of module
    Locale::Messages using subroutine decode_utf8 (Encode). But there is no
    input filter if the msgstr, msgstr_plural or msgctxt contains Unicode
    chars like paragraph or the british currency sign. English is not ASCII.
    For this reason I wrapped the subroutine encode_utf8 (Encode) around. But
    this is extremly bad and not useful. See bug report:
        http://rt.cpan.org/Public/Bug/Display.html?id=49758
    This example uses the Russian UTF-8 mo file.

21_gettext_mo.pl
    This example shows, how to use the module Locale::Text-Domain::OO.
    Unicode is not used. Then a char is equal to a byte.
    This example uses the German ISO-8859-1 example.mo file.
    Why I write
        local $ENV{LANGUAGE} = Locale::TextDomain::OO->get_default_language_detect()->('de_DE');
    and not
        local $ENV{LANGUAGE} = 'de_DE';
    This is only to detect the language using module I18N::LangTags including
    super and panic languages and not to use the Locale::Messages defaults.
    The subroutine bind_object of module
    Locale::TextDomain::OO::FunctionalInterface is only to have a functional
    interface like module Locale::TextDomain.
    The you call
        __(...)
    and not
        $loc->__(...)
    and the same for
        __x(...)
    and so on.
    If it makes no sense, use the object directly and do not bind.

22_gettext_struct_from_locale_po.pl
    This example shows, how to use module Locale::TextDomain::OO::MessagesStruct
    to use data which are not from mo files (here po files).
    Unicode is not used. Then a char is equal to a byte.
    This example uses the German ISO-8859-1 example.po file.
    New in this example is
        $file_path = $loc->get_file_path($text_domain, '.po');
    This is to find the po file of the langauge and text domain.
    Also new is
        $code_ref = $loc->get_function_ref_plural($plural_forms);
    In the header of every po or mo file is a formula ($plural_forms).
    This code runs this formula.

23_gettext_struct_from_dbd_po.pl
    This example is similar to the example before. The difference is, that
    DBD::PO is a SQL database interface for po files. The performance is lower
    than the example before. But the example shows, how to use DBI, not more.
    So you can see, how to bind any database interface as data source.
    Unicode is not used. Then a char is equal to a byte.
    This example uses the German ISO-8859-1 example.po file.

24_maketext_mo.pl
    This example shows, how to use module Locale::TextDomain::Maketext
    to use mo files with maketext placeholders. This is useful if you want to
    port from Locale::Maketext to Locale::TextDomain. This allows placeholders
    like Locale::Maketext:
        [_1], [quant,_1,...], [*,_1,...]
    and the placeholders of Locale::TextDomain too.
    Unicode is not used. Then a char is equal to a byte.
    This example uses the German ISO-8859-1 example_maketext.po file.

25_maketext_mo_style_gettext.pl
    This example is similar to the example before. The placeholders are
    switched to gettext style:
        %1, %quant(%1,...), %*(%1,...)
    Unicode is not used. Then a char is equal to a byte.
    This example uses the German ISO-8859-1 example_maketext_style_getext.po file.

26_gettext_struct_from_locale_po_utf-8.pl
    This example is similar to "22_gettext_struct_from_locale_po.pl".
    Look for the difference between both and realize, what is to do for Unicode.
    This example uses the Russian UTF-8 example.po file.

27_gettext_struct_from_dbd_po_utf-8.pl
    This example is similar to "23_gettext_struct_from_dbd_po.pl".
    Look for the difference between both and realize, what is to do for Unicode.
    This example uses the Russian UTF-8 example.po file.