diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-10 06:48:19 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-10 06:48:19 +0000 |
commit | dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5 (patch) | |
tree | 2a77ec2e9734f5e352e82f6c5dba7962d2ae0732 | |
parent | 61f231388037e988ebf360156bef1c983709b2c9 (diff) | |
download | spec-helper-dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5.tar spec-helper-dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5.tar.gz spec-helper-dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5.tar.bz2 spec-helper-dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5.tar.xz spec-helper-dd5848ac78aaf2de0811fe99ea1ce83c6727f4c5.zip |
Fix regexp for translation of menu entries.
Capitalize some names.
-rwxr-xr-x | translate_menu.pl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/translate_menu.pl b/translate_menu.pl index 57845fb..2aa454f 100755 --- a/translate_menu.pl +++ b/translate_menu.pl @@ -13,22 +13,22 @@ my @nested = (["Configuration", "System/Configuration"], ["Applications/Monitoring", "System/Monitoring"], ["Applications/Publishing", "Office/Publishing"], - ["Applications/File tools", "System/File tools"], - ["Applications/Text tools", "System/Text tools"], + ["Applications/File tools", "System/File Tools"], + ["Applications/Text tools", "System/Text Tools"], ["Applications/Archiving", "System/Archiving"], - ["Applications", "More applications"], + ["Applications", "More Applications"], ["Terminals", "System/Terminals"], - ["Documentation", "More applications/Documentation"], + ["Documentation", "More Applications/Documentation"], ["Office/PDA", "Office/Communications/PDA"], ["Networking/IRC", "Internet/Chat"], - ["Networking/WWW", "Internet/Web browsers"], + ["Networking/WWW", "Internet/Web Browsers"], ["Networking", "Internet"], - ["Amusement", "More applications/Games"], + ["Amusement", "More Applications/Games"], ["Session/Windowmanagers", "System/Session/Windowmanagers"], ); @@ -46,13 +46,13 @@ sub translate { # process each file passed on cli: foreach my $file (@ARGV) { - open(my $FILE, "<$file"); + open(my $FILE, "<$file") or die $!; my @lines = <$FILE>; close($FILE); - open($FILE, ">$file"); + open($FILE, ">$file") or die $!; foreach my $l (@lines) { chomp($l); - if ($l =~ /(.*section=)"([^"]+)"(\s+.*)/ || $l =~ /(.*section=)([^"].+?)((\s|\\)+.*)/) { + if ($l =~ /(.*section=)"([^"]+)"(\s*.*)/ || $l =~ /(.*section=)([^"].+?)((\s|\\)+.*)/) { my ($beg, $section, $end) = ($1, $2, $3); $section = translate($section); $l = qq($beg"$section"$end); |