summaryrefslogtreecommitdiff
path: root/sysui/desktop/macosx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-04-18 05:41:38 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-04-18 05:41:38 +0000
commitdeafeca9883e3e4d8f3acd0de3a377d743a5c057 (patch)
tree552b9d9f21e1a5c62e9d21d3084ad4dee1623b60 /sysui/desktop/macosx
parentba18c525ea9139a640e934da366de6cf36629e8d (diff)
#i88405# Fallback to en-US.
Diffstat (limited to 'sysui/desktop/macosx')
-rw-r--r--sysui/desktop/macosx/gen_strings.pl57
1 files changed, 33 insertions, 24 deletions
diff --git a/sysui/desktop/macosx/gen_strings.pl b/sysui/desktop/macosx/gen_strings.pl
index 785162c3e82c..6cc3609fb55a 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);
+}