diff options
author | sansnom05 <sansnom05@users.sourceforge.net> | 2010-12-16 16:53:08 +0300 |
---|---|---|
committer | sansnom05 <sansnom05@users.sourceforge.net> | 2010-12-16 16:53:08 +0300 |
commit | f0d88a6ff96770b10031dcc59447cca2c7dbc91c (patch) | |
tree | e188e4e733fcf6fc9b00dc349618c19f4d47a7c9 /src/apps/mplayerc/mpcresources/rcfile.pl | |
parent | 5067b0b48d4d15b24669c8032b28e90e45202801 (diff) |
legacy branch: merge r2662-r2759
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/branches/legacy@2778 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/mpcresources/rcfile.pl')
-rw-r--r-- | src/apps/mplayerc/mpcresources/rcfile.pl | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/apps/mplayerc/mpcresources/rcfile.pl b/src/apps/mplayerc/mpcresources/rcfile.pl index 6d8487293..81b734152 100644 --- a/src/apps/mplayerc/mpcresources/rcfile.pl +++ b/src/apps/mplayerc/mpcresources/rcfile.pl @@ -101,13 +101,13 @@ if(!-e "newrc"){ }
foreach my $filename(@FileLists) {
- print "Anaylse locale file: $filename...\n";
+ print "Analyzing locale file: $filename...\n";
my @oldrcfile = readFile($filename, 1);
my($curDialogs, $curMenus, $curStrings, @curOutline) = ({},{},{}, ());
my @curVersionInfo = ();
my $curDesignInfos = {};
analyseData(\@oldrcfile, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo, $curDesignInfos);
-
+
my $newrcfile = File::Spec->catfile(".", "newrc", $filename);
my @newrc = ();
@@ -115,7 +115,7 @@ foreach my $filename(@FileLists) { writeData(\@newrc, \@patches, \@curOutline, $curDialogs, $curMenus, $curStrings, \@curVersionInfo, $curDesignInfos);
- print "Generate new locale file: $newrcfile...\n\n";
+ print "Generating new locale file: $newrcfile...\n\n";
writeFile($newrcfile, \@newrc, 2);
}
@@ -171,7 +171,7 @@ sub writeData { push(@{$newrc}, @{$curOutline->[0][1]}); # use old language rc file head section
}
elsif($idx == $tailsection) {
- writeVersionInfo($newrc, $curVersionInfo); #TODO: write current version info to it's original place, now just above end section
+ writeVersionInfo($newrc, $curVersionInfo); # TODO: write current version info to it's original place, now just above end section
push(@{$newrc}, @{$curOutline->[$oldtail][1]}); # use old language rc file head section
}
else {
@@ -232,7 +232,7 @@ sub writeStringTable { #use new rc file stringtables, try to use as many locale strings as possible
foreach (@{$output}){
my ($key, $value);
-
+
if (/\b(ID\S+)\b\s*(".+")/){ #distinguish between key value at same line or not for syntax's sake
($key, $value)= ($1,$2);
}
@@ -248,13 +248,13 @@ sub writeStringTable { else {
next; #other text
}
-
+
my $baseStr = $BaseStrings->{$key};
my $localeStr = $refs->{$key};
-
+
if((!$localeStr) || (!$baseStr) || ($baseStr ne $value)) {
}
- else {
+ else {
s/\Q$value\E/$localeStr/; #use locale string
}
}
@@ -279,13 +279,13 @@ sub writeDialogContent { if($newdataLines && $basedataLines && $refdataLines) {
my $diffData = $DialogDiffs->{$name};
-
+
foreach(@$diffData) {
my $linenum = $newidxs[$_->[0]];
-
+
my $str = $newdatas[$_->[0]];
my $localstr = $refdatas[$_->[1]];
-
+
if($localstr) {
$contents[$linenum-1] =~ s/\Q$str\E/$localstr/;
}
@@ -296,7 +296,7 @@ sub writeDialogContent { if($localfont) {
$contents[$NewDialogs->{$name}{"__FONT__"}[0]-1] = $refs->{$name}{"__TEXT__"}[$refs->{$name}{"__FONT__"}[0]-1];
}
-
+
push(@{$output}, @contents);
}
@@ -312,7 +312,7 @@ sub writeMenuContent { # this menu exists in old file
my @changes = grep($_->[0] != $_->[1],@$diffData); #anything changed for this menu?
my $samelines = @$diffData;
-
+
if((!@changes) && ($samelines == $contentLines)) { #no change then just use old data
@contents = ();
push(@contents, @{$refs->{$name}{"__TEXT__"}});
@@ -341,9 +341,6 @@ sub writeVersionInfo{ push(@{$input}, "// Version");
push(@{$input}, "//");
push(@{$input}, @$versionInfo);
- push(@{$input}, "/////////////////////////////////////////////////////////////////////////////");
- push(@{$input}, "");
- push(@{$input}, "");
}
###################################################################################################
|