diff options
author | Andras Timar <atimar@suse.com> | 2012-01-02 12:35:52 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-01-02 12:39:05 +0100 |
commit | e1430a66abdbcd6cfeaa99c33fb6a97e95c118f0 (patch) | |
tree | 6e4c2035d09b5455ff3b71e57d3191ae2ebffb20 /l10ntools | |
parent | 7731d8146ac7d26869dce7656c24c4e431938c5c (diff) |
fix KeyID generation for a corner case
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/scripts/keyidGen.pl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/l10ntools/scripts/keyidGen.pl b/l10ntools/scripts/keyidGen.pl index bb9eae976125..cf95b2937830 100644 --- a/l10ntools/scripts/keyidGen.pl +++ b/l10ntools/scripts/keyidGen.pl @@ -67,16 +67,23 @@ while ( <INFILE> ) my $title = defined $14 ? $14 : ''; my $timestamp = defined $15 ? $15 : ''; @path = split ( "\\\\" , $file ); - $key = $path[-3] . "_" . $path[-2] . "_" . $path[-1] . "#" . $gid . "."; + if (defined $path[-3]) + { + $key = $path[-3] . "_" . $path[-2] . "_" . $path[-1] . "#" . $gid . "."; + } + else + { + $key = $prj . "_" . $path[-2] . "_" . $path[-1] . "#" . $gid . "."; + } if (length($lid)) {$key .= $lid . ".";} if (length($type)) {$key .= $type . ".";} # replace non-word characters to _ just as in po files in source keys $key =~ s|[^\w#\./]|_|g; # ISO 639 private use code - $lang = "qtz"; - if ( $text ne "") {$text = makekeyidstr(keyidgen($key . "text"),$text);} - if ( $quickhelptext ne "") {$quickhelptext = makekeyidstr(keyidgen($key . "quickhelptext"),$quickhelptext);} - if ( $title ne "") {$title = makekeyidstr(keyidgen($key . "title"),$title);} + $lang = "qtz"; + if ( $text ne "") {$text = makekeyidstr(keyidgen($key . "text"),$text);} + if ( $quickhelptext ne "") {$quickhelptext = makekeyidstr(keyidgen($key . "quickhelptext"),$quickhelptext);} + if ( $title ne "") {$title = makekeyidstr(keyidgen($key . "title"),$title);} print OUTFILE "$prj\t$file\t$dummy\t$type\t$gid\t$lid\t$helpid\t$platform\t$width\t$lang\t$text\t$helptext\t$quickhelptext\t$title\t$timestamp\n"; } } |