[Libreoffice-commits] .: l10ntools/prj l10ntools/scripts

2011-12-18 Thread Andras Timar
 l10ntools/prj/d.lst  |1 +
 l10ntools/scripts/propex.bat |8 
 2 files changed, 9 insertions(+)

New commits:
commit d4b573ec4ccedc6522fed32eb91aede9f5f37da5
Author: Andras Timar ati...@suse.com
Date:   Mon Dec 19 00:16:20 2011 +0100

add propex.bat, so propex Perl script can run under Win32

diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst
index ee088ff..95675a7 100644
--- a/l10ntools/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -39,6 +39,7 @@ mkdir: %_DEST%\bin\help\com\sun\star\help
 ..\scripts\addkeyid2pot.pl %_DEST%\bin\addkeyid2pot.pl
 ..\scripts\po2lo %_DEST%\bin\po2lo
 ..\scripts\propex %_DEST%\bin\propex
+..\scripts\propex.bat %_DEST%\bin\propex.bat
 ..\scripts\propmerge %_DEST%\bin\propmerge
 ..\inc\export.hxx %_DEST%\inc\l10ntools\export.hxx
 ..\inc\l10ntools\directory.hxx %_DEST%\inc\l10ntools\directory.hxx
diff --git a/l10ntools/scripts/propex.bat b/l10ntools/scripts/propex.bat
new file mode 100755
index 000..1174286
--- /dev/null
+++ b/l10ntools/scripts/propex.bat
@@ -0,0 +1,8 @@
+@echo off
+
+if x%PERL%x EQU xx (
+echo ERROR: Perl not found. Environment is not set.
+exit /b 1
+)
+
+%PERL% %SOLARVER%\%INPATH%\bin\propex %*
\ No newline at end of file
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: l10ntools/prj l10ntools/scripts

2011-12-15 Thread Andras Timar
 l10ntools/prj/d.lst |1 
 l10ntools/scripts/propex|2 +
 l10ntools/scripts/propmerge |   86 
 3 files changed, 89 insertions(+)

New commits:
commit ec4f2f1d81884a1b4ddc1e1f9981636c5e443aab
Author: Andras Timar ati...@suse.com
Date:   Thu Dec 15 14:02:57 2011 +0100

propmerge tool to merge strings back to localized .properties files

diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst
index 0d39719..ee088ff 100644
--- a/l10ntools/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -39,6 +39,7 @@ mkdir: %_DEST%\bin\help\com\sun\star\help
 ..\scripts\addkeyid2pot.pl %_DEST%\bin\addkeyid2pot.pl
 ..\scripts\po2lo %_DEST%\bin\po2lo
 ..\scripts\propex %_DEST%\bin\propex
+..\scripts\propmerge %_DEST%\bin\propmerge
 ..\inc\export.hxx %_DEST%\inc\l10ntools\export.hxx
 ..\inc\l10ntools\directory.hxx %_DEST%\inc\l10ntools\directory.hxx
 ..\inc\l10ntools\file.hxx %_DEST%\inc\l10ntools\file.hxx
diff --git a/l10ntools/scripts/propex b/l10ntools/scripts/propex
index e7ee7e9..ba7a49d 100755
--- a/l10ntools/scripts/propex
+++ b/l10ntools/scripts/propex
@@ -50,6 +50,8 @@ while (INFILE) {
 chomp;
 if (/=/) {
 my ($id, $value) = split /=/;
+$id=~ s/^\s+//; #remove leading spaces
+$id=~ s/\s+$//; #remove trailing spaces
 $value =~ s/^\s+//; #remove leading spaces
 $value =~ s/\s+$//; #remove trailing spaces
 $value =~ s/(\\u([0-9a-fA-F]{4}))/pack(C0U1,hex($2))/ge; #convert 
ascii escaped unicode to utf-8
diff --git a/l10ntools/scripts/propmerge b/l10ntools/scripts/propmerge
new file mode 100755
index 000..1e0e8a7
--- /dev/null
+++ b/l10ntools/scripts/propmerge
@@ -0,0 +1,86 @@
+:
+eval 'exec perl -S $0 ${1+$@}'
+if 0;
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#   Andras Timar ati...@suse.com
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+# merges strings from SDF file to properties files
+#
+
+use strict;
+use Getopt::Std;
+
+my %options=();
+getopts(i:m:, \%options);
+
+my %translations = ();
+my %languages = ();
+ #(  leftpart  
   )( rightpart 
  )
+ #   prj  file dummy type  gidlid  
  helpid   pform width lang  text helptext  qhelptext  title
+my $sdf_regex  = 
((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t])*\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)));
+
+open (SDFFILE, $options{m}) || die propmerge: cannot open sdf file: 
$options{m};
+
+while (SDFFILE) {
+chomp;
+if( /$sdf_regex/ ) {
+   my $gid  = defined $7 ? $7 : '';
+   my $lang = defined $12 ? $12 : '';
+   my $text = defined $14 ? $14 : '';
+   my $key  = $lang . $gid;  
+$languages{$lang} = 1;
+   utf8::decode($text);
+   $text =~ s/([^\x{20}-\x{7E}])/sprintf(\\u%04X,ord($1))/ge;
+   $translations{$key} = $text;
+}
+}
+
+close (SDFFILE);
+
+foreach my $lang (keys %languages) {
+my $locfilename = $options{i};
+$locfilename =~ s/en_US\.properties/$lang.properties/;
+open (INFILE, $options{i}) || die propmerge: cannot open source file: 
$options{i};
+open (OUTFILE, $locfilename) || die propmerge: cannot open output 
file: $locfilename;
+while (INFILE) {
+if (/=/) {
+   chomp;
+my ($id, $value) = split /=/;
+$id =~ s/^\s+//; #remove leading spaces
+$id =~ s/\s+$//; #remove trailing spaces
+   my $key = $lang . $id;
+print OUTFILE $id=$translations{$key}\n;
+   }
+   else {
+   print OUTFILE $_;
+   }
+}
+close (INFILE);
+close (OUTFILE);
+}
+
+exit 0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org

