$Id: JoinSplitLexiconKeys.pm 597 2015-06-29 18:27:08Z steffenw $
$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/Locale-TextDomain-OO-Util/trunk/lib/Locale/TextDomain/OO/Util/JoinSplitLexiconKeys.pm $
3.004
Module to handle the lexicon and message key.
use Locale::TextDomain::OO::Util::JoinSplitLexiconKeys; my $keys_util = Locale::TextDomain::OO::Util::JoinSplitLexiconKeys->instance;
see SYNOPSIS
$lexicon_key = $keys_util->join_lexicon_key({ category => 'LC_MESSAGES', # default q{} domain => 'TextDomain', # default q{} language => 'de-de', # default 'i-default' = developer English # mostly not needed project => 'myProject', # default not exists });
This method is the reverse implementation of method join_lexicon_key.
$hash_ref = $keys_util->split_lexicon_key($lexicon_key);
$message_key = $keys_util->join_message_key({ msgctxt => 'my context', msgid => 'simple text or singular', msgid_plural => 'plural', });
JSON format
$message_key = $keys_util->join_message_key( { msgctxt => 'my context', msgid => 'simple text or singular', msgid_plural => 'plural', }, 'JSON', );
This method is the reverse implementation of method join_message_key.
$hash_ref = $keys_util->split_message_key($message_key);
$hash_ref = $keys_util->split_message_key($message_key, 'JSON');
This method puts all data into the message_ref
$message_ref = $keys_util->join_message( $message_key, # joined msgctxt, msgid, msgid_plural $message_value_ref, # all other as hash reference );
$message_ref = $keys_util->join_message( $message_key, # joined msgctxt, msgid, msgid_plural $message_value_ref, # all other as hash reference 'JSON', );
This method splits the message reference into a message key and the rest
( $message_key, $message_value_ref ) = $keys_util->split_message($message_ref);
( $message_key, $message_value_ref ) = $keys_util->split_message($message_ref, 'JSON');
Inside of this distribution is a directory named example. Run this *.pl files.
none
Locale::TextDomain::OO::Util::Constants
namespace::autoclean
not known
Locale::TextDoamin::OO
Steffen Winkler
Copyright (c) 2014 - 2015, Steffen Winkler <steffenw at cpan.org>. All rights reserved.
<steffenw at cpan.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Locale::TextDomain::OO::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::TextDomain::OO::Util
CPAN shell
perl -MCPAN -e shell install Locale::TextDomain::OO::Util
For more information on module installation, please visit the detailed CPAN module installation guide.