mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
localize card links, add_link, remove_links
This commit is contained in:
+56
-1
@@ -1,4 +1,4 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) Twan van Laarhoven and the other MSE developers |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <data/game.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <data/field/choice.hpp>
|
||||
#include <data/card_link.hpp>
|
||||
#include <data/keyword.hpp>
|
||||
#include <data/statistics.hpp>
|
||||
#include <data/pack.hpp>
|
||||
@@ -122,6 +123,60 @@ void Game::validate(Version v) {
|
||||
card_fields_alt_names.emplace(unified_name, field->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
// front face/back face card link
|
||||
card_links.insert(card_links.begin(), make_intrusive<CardLink>());
|
||||
card_links[0]->selected.default_ = _("Front Face");
|
||||
card_links[0]->selected.translations = std::unordered_map<String, String>{
|
||||
{_("ch-s"), _("卡片正面")},
|
||||
{_("ch-t"), _("卡片正面")},
|
||||
{_("da"), _("Forside")},
|
||||
{_("de"), _("Vorderseite")},
|
||||
{_("en"), _("Front Face")},
|
||||
{_("es"), _("Cara frontal")},
|
||||
{_("fr"), _("Face Avant")},
|
||||
{_("it"), _("Fronte")},
|
||||
{_("jp"), _("カードの表面")},
|
||||
{_("ko"), _("카드 앞면")},
|
||||
{_("pl"), _("Przód")},
|
||||
{_("pt-br"), _("Frente")},
|
||||
{_("ru"), _("Лицевая сторона")}
|
||||
};
|
||||
card_links[0]->linked.default_ = _("Back Face");
|
||||
card_links[0]->linked.translations = std::unordered_map<String, String>{
|
||||
{_("ch-s"), _("卡片背面")},
|
||||
{_("ch-t"), _("卡片背面")},
|
||||
{_("da"), _("Bagside")},
|
||||
{_("de"), _("Rückseite")},
|
||||
{_("en"), _("Back Face")},
|
||||
{_("es"), _("Cara posterior")},
|
||||
{_("fr"), _("Face Arrière")},
|
||||
{_("it"), _("Retro")},
|
||||
{_("jp"), _("カードの裏面")},
|
||||
{_("ko"), _("카드 뒷면")},
|
||||
{_("pl"), _("Tył")},
|
||||
{_("pt-br"), _("Verso")},
|
||||
{_("ru"), _("Обратная сторона")}
|
||||
};
|
||||
// localized card link names map
|
||||
for (auto it = card_links.begin(); it != card_links.end(); ++it) {
|
||||
CardLinkP link = *it;
|
||||
String selected_default = link->selected.default_;
|
||||
for (auto selected_it = link->selected.translations.begin(); selected_it != link->selected.translations.end(); selected_it++) {
|
||||
String selected_tr = unified_form(selected_it->second);
|
||||
if (card_links_alt_names.find(selected_tr) != card_links_alt_names.end() && card_links_alt_names[selected_tr] != selected_default) {
|
||||
queue_message(MESSAGE_WARNING, _ERROR_3_("link duplicate", selected_tr, card_links_alt_names[selected_tr], selected_default));
|
||||
}
|
||||
card_links_alt_names.emplace(selected_tr, selected_default);
|
||||
}
|
||||
String linked_default = link->linked.default_;
|
||||
for (auto linked_it = link->linked.translations.begin(); linked_it != link->linked.translations.end(); linked_it++) {
|
||||
String linked_tr = unified_form(linked_it->second);
|
||||
if (card_links_alt_names.find(linked_tr) != card_links_alt_names.end() && card_links_alt_names[linked_tr] != linked_default) {
|
||||
queue_message(MESSAGE_WARNING, _ERROR_3_("link duplicate", linked_tr, card_links_alt_names[linked_tr], linked_default));
|
||||
}
|
||||
card_links_alt_names.emplace(linked_tr, linked_default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user