summaryrefslogtreecommitdiff
path: root/sysui/desktop/share/translate.pl
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-04-18 12:00:30 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-04-18 12:00:30 +0200
commitb7423ceee1a6b1c5595fbbef6f0ca4417feeddf6 (patch)
tree7268dee54f7d2c3d4ef0a0da09a0586c0beccdb2 /sysui/desktop/share/translate.pl
parent38c7eeeb94b780343af1aae6e29cb9e5b906015c (diff)
lp#720716: add unity quicklist support
Diffstat (limited to 'sysui/desktop/share/translate.pl')
-rwxr-xr-xsysui/desktop/share/translate.pl18
1 files changed, 15 insertions, 3 deletions
diff --git a/sysui/desktop/share/translate.pl b/sysui/desktop/share/translate.pl
index 197c333e6f37..89c9da0db5ff 100755
--- a/sysui/desktop/share/translate.pl
+++ b/sysui/desktop/share/translate.pl
@@ -64,6 +64,12 @@ while ($_ = $ARGV[0], /^-/) {
}
}
+# hack for unity section
+$outkey = $key;
+if ( $outkey eq "UnityQuicklist" ) {
+ $outkey = "Name";
+}
+
# open input file
unless (open(SOURCE, $ARGV[0])) {
print STDERR "Can't open $ARGV[0] file: $!\n";
@@ -106,9 +112,12 @@ while (<SOURCE>) {
# Pass the head of the template to the output file
KEY: while (<TEMPLATE>) {
- print OUTFILE;
+ $keyline = $_;
last KEY if (/$key/);
+ print OUTFILE;
}
+ $keyline=~s/^$key/$outkey/;
+ print OUTFILE $keyline;
} else {
# split locale = "value" into 2 strings
@@ -125,10 +134,13 @@ KEY: while (<TEMPLATE>) {
$value=~s/%PRODUCTNAME/$productname/g;
$locale=~s/-/_/;
+
+ if (not $value eq '') {
if ($ext eq "desktop") {
- print OUTFILE "$key\[$locale\]=$value\n";
+ print OUTFILE "$outkey\[$locale\]=$value\n";
} else {
- print OUTFILE "\t\[$locale\]$key=$value\n";
+ print OUTFILE "\t\[$locale\]$outkey=$value\n";
+ }
}
}
}