Hello all,

I'm writing a module that I dubbed "Text::Locale" for now. I am
thinking about publishing it on CPAN.

It roughly goes something like this:

use Text::Locale

# I'm using UUIDs as keys for my strings, but
#   you can choose whatever method you like
#   for identifying your strings
use Data::UUID;
my $ug = new Data::UUID;
my $uuid = $ug->create_str();

my $t = Text::Locale->new();

$t->locale("en_us"); # sets the locale to English US
$t->put($uuid,"sample text in English");
$t->locale("nl"); # sets the locale to Dutch
$t->put($uuid,"voorbeeldtext in het Nederlands");

print $t->get($uuid); # prints "voorbeeldtext in het Nederlands"
print $t->get($uuid, "en_us"); # prints "sample text in English"
print $t->get($uuid, "nl"); # prints "voorbeeldtext in het Nederlands"

$t->del($uuid, "en"); # deletes en version of $uuid string


Now, I am writing to the list to ask about the namespace. Is it ok if
I name it Text::Locale or would it be more appropriate to name it
something else?

Your input is much appreciated.

Best,
Chris.
--
Chris Vertonghen
chrisv (at) cpan (dot) org

Reply via email to