mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-17 09:02:38 -05:00
Keep comments other than the special ### comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5735 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0457a578b5
commit
2ae6009448
1 changed files with 13 additions and 2 deletions
15
tools/uplang
15
tools/uplang
|
|
@ -37,13 +37,24 @@ while(<ENG>) {
|
||||||
close(ENG);
|
close(ENG);
|
||||||
|
|
||||||
undef %set;
|
undef %set;
|
||||||
|
my $cblock = 1;
|
||||||
open(NEW, "<$ARGV[1]");
|
open(NEW, "<$ARGV[1]");
|
||||||
while(<NEW>) {
|
while(<NEW>) {
|
||||||
|
$_ =~ s/\r//g;
|
||||||
|
|
||||||
if($_ =~ /^ *\#/) {
|
if($_ =~ /^ *\#/) {
|
||||||
# comment
|
# comment
|
||||||
|
if($_ !~ /^ *\#\#\#/) {
|
||||||
|
# no special ### comment -> keep it
|
||||||
|
if(!$cblock) {
|
||||||
|
print "\n";
|
||||||
|
$cblock = 1;
|
||||||
|
}
|
||||||
|
print $_;
|
||||||
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
$_ =~ s/\r//g;
|
$cblock = 0;
|
||||||
|
|
||||||
if($_ =~ /^ *([a-z]+): *(.*)/) {
|
if($_ =~ /^ *([a-z]+): *(.*)/) {
|
||||||
($var, $value) = ($1, $2);
|
($var, $value) = ($1, $2);
|
||||||
|
|
@ -54,7 +65,7 @@ while(<NEW>) {
|
||||||
# the last one for a single phrase
|
# the last one for a single phrase
|
||||||
|
|
||||||
if(!$ids{$set{'id'}}) {
|
if(!$ids{$set{'id'}}) {
|
||||||
print "### ".$set{'id'}." was not found in the english file!\n";
|
print "\n### ".$set{'id'}." was not found in the english file!\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue