summaryrefslogtreecommitdiff
path: root/solenv/bin/desktop-translate.pl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-05-13 13:53:05 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-05-15 09:37:41 +0100
commit99f7690bee0bf787a579e3e28bbd63074000940e (patch)
treecb4d74802d3851ebbf45c6393fe54406e7b3580b /solenv/bin/desktop-translate.pl
parent19276d3ddffdc80f004c8ce518b80f063108935b (diff)
gallery: cleanup makefiles for new gallery naming and translation.
Change-Id: I9ec5192c007df6d0ce15f5e61cb53cf6ea04db08
Diffstat (limited to 'solenv/bin/desktop-translate.pl')
-rw-r--r--solenv/bin/desktop-translate.pl16
1 files changed, 12 insertions, 4 deletions
diff --git a/solenv/bin/desktop-translate.pl b/solenv/bin/desktop-translate.pl
index 245ebaf5f279..21d80ab91a76 100644
--- a/solenv/bin/desktop-translate.pl
+++ b/solenv/bin/desktop-translate.pl
@@ -29,6 +29,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
my ($prefix, $ext, $key);
my $productname = "LibreOffice";
my $workdir = ".";
+my $template_dir;
while ($_ = $ARGV[0], /^-/) {
shift;
@@ -53,6 +54,14 @@ while ($_ = $ARGV[0], /^-/) {
$ext = $ARGV[0];
shift;
}
+ if (/^--template-dir/) {
+ $template_dir = $ARGV[0];
+ shift;
+ }
+}
+
+if (!defined $template_dir) {
+ $template_dir = "$workdir/$prefix";
}
# hack for unity section
@@ -65,8 +74,7 @@ my %templates;
# open input file
unless (open(SOURCE, $ARGV[0])) {
- print STDERR "Can't open $ARGV[0] file: $!\n";
- return;
+ die "Can't open $ARGV[0] file: $!\n";
}
# currently read template
@@ -81,7 +89,7 @@ while (<SOURCE>) {
my %entry;
# For every section in the specified ulf file there should exist
# a template file in $workdir ..
- $entry{'outfile'} = "$workdir/$prefix$template.$ext";
+ $entry{'outfile'} = "$template_dir$template.$ext";
my %translations;
$entry{'translations'} = \%translations;
$templates{$template} = \%entry;
@@ -115,7 +123,7 @@ foreach $template (keys %templates) {
# open the template file - ignore sections for which no
# templates exist
unless(open(TEMPLATE, $outfile)) {
- print STDERR "Warning: No template found for item $_: $outfile: $!\n";
+ print STDERR "Warning: No template found for item '$template' : '$outfile' : '$_': $!\n";
exit -1;
}