From ae3444104b5e0266d8084fad6bd48707ba4a1e15 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Fri, 24 Apr 2015 11:39:21 +0200 Subject: Added the availability to use --locales-dir --- lib/ManaTools/Shared/TimeZone.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lib/ManaTools/Shared/TimeZone.pm') diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm index 936515bb..a380a69a 100644 --- a/lib/ManaTools/Shared/TimeZone.pm +++ b/lib/ManaTools/Shared/TimeZone.pm @@ -345,12 +345,21 @@ has 'loc' => ( sub _localeInitialize { my $self = shift; - # TODO fix domain binding for translation - $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX') ); - # TODO if we want to give the opportunity to test locally add dir_name => 'path' + my $cmdline = new yui::YCommandLine; + my $locale_dir = undef; + my $pos = $cmdline->find("--locales-dir"); + if ($pos > 0) + { + $locale_dir = $cmdline->arg($pos+1); + } + $self->loc( + ManaTools::Shared::Locales->new( + domain_name => 'manatools', + dir_name => $locale_dir, + ) + ); } - has 'ntp_servers' => ( traits => ['Hash'], is => 'rw', -- cgit v1.2.1