The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Locale::TextDomain::OO::Singleton::Lexicon - Provides singleton lexicon access

$Id: Lexicon.pm 617 2015-08-22 05:39:27Z steffenw $

$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Singleton/Lexicon.pm $

VERSION

1.026

DESCRIPTION

This module provides the singleton lexicon access for Locale::TextDomain:OO.

SYNOPSIS

    use Locale::TextDomain::OO::Singleton::Lexicon;

    $lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;

SUBROUTINES/METHODS

method new

exists but makes no sense

method instance

see SYNOPSIS

exists but makes no sense

method data

Get back the lexicon hash reference to fill the lexicon or to read from lexicon.

    $lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;

method merge_lexicon

Merge ist mostly used to join data of a language to create data for a region with some region different data.

    $instance->merge_lexicon('de::', 'de-at::', 'de-at::');

method move_lexicon

Move is typical used to move the "i-default::" lexicon into your domain and category. With that lexicon without messages you are able to translate because the header with plural forms is set. With no lexicon you would get a missing "plural forms"-error during translation.

    $deleted_lexicon = $instance->move_lexicon(
        'i-default::',
        'i-default:LC_MESSAGES:domain',
    );

method delete_lexicon

Delete a lexicon from data.

    $deleted_lexicon = $instance->delete_lexicon('de::');

EXAMPLE

Inside of this distribution is a directory named example. Run this *.pl files.

DIAGNOSTICS

confess

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

Carp

Moo

MooX::StrictConstructor

namespace::autoclean

MooX::Singleton

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

none

SEE ALSO

Locale::TextDoamin::OO

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2013 - 2015, Steffen Winkler <steffenw at cpan.org>. All rights reserved.

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