comparison Lib/IMPL/Resources/StringLocaleMap.pm @ 379:a471e8b77544

sync
author cin
date Thu, 16 Jan 2014 18:10:50 +0400
parents 2eed076cb944
children 1eca08048ba9
comparison
equal deleted inserted replaced
378:2eed076cb944 379:a471e8b77544
56 } 56 }
57 57
58 sub LoadMap { 58 sub LoadMap {
59 my ($this,$locale,$default) = @_; 59 my ($this,$locale,$default) = @_;
60 60
61 my @spec = split /_/, $locale;
62
63 my @locales;
64
65 do {
66 push @locales, join('_', @spec);
67 } while(pop @spec);
68
61 my $file = first { -f } map { 69 my $file = first { -f } map {
62 my $name = FS->catfile($_,$locale,$this->name); 70 my $path = $_;
63 ("$name.s", "$name.p"); 71
72 map {
73 my $name = FS->catfile($path,$_,$this->name);
74 ("$name.s", "$name.p");
75 } @locales;
64 } $this->paths; 76 } $this->paths;
65 77
66 if($file) { 78 if($file) {
67 if ($file =~ /\.s$/) { 79 if ($file =~ /\.s$/) {
68 return $this->LoadStringMap($file); 80 return $this->LoadStringMap($file);