From 4b2a36bba8ecc740d150f3d33000ff13212df000 Mon Sep 17 00:00:00 2001 From: twanvl Date: Wed, 27 Aug 2008 18:56:55 +0000 Subject: [PATCH] Added (partial) support for making cards in French style git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1177 0fc631ac-6414-0410-93d0-97cfa31319b6 --- data/magic.mse-game/card_fields | 8 +-- data/magic.mse-game/icons/language-en.png | Bin 0 -> 631 bytes data/magic.mse-game/icons/language-fr.png | Bin 0 -> 545 bytes data/magic.mse-game/language | 33 ++++++++++ data/magic.mse-game/script | 73 +++++++++++++--------- data/magic.mse-game/set_fields | 12 ++++ 6 files changed, 91 insertions(+), 35 deletions(-) create mode 100644 data/magic.mse-game/icons/language-en.png create mode 100644 data/magic.mse-game/icons/language-fr.png create mode 100644 data/magic.mse-game/language diff --git a/data/magic.mse-game/card_fields b/data/magic.mse-game/card_fields index c12c2dfe..ab5eff46 100644 --- a/data/magic.mse-game/card_fields +++ b/data/magic.mse-game/card_fields @@ -169,7 +169,7 @@ card field: # Either just supertype, or subtype - supertype combined_editor( field1: card.super_type, - separator: " — ", + separator: language().type_separator, field2: card.sub_type, soft_before_empty: true, hide_when_empty: true @@ -275,7 +275,7 @@ card field: script: combined_editor( field1: card.power, - separator: "/", + separator: language().pt_separator, field2: card.toughness, soft_before_empty: true, hide_when_empty: true @@ -424,7 +424,7 @@ card field: script: combined_editor( field1: card.super_type_2, - separator: " — ", + separator: language().type_separator, field2: card.sub_type_2, soft_before_empty: true, hide_when_empty: true @@ -495,7 +495,7 @@ card field: script: combined_editor( field1: card.power_2, - separator: "/", + separator: language().pt_separator, field2: card.toughness_2, soft_before_empty: true, hide_when_empty: true diff --git a/data/magic.mse-game/icons/language-en.png b/data/magic.mse-game/icons/language-en.png new file mode 100644 index 0000000000000000000000000000000000000000..196db5874bade5cf68b660dfc340ba2f935e2b5f GIT binary patch literal 631 zcmV--0*L*IP)lkXrGB=QAE7Oa;sEni}R=0E^OXpT$$y}qo$&7jtn7Oba1SRwXYMYg-G{}k? zRt6)ZHU^UwW9)9b=iYP9?YWE2yYukXf$rI0!y{1k<_D12H;U#c-ejSH$B_RGc%6plS;Gsj52lf)XN6M5v;W+0g2EAhz^2$uEy^My@@MArM6!A;jWQ z3WWmhC7aFSYAW3_rBrjA($eYJ_dl&2cZYn7Rdv^KQ(=4+i{x@S?2^f3Dx9fgG8x@- zOtDyq$y72L3-$E{gMl1q^KUXkBC(1uOi`Tk%&8^*%j#^nPd|&ZwNR?d>0$`3owWTgW;= RCDQ-^002ovPDHLkV1jJlA%Oq@ literal 0 HcmV?d00001 diff --git a/data/magic.mse-game/icons/language-fr.png b/data/magic.mse-game/icons/language-fr.png new file mode 100644 index 0000000000000000000000000000000000000000..8332c4ec23c853944c29b02d7b32a88033f48a71 GIT binary patch literal 545 zcmV++0^a?JP)lgG%);U`26kn-@hOg zU%!6+4+cOs(0HIde9xZz`}Onxub&LUB0x(30+2WcIRJn#2ut|?gWYu1Cf+!-K%B8# zdf?1WA}#uZ8oj7u>$I1i0Al&`=O0k%-@icgAIJnM0xA6maSq6BK-ECw|NZ*S`0Lj% z1_pot6puj;05Ax`F!=umqj7^frO?t|3^&I1kxUq9yECc+jQpY84SWH_0#pxl$?v~F z@*hy-KN0|X07U)z`4{NpU%#2aHUI<=%a31wK(7Du52Oc(|3O^?R1IN+RRjI-n*kVB z3=9AP#PZ|EACPLGJ%9cJNh|>9B%spYzZw7h1%?tp0I_@ndg9MNE>313@6R75NcceF zkr51-#U+7;F#`Sf7i0rK0I_`g_NQ&Z et ", + is_creature : match@(match: "(?i)Creature|Créature") + is_tribal : match@(match: "(?i)Tribal") + is_artifact : match@(match: "(?i)Artifact") + is_land : match@(match: "(?i)Land") + is_enchantment : match@(match: "(?i)Enchantment") + is_spell : match@(match: "(?i)Instant|Sorcery") + ] +] + +# The selected language +language := { languages[set.card_language] or else language.English } diff --git a/data/magic.mse-game/script b/data/magic.mse-game/script index ef3e47c3..fe3ef639 100644 --- a/data/magic.mse-game/script +++ b/data/magic.mse-game/script @@ -1,4 +1,8 @@  +############################################################## Localization + +include file: language + ############################################################## Sorting mana symbols # correctly sort a mana symbol (no guild mana) @@ -413,39 +417,46 @@ flavor_text_filter := # Move the cursor past the separator in the p/t and type boxes type_over_pt := replace@(match:"/$", replace:"") -type_over_type := replace@(match:" ?-$", replace:"") +type_over_type := replace@(match:" ?[-:]$", replace:"") -super_type_filter := - remove_tag@(tag: "{input}" } +super_type_filter := { + input := remove_tag(tag: "{input}" +} -space_to_wltags := replace@(match:"( +| )", - replace:{"{_1}"}) -sub_type_filter := - remove_tag@(tag: "$", replace: "") + # remove trailing soft space - remove_tag@(tag: " " - else first := first + " " - input := next - ) else ( - first := "" - ) - if list_type != "" then ( - if input != "" then input := input + " " # Add a new box at the end - first + "{ space_to_wltags(input) }" - ) else first + input - } +break_subtypes := split_text@(match: " +|[^<]*", include_empty:false) +sub_type_filter := { + input := remove_tag(tag: "{part}" + else + lang.subtype_separator + "{part}" + ) + + (if length(parts) > 0 then + # Add a new box at the end + "{lang.subtype_separator}" + ) + ) else input # do nothing +} # all sub types, for word list space_to_comma := replace@(match:" ", replace:",") diff --git a/data/magic.mse-game/set_fields b/data/magic.mse-game/set_fields index f022a223..eb5b2d51 100644 --- a/data/magic.mse-game/set_fields +++ b/data/magic.mse-game/set_fields @@ -70,6 +70,13 @@ set field: choice: after other cards choice: separate numbering initial: after other cards +set field: + type: choice + name: card language + description: Language for the cards + choice: English + choice: Français + initial: English set field: type: boolean name: mark errors @@ -144,3 +151,8 @@ default set style: choice images: yes: script: built_in_image("bool_yes") no: script: built_in_image("bool_no") + card language: + render style: both + choice images: + English: /magic.mse-game/icons/language-en.png + Français: /magic.mse-game/icons/language-fr.png