]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Locale.pm
Upgradescripte für auth.* nur ausführen, wenn Authentifizierungstabellen bereits...
[kivitendo-erp.git] / SL / Locale.pm
index b1c8205e8cd1aaae80b6715e76f11eafb7ded05e..e9967396cfbd29870753688903102fb3725822c8 100644 (file)
@@ -109,6 +109,7 @@ sub _init {
   $self->{iconv_english}    = SL::Iconv->new('ASCII',          $db_charset);
   $self->{iconv_iso8859}    = SL::Iconv->new('ISO-8859-15',    $db_charset);
   $self->{iconv_to_iso8859} = SL::Iconv->new($db_charset,      'ISO-8859-15');
+  $self->{iconv_utf8}       = SL::Iconv->new('UTF-8',          $db_charset);
 
   $self->_read_special_chars_file($country);
 
@@ -231,6 +232,7 @@ sub findsub {
 
   my ($self, $text) = @_;
   my $text_rev      = lc $self->{iconv_reverse}->convert($text);
+  $text_rev         =~ s/[\s\-]+/_/g;
 
   if (!$self->{texts_reverse}) {
     $self->{texts_reverse} = { };
@@ -240,7 +242,7 @@ sub findsub {
       $original    =~ s/_+/_/g;
 
       $translation =  lc $translation;
-      $translation =~ s/\s+/_/g;
+      $translation =~ s/[\s\-]+/_/g;
 
       $self->{texts_reverse}->{$translation} ||= [ ];
       push @{ $self->{texts_reverse}->{$translation} }, $original;