[Libreoffice-commits] .: l10ntools/prj l10ntools/scripts solenv/bin

2011-09-20 Thread Andras Timar
 l10ntools/prj/d.lst   |1 
 l10ntools/scripts/localize.pl |  892 ++
 solenv/bin/localize   |8 
 solenv/bin/localize_sl|   13 
 4 files changed, 909 insertions(+), 5 deletions(-)

New commits:
commit 2f2d542830be90d308329c854e1ebb61e85c1d43
Author: Andras Timar ati...@suse.com
Date:   Tue Sep 20 17:20:29 2011 +0200

Revert localize.pl is not necessary - breaks on Windows

This reverts commit fbb48a21a8c2f4ba00f96544fafc8eb8e908aa10.

diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst
index be38c93..bcbe252 100644
--- a/l10ntools/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -36,6 +36,7 @@ mkdir: %_DEST%\bin\help\com\sun\star\help
 ..\%__SRC%\bin\HelpLinker.exe %_DEST%\bin\HelpLinker.exe
 ..\%__SRC%\bin\HelpLinker* %_DEST%\bin
 
+..\scripts\localize.pl %_DEST%\bin\localize.pl
 ..\scripts\localize %_DEST%\bin\localize
 ..\scripts\fast_merge.pl %_DEST%\bin\fast_merge.pl
 ..\scripts\keyidGen.pl %_DEST%\bin\keyidGen.pl
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
new file mode 100755
index 000..82e7793
--- /dev/null
+++ b/l10ntools/scripts/localize.pl
@@ -0,0 +1,892 @@
+:
+eval 'exec perl -wS $0 ${1+$@}'
+if 0;
+
+
+#*
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# http://www.openoffice.org/license.html
+# for a copy of the LGPLv3 License.
+#
+#*
+
+use strict;
+use Getopt::Long;
+use IO::Handle;
+use File::Find;
+use File::Temp;
+use File::Path;
+use File::Copy;
+use File::Glob qw(:glob csh_glob);
+use Cwd;
+
+my $CVS_BINARY = /usr/bin/cvs;
+# ver 1.1
+#
+ module lookup
+#use lib ($ENV{SOLARENV}/bin/modules, $ENV{COMMON_ENV_TOOLS}/modules);
+
+ module lookup
+# OOo conform
+my @lib_dirs;
+BEGIN {
+if ( !defined($ENV{SOLARENV}) ) {
+die No environment found (environment variable SOLARENV is 
undefined);
+}
+push(@lib_dirs, $ENV{SOLARENV}/bin/modules);
+push(@lib_dirs, $ENV{COMMON_ENV_TOOLS}/modules) if 
defined($ENV{COMMON_ENV_TOOLS});
+}
+use lib (@lib_dirs);
+
+ globals 
+my $sdffile = '';
+my $no_sort = '';
+my $create_dirs = '';
+my $multi_localize_files= '';
+my $module_to_merge = '';
+my $sort_sdf_before = '';
+my $outputfile  = '';
+my $no_gsicheck = '';
+my $mode= '';
+my $bVerbose= 0;
+my $srcpath = '';
+my $languages;
+#my %sl_modules; # Contains all modules where en-US and de is source 
language
+my $use_default_date = '0';
+
+ # (   leftpart
 )(   rightpart 
   )
+ #prj  file  dummy type   gid   lid
  helpidpform width  lang   texthelptext  qhelptext   title 
   timestamp
+my $sdf_regex  = 
((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t)([^\t]*));
+my $file_types = (src|hrc|xcs|xcu|lng|ulf|xrm|xhp|xcd|xgf|xxl|xrb);
+# Always use this date to prevent cvs conflicts
+my $default_date = 2002-02-02 02:02:02;
+my @sdfparticles;
+
+ main 
+parse_options();
+
+my $binpath = '';
+$binpath = $ENV{SOLARVER}./.$ENV{INPATH}./bin/ ;
+
+if   ( $mode eq merge){
+if ( ! $no_gsicheck ){
+merge_gsicheck();
+}
+splitfile( $sdffile );
+if ( ! $no_gsicheck ){
+unlink $sdffile; # remove temp file!
+}
+}
+elsif( $mode eq extract  ){
+collectfiles( $outputfile );
+}
+else{
+usage();
+}
+
+exit(0);
+
+#
+sub splitfile{
+
+my $lastFile= '';
+my $currentFile = '';
+my $cur_sdffile = '';
+my $last_sdffile= '';
+my $delim;
+my $badDelim;
+my $start