[Libreoffice-commits] .: Branch 'feature/killsdf' - 2 commits - l10ntools/Package_scripts.mk l10ntools/scripts l10ntools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 8 10:41:26 PDT 2012
l10ntools/Package_scripts.mk | 2
l10ntools/scripts/propex | 68 -------------------------------
l10ntools/scripts/propmerge | 88 -----------------------------------------
l10ntools/source/propmerge.cxx | 8 +--
4 files changed, 4 insertions(+), 162 deletions(-)
New commits:
commit 297531a3b3aa531ebb6d32761680b308d8fa3f9e
Author: Andras Timar <atimar at suse.com>
Date: Mon Oct 8 19:37:57 2012 +0200
remove propex/propmerge Perl scrips
Change-Id: Iab39da2643ba38c4745c29277c10bc39a024ffa3
diff --git a/l10ntools/Package_scripts.mk b/l10ntools/Package_scripts.mk
index e97ec6c..d00d283 100644
--- a/l10ntools/Package_scripts.mk
+++ b/l10ntools/Package_scripts.mk
@@ -30,7 +30,5 @@ $(eval $(call gb_Package_add_file,l10ntools_scripts,bin/addkeyid2pot.pl,addkeyid
$(eval $(call gb_Package_add_file,l10ntools_scripts,bin/fast_merge.pl,fast_merge.pl))
$(eval $(call gb_Package_add_file,l10ntools_scripts,bin/keyidGen.pl,keyidGen.pl))
$(eval $(call gb_Package_add_file,l10ntools_scripts,bin/po2lo,po2lo))
-$(eval $(call gb_Package_add_file,l10ntools_scripts,bin/propmerge,propmerge))
-
# vim: set noet sw=4 ts=4:
diff --git a/l10ntools/scripts/propex b/l10ntools/scripts/propex
deleted file mode 100755
index 35dcb25..0000000
--- a/l10ntools/scripts/propex
+++ /dev/null
@@ -1,68 +0,0 @@
-:
-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 <atimar at 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.
-#
-# extracts strings from Java properties files
-#
-
-use strict;
-use File::Basename;
-use Getopt::Std;
-use Cwd;
-
-my %options=();
-getopts("ep:r:i:o:l:", \%options);
-
-unless ( $options{i} =~ m/en_US/ ) {exit 0;}
-
-$options{i} =~ s|\\|/|g; # fix path on Windows, Perl expects / separator
-my ($unused1, $dir, $unused2) = File::Basename::fileparse($options{i});
-my $file = substr ( Cwd::abs_path($options{i}), length(Cwd::abs_path($dir . $options{r})) + 1 );
-$file =~ s|/|\\|g;
-
-open (INFILE, "<$options{i}") || die "propex: cannot open input file: $options{i}";
-open (OUTFILE, ">$options{o}") || die "propex: cannot open output file: $options{o}";
-
-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
- print OUTFILE "$options{p}\t$file\t0\tproperty\t$id\t\t\t\t0\ten-US\t$value\t\t\t\t20020202 02:02:02\n";
- }
-}
-
-close (INFILE);
-close (OUTFILE);
-
-exit 0;
diff --git a/l10ntools/scripts/propmerge b/l10ntools/scripts/propmerge
deleted file mode 100755
index 5ba420d..0000000
--- a/l10ntools/scripts/propmerge
+++ /dev/null
@@ -1,88 +0,0 @@
-:
-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 <atimar at 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 gid lid 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};
- $lang =~ s/-/_/;
- $locfilename =~ s/en_US\.properties/$lang.properties/;
- $lang =~ s/_/-/;
- 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;
commit 6134c08251ab0da568fc644e030e5af2d6a26a87
Author: Andras Timar <atimar at suse.com>
Date: Mon Oct 8 19:36:55 2012 +0200
typos
Change-Id: Idb23b390af270bdd694ecce9ab14f47d25af8f57
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index 237444f..0826168 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -71,7 +71,7 @@ namespace
return sResult;
}
- //Escape unicode charachters
+ //Escape unicode characters
void lcl_PrintJavaStyle( const OString& rText, std::ofstream &rOfstream )
{
const OUString sTemp =
@@ -94,7 +94,7 @@ namespace
}
}
-//Open sourcefile and store it's lines
+//Open source file and store its lines
PropParser::PropParser(
const OString& rInputFile, const OString& rLang,
const bool bMergeMode )
@@ -122,7 +122,7 @@ PropParser::PropParser(
else
{
std::cerr
- << "Propex error: Cannot open sourcefile: "
+ << "Propex error: Cannot open source file: "
<< m_sSource.getStr() << std::endl;
return;
}
@@ -175,7 +175,7 @@ void PropParser::Merge( const OString &rSDFFile, const OString &rDestinationFile
rDestinationFile.getStr(), std::ios_base::out | std::ios_base::trunc );
if( !aDestination.is_open() ) {
std::cerr
- << "Propex error: Cannot open sourcefile for merge: "
+ << "Propex error: Cannot open source file for merge: "
<< rDestinationFile.getStr() << std::endl;
return;
}
More information about the Libreoffice-commits
mailing list