diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-04-18 05:41:38 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-04-18 05:41:38 +0000 |
commit | 9e0781348a7af5926c84ab8cd4411b9b500ded2f (patch) | |
tree | 28429332fe8a31dcc2b47b066b23e47c3895c96d /sysui/desktop/macosx | |
parent | d5499a5e347993a1aa85bd52d0fb2d408c37954b (diff) |
#i88405# Fallback to en-US.
Diffstat (limited to 'sysui/desktop/macosx')
-rw-r--r-- | sysui/desktop/macosx/gen_strings.pl | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/sysui/desktop/macosx/gen_strings.pl b/sysui/desktop/macosx/gen_strings.pl index 80c73f2cf7..ed85d3e746 100644 --- a/sysui/desktop/macosx/gen_strings.pl +++ b/sysui/desktop/macosx/gen_strings.pl @@ -12,7 +12,7 @@ eval 'exec perl -wS $0 ${1+"$@"}' # # $RCSfile: gen_strings.pl,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # # This file is part of OpenOffice.org. # @@ -38,7 +38,7 @@ use strict 'vars'; my $my_lang = 'en-US'; my $plist = 'Info.plist'; -my $outfile; +my $lines = 0; while ($_ = $ARGV[0], /^-/) { shift; @@ -81,31 +81,40 @@ while (<SOURCE>) { close (SOURCE); -# open input file (Info.plist) -unless (open(SOURCE, $ARGV[0])) { - print STDERR "Can't open $ARGV[0] file: $!\n"; - return; -} +print_lang($my_lang); +print_lang('en-US') unless $lines > 0; -my $last_section; +sub print_lang +{ + my ($this_lang) = @_; -while (<SOURCE>) { + # open input file (documents.ulf) + unless (open(SOURCE, $ARGV[0])) { + print STDERR "Can't open $ARGV[0] file: $!\n"; + return; + } + + my $last_section; - if ( /\[(.*)\]/ ) { - $last_section = $1; - } else { - # split locale = "value" into 2 strings - my ($lang, $value) = split ' = '; - - if ( $lang ne $_ && $lang eq $my_lang && exists $documents{$last_section} ) { - # replacing product variable doesn't work inside zip files and also not for UTF-16 - next if /%PRODUCTNAME/; -# s/%PRODUCTNAME/\${FILEFORMATNAME} \${FILEFORMATVERSION}/g; - s/$lang/"$documents{$last_section}"/; - s/\n/;\n/; - print; + while (<SOURCE>) { + + if ( /\[(.*)\]/ ) { + $last_section = $1; + } else { + # split locale = "value" into 2 strings + my ($lang, $value) = split ' = '; + + if ( $lang ne $_ && $lang eq $this_lang && exists $documents{$last_section} ) { + # replacing product variable doesn't work inside zip files and also not for UTF-16 + next if /%PRODUCTNAME/; +# s/%PRODUCTNAME/\${FILEFORMATNAME} \${FILEFORMATVERSION}/g; + s/$lang/"$documents{$last_section}"/; + s/\n/;\n/; + print; + $lines += 1; + } } } -} -close (SOURCE); + close (SOURCE); +} |