Erwan
- Added a perl script to synchronize _cards.dat translations with latest "original" _card.dat
This commit is contained in:
2838
projects/mtg/tools/translation_sync/FR/Sets/10E/_cards.dat
Normal file
2838
projects/mtg/tools/translation_sync/FR/Sets/10E/_cards.dat
Normal file
File diff suppressed because it is too large
Load Diff
275
projects/mtg/tools/translation_sync/FR/Sets/ARB/_cards.dat
Normal file
275
projects/mtg/tools/translation_sync/FR/Sets/ARB/_cards.dat
Normal file
@@ -0,0 +1,275 @@
|
||||
[card]
|
||||
text=Vigilance, celerite.
|
||||
id=180604
|
||||
name=Cerodon Yearling
|
||||
color=Red,White
|
||||
rarity=C
|
||||
mana={R}{W}
|
||||
type=Creature
|
||||
subtype=Beast
|
||||
power=2
|
||||
toughness=2
|
||||
abilities=vigilance,haste
|
||||
[/card]
|
||||
[card]
|
||||
text=La creature ciblee gagne +4/+2 et acquiert le pietinement jusqu'a la fin du tour.
|
||||
target=creature
|
||||
auto=4/2
|
||||
auto=trample
|
||||
id=179624
|
||||
name=Colossal Might
|
||||
color=Red,Green
|
||||
rarity=C
|
||||
mana={R}{G}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
text=Exaltation (A chaque fois qu'une creature que vous controlez attaque seule, cette creature gagne +1/+1 jusqu'a la fin du tour.)
|
||||
id=179542
|
||||
name=Ethercaste Knight
|
||||
color=White,Blue
|
||||
rarity=C
|
||||
mana={W}{U}
|
||||
type=Creature
|
||||
subtype=Human Knight
|
||||
power=1
|
||||
toughness=3
|
||||
abilities=exalted
|
||||
[/card]
|
||||
[card]
|
||||
text=
|
||||
id=189647
|
||||
name=Grizzled Leotau
|
||||
color=Green,White
|
||||
rarity=C
|
||||
mana={G}{W}
|
||||
type=Creature
|
||||
subtype=Cat
|
||||
power=1
|
||||
toughness=5
|
||||
[/card]
|
||||
[card]
|
||||
id=179568
|
||||
name=Intimidation Bolt
|
||||
mana={1}{R}{W}
|
||||
type=Instant
|
||||
text=L'Eclair d'intimidation inflige 3 blessures a la creature ciblee. Les autres creatures ne peuvent pas attaquer ce tour-ci.
|
||||
target=creature
|
||||
auto=damage:3
|
||||
auto=lord(creature) cantattack
|
||||
target=creature
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
text=La force et l'endurance du Seigneur de l'extinction sont chacune egale au nombre de cartes dans tous les cimetieres.
|
||||
id=177922
|
||||
name=Lord of Extinction
|
||||
color=Green,White
|
||||
rarity=M
|
||||
mana={3}{B}{G}
|
||||
type=Creature
|
||||
subtype=Elemental
|
||||
auto=foreach(*|graveyard) 1/1
|
||||
power=*
|
||||
toughness=*
|
||||
[/card]
|
||||
[card]
|
||||
text=Les creatures que vous controlez ont la celerite.
|
||||
id=180625
|
||||
name=Madrush Cyclops
|
||||
color=Black,Red,Green
|
||||
rarity=R
|
||||
mana={1}{B}{R}{G}
|
||||
type=Creature
|
||||
subtype=Cyclops Warrior
|
||||
auto=lord(creature|myinplay) haste
|
||||
power=3
|
||||
toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
text=Enchanter : creature. La creature enchantee gagne +2/+0 et a le vol.
|
||||
id=179591
|
||||
target=creature
|
||||
auto=2/0
|
||||
auto=flying
|
||||
name=Magefire Wings
|
||||
color=Blue,Red
|
||||
rarity=C
|
||||
mana={U}{R}
|
||||
type=Enchantment
|
||||
subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Double initiative.
|
||||
id=179585
|
||||
name=Marisi's Twinclaws
|
||||
color=White,Red,Green
|
||||
rarity=U
|
||||
mana={2}{RW}{G}
|
||||
type=Creature
|
||||
subtype=Cat warrior
|
||||
power=2
|
||||
toughness=4
|
||||
abilities=double strike
|
||||
[/card]
|
||||
[card]
|
||||
text=Vol. Quand les Faucons coursiers arrivent en jeu, piochez une carte.
|
||||
id=189644
|
||||
name=Messenger Falcons
|
||||
color=Green,Blue,White
|
||||
rarity=U
|
||||
mana={2}{GU}{W}
|
||||
auto=draw:1
|
||||
type=Creature
|
||||
subtype=Bird
|
||||
power=2
|
||||
toughness=2
|
||||
abilities=flying
|
||||
[/card]
|
||||
[card]
|
||||
text=Exaltation (A chaque fois qu'une creature que vous controlez attaque seule, cette creature gagne +1/+1 jusqu'a la fin du tour.) {1}, sacrifiez le Bandemage qasali : Detruisez l'artefact ou l'enchantement cible.
|
||||
id=179556
|
||||
name=Qasali Pridemage
|
||||
color=Green,White
|
||||
rarity=C
|
||||
mana={G}{W}
|
||||
type=Creature
|
||||
subtype=Cat Wizard
|
||||
auto={1}{S}:destroy target(artifact,enchantment)
|
||||
power=2
|
||||
toughness=2
|
||||
abilities=exalted
|
||||
[/card]
|
||||
[card]
|
||||
text=
|
||||
id=189650
|
||||
name=Rhox Brute
|
||||
color=Red,Green
|
||||
rarity=U
|
||||
mana={2}{R}{G}
|
||||
type=Creature
|
||||
subtype=Rhino
|
||||
power=4
|
||||
toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
text=Enchanter : creature. La creature enchantee gagne +3/-3.
|
||||
id=179553
|
||||
target=creature
|
||||
auto=3/-3
|
||||
name=Sangrite Backlash
|
||||
color=Blue,Red
|
||||
rarity=C
|
||||
mana={BG}{R}
|
||||
type=Enchantment
|
||||
subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Vol, celerite.
|
||||
id=179594
|
||||
name=Sewn-Eye Drake
|
||||
color=Blue,Red,Black
|
||||
rarity=C
|
||||
mana={2}{UR}{B}
|
||||
type=Creature
|
||||
subtype=Zombie Drake
|
||||
power=3
|
||||
toughness=1
|
||||
abilities=flying,haste
|
||||
[/card]
|
||||
[card]
|
||||
text=Exaltation (A chaque fois qu'une creature que vous controlez attaque seule, cette creature gagne +1/+1 jusqu'a la fin du tour.)
|
||||
id=159688
|
||||
name=Sigiled Behemoth
|
||||
color=Green,White
|
||||
rarity=C
|
||||
mana={4}{G}{W}
|
||||
type=Creature
|
||||
subtype=Beast
|
||||
power=5
|
||||
toughness=4
|
||||
abilities=exalted
|
||||
[/card]
|
||||
[card]
|
||||
text=Vol, initiative, vigilance, lien de vie, protection contre le rouge et protection contre le vert.
|
||||
id=189641
|
||||
name=Sphinx of the Steel Wind
|
||||
color=White,Blue,Black
|
||||
rarity=M
|
||||
mana={5}{W}{U}{B}
|
||||
type=Artifact Creature
|
||||
subtype=Sphinx
|
||||
power=6
|
||||
toughness=6
|
||||
abilities=flying,first strike,vigilance,lifelink,protection from red,protection from green
|
||||
[/card]
|
||||
[card]
|
||||
text=Vol
|
||||
id=179537
|
||||
name=Talon Trooper
|
||||
color=White,Blue
|
||||
rarity=C
|
||||
mana={1}{W}{U}
|
||||
type=Creature
|
||||
subtype=Bird Scout
|
||||
power=2
|
||||
toughness=3
|
||||
abilities=flying
|
||||
[/card]
|
||||
[card]
|
||||
text=Detruisez la creature ciblee. Elle ne peut pas etre regeneree.
|
||||
target=creature
|
||||
auto=bury
|
||||
id=176449
|
||||
name=Terminate
|
||||
color=Black,Red
|
||||
rarity=C
|
||||
mana={B}{R}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
text={T}: Degagez un autre permanent cible.
|
||||
id=138217
|
||||
name=Unbender Tine
|
||||
color=White,Blue
|
||||
rarity=U
|
||||
mana={2}{W}{U}
|
||||
auto={T}:Untap target(*)
|
||||
type=Artifact
|
||||
[/card]
|
||||
[card]
|
||||
text=Quand les Renegats vithiens arrivent en jeu, detruisez l'artefact cible.
|
||||
id=179535
|
||||
auto=may moveTo(graveyard) target(artifact)
|
||||
name=Vithian Renegades
|
||||
color=Red,Green
|
||||
rarity=U
|
||||
mana={1}{R}{G}
|
||||
type=Creature
|
||||
subtype=Human Shaman
|
||||
power=3
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Defenseur, vol, linceul.
|
||||
id=179601
|
||||
name=Wall of Denial
|
||||
color=White,Blue
|
||||
rarity=U
|
||||
mana={1}{W}{U}
|
||||
type=Creature
|
||||
subtype=Illusion Wall
|
||||
power=0
|
||||
toughness=8
|
||||
abilities=Defender, flying, shroud
|
||||
[/card]
|
||||
[card]
|
||||
id=179575
|
||||
name=Zealous Persecution
|
||||
mana={W}{B}
|
||||
type=Instant
|
||||
text=Jusqu'a la fin du tour, les creatures que vous controlez gagnent +1/+1 et les creatures que vos adversaires controlent gagnent -1/-1.
|
||||
auto=lord(creature|myinplay) 1/1
|
||||
auto=lord(creature|opponentinplay) -1/-1
|
||||
rarity=U
|
||||
[/card]
|
||||
1
projects/mtg/tools/translation_sync/output/README.txt
Normal file
1
projects/mtg/tools/translation_sync/output/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
this is the output folder for synchronized/translated content
|
||||
104
projects/mtg/tools/translation_sync/sync.pl
Normal file
104
projects/mtg/tools/translation_sync/sync.pl
Normal file
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#This script synchronizes a translation of _cards.dat with the equivalent english _cards.dat
|
||||
# it keeps everything from the english file, except the text line that is taken from the translated file
|
||||
# usage: translate.pl FR
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cwd;
|
||||
use DirHandle;
|
||||
use Data::Dumper;
|
||||
|
||||
|
||||
# Subroutines
|
||||
|
||||
|
||||
my $parseCards = sub {
|
||||
my $inFile = shift;
|
||||
return {} unless (-f $inFile);
|
||||
my @cards;
|
||||
my %card;
|
||||
open (MYFILE, $inFile);
|
||||
while (<MYFILE>) {
|
||||
chomp;
|
||||
my $line = $_;
|
||||
next if $line eq "[card]";
|
||||
if ($line =~ /\[\/card\]/) {
|
||||
my %copy = %card;
|
||||
%card =();
|
||||
push @cards, \%copy;
|
||||
}
|
||||
if ($line =~ /=/){
|
||||
my ($type, $content) = split(/=/, $line);
|
||||
$card{$type} = $content;
|
||||
}
|
||||
|
||||
}
|
||||
close (MYFILE);
|
||||
|
||||
|
||||
my %cards = map { $_->{id} => $_ } @cards;
|
||||
return \%cards;
|
||||
};
|
||||
|
||||
my $doOutput = sub {
|
||||
my ($outFile, $data, $translation) = @_;
|
||||
open (OUTFILE, '>' . $outFile);
|
||||
|
||||
|
||||
|
||||
|
||||
while ( my ($key, $value) = each(%$data) ) {
|
||||
if (my $trans = $translation->{$key}){
|
||||
$value->{text} = $trans->{text} if $trans->{text};
|
||||
}
|
||||
print OUTFILE "[card]\n";
|
||||
while ( my ($k, $v) = each(%$value) ) {
|
||||
print OUTFILE $k ."=" . $v . "\n";
|
||||
}
|
||||
print OUTFILE "[/card]\n";
|
||||
|
||||
}
|
||||
|
||||
close (OUTFILE);
|
||||
};
|
||||
|
||||
my $output = sub {
|
||||
|
||||
|
||||
};
|
||||
|
||||
my $lang = $ARGV[0] || "FR";
|
||||
my $data_folder = "../../bin/Res/sets";
|
||||
my $input_translation = "$lang/sets";
|
||||
my $output_folder = "output";
|
||||
|
||||
|
||||
my $dh = DirHandle->new($input_translation) or die "No such directory: $input_translation";
|
||||
print "looking for translated sets in $input_translation\n";
|
||||
|
||||
$dh = DirHandle->new($data_folder) or die "No such directory: $data_folder";
|
||||
|
||||
while(defined(my $val = $dh->read)){
|
||||
next if "." eq $val;
|
||||
next if ".." eq $val;
|
||||
if (-d $data_folder."/".$val){
|
||||
if (-f $data_folder. "/" . $val ."/" . "_cards.dat"){
|
||||
print "processing $val \n";
|
||||
my $curdir = $input_translation."/".$val;
|
||||
my $cards = $parseCards->($data_folder. "/" . $val ."/" . "_cards.dat");
|
||||
my $transl = $parseCards->($curdir."/_cards.dat");
|
||||
my $out = $output_folder ."/" . $val;
|
||||
mkdir ($out);
|
||||
$doOutput->($out . "/_cards.dat", $cards,$transl);
|
||||
if (%$transl){
|
||||
print "-->OK\n";
|
||||
}else{
|
||||
print "--> No translation was found for $val. The original file was used\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print "done! resulting _cards.dat files put in Folder:$output_folder\n";
|
||||
$dh->close();
|
||||
Reference in New Issue
Block a user