From 9f80f452e4fecfd985b8d3e25d6e97bda34ce4bf Mon Sep 17 00:00:00 2001 From: Maxim Kovalenko Date: Mon, 19 Jul 2021 18:56:59 +0300 Subject: [PATCH] XEEN: RU Translated all constants.h strings for Clouds. Ready for test. --- devtools/create_xeen/en_constants.h | 2 +- devtools/create_xeen/ru_constants.h | 33 +++++++-------------- dists/engine-data/xeen.ccs | Bin 92933 -> 92926 bytes engines/xeen/dialogs/dialogs_char_info.cpp | 2 +- engines/xeen/dialogs/dialogs_char_info.h | 2 +- engines/xeen/dialogs/dialogs_items.cpp | 6 ++-- engines/xeen/dialogs/dialogs_items.h | 2 +- engines/xeen/dialogs/dialogs_quick_ref.cpp | 21 ++++++++++++- engines/xeen/dialogs/dialogs_quick_ref.h | 5 ++++ engines/xeen/party.cpp | 8 ++--- engines/xeen/party.h | 8 ++--- 11 files changed, 51 insertions(+), 38 deletions(-) diff --git a/devtools/create_xeen/en_constants.h b/devtools/create_xeen/en_constants.h index 867d306aaae..2e01886ad24 100644 --- a/devtools/create_xeen/en_constants.h +++ b/devtools/create_xeen/en_constants.h @@ -1359,7 +1359,7 @@ public: } const char *FIX_IDENTIFY_GOLD() { - return "\x3l\v000\t000%s %s\fd for %u gold?"; + return "\x3l\v000\t000%s %s\fd for %u %s?"; } const char *IDENTIFY_ITEM_MSG() { diff --git a/devtools/create_xeen/ru_constants.h b/devtools/create_xeen/ru_constants.h index 74cd49f4e08..e22dd56acae 100644 --- a/devtools/create_xeen/ru_constants.h +++ b/devtools/create_xeen/ru_constants.h @@ -804,28 +804,17 @@ public: } const char *CHARACTER_DETAILS() { - return "\x3" - "l\v041\t196%s\t000\v002%s : %s %s %s" - "\x3" - "r\t053\v028\f%02u%u\fd\t103\f%02u%u\fd" - "\x3" - "l\t131\f%02u%d\fd\t196\f15%lu\fd\x3" - "r" + return "\x3""l\v041\t196%s\t000\v002%s : %s %s %s" + "\x3""r\t053\v028\f%02u%u\fd\t103\f%02u%u\fd" + "\x3""l\t131\f%02u%d\fd\t196\f15%lu\fd\x3""r" "\t053\v051\f%02u%u\fd\t103\f%02u%u\fd" - "\x3" - "l\t131\f%02u%u\fd\t196\f15%lu\fd" - "\x3" - "r\t053\v074\f%02u%u\fd\t103\f%02u%u\fd" - "\x3" - "l\t131\f15%u\fd\t196\f15%lu\fd" - "\x3" - "r\t053\v097\f%02u%u\fd\t103\f%02u%u\fd" - "\x3" - "l\t131\f15%u\fd\t196\f15%u %s\fd" - "\x3" - "r\t053\v120\f%02u%u\fd\t103\f%02u%u\fd" - "\x3" - "l\t131\f15%u\fd\t196\f%02u%s\fd" + "\x3""l\t131\f%02u%u\fd\t196\f15%lu\fd" + "\x3""r\t053\v074\f%02u%u\fd\t103\f%02u%u\fd" + "\x3""l\t131\f15%u\fd\t196\f15%lu\fd" + "\x3""r\t053\v097\f%02u%u\fd\t103\f%02u%u\fd" + "\x3""l\t131\f15%u\fd\t196\f15%u %s\fd" + "\x3""r\t053\v120\f%02u%u\fd\t103\f%02u%u\fd" + "\x3""l\t131\f15%u\fd\t196\f%02u%s\fd" "\t245%s%s%s%s\fd"; } @@ -1418,7 +1407,7 @@ public: } const char *FIX_IDENTIFY_GOLD() { - return "\x3""l\v000\t000%s %s\fd \xA7\xA0 %lu \xA7\xAE\xAB\xAE\xE2%s?"; // "\x3""l\v000\t000%s %s\fd за %lu золот%s?" + return "\x3""l\v000\t000%s %s\fd \xA7\xA0 %lu %s?"; // "\x3""l\v000\t000%s %s\fd за %lu %s?" } const char *IDENTIFY_ITEM_MSG() { diff --git a/dists/engine-data/xeen.ccs b/dists/engine-data/xeen.ccs index 495a65cc83a10555fdd9fb4765269d6837da0a07..56acb55a009800ae850dfeb7f862669e1c9e73d6 100644 GIT binary patch delta 166 zcmV;X09pTq)&>661%DC%T=xdYE>*hV)X6#dAdpVdzqoac62QR3yy)-YL~@Y!en06H zc6&qU48r=xXqL3vqpdagTGyt`jG(^iOsAOs3l8NSet3%TU_0wia8^CygMZz@Vwtbh z5d9(aRHR|XkBxojMpx7L-GN#gcx1`y;cQY;YMr*+qrj1bTn=h#&N9HOcuxP@z&1}Q Uv5nGe0uV;CV{E*Lvn2K5bxAW@^Z)<= delta 174 zcmV;f08#(`)dhvt1%DC%T=xdYE>*hV)X6#dAQ4W|zqs{{5(2=)yy&svL~@Y!em|=e zc6&qU48pv|XqL3vqpkM%TGyt`jG#a(OsAOs3l66pet3%TU^}f(a8^CygMXjFVwtbh z5dGrxRHR|XkBvX)Mpx7L-GLk%cx1`y;cOIAYMr*+qrg*yTn=h#&N9GlcuxP@z&20n cv5nGe1X5aAQL|xeyod#oo1UB3vmN!}bqfhy&Hw-a diff --git a/engines/xeen/dialogs/dialogs_char_info.cpp b/engines/xeen/dialogs/dialogs_char_info.cpp index ff631b5d60a..c719962bd18 100644 --- a/engines/xeen/dialogs/dialogs_char_info.cpp +++ b/engines/xeen/dialogs/dialogs_char_info.cpp @@ -278,7 +278,7 @@ void CharacterInfo::addButtons() { addPartyButtons(_vm); } -const char* CharacterInfo::getDaysPlurals(int val) { +const char *CharacterInfo::getDaysPlurals(int val) { if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) { int i = val % 100; if (i < 5 || i > 20) diff --git a/engines/xeen/dialogs/dialogs_char_info.h b/engines/xeen/dialogs/dialogs_char_info.h index e34c803d2e0..cde9fadda6c 100644 --- a/engines/xeen/dialogs/dialogs_char_info.h +++ b/engines/xeen/dialogs/dialogs_char_info.h @@ -52,7 +52,7 @@ private: /** * Get plural day/days form */ - const char* getDaysPlurals(int val); + const char *getDaysPlurals(int val); /** * Return a string containing the details of the character diff --git a/engines/xeen/dialogs/dialogs_items.cpp b/engines/xeen/dialogs/dialogs_items.cpp index 8dacd25ed63..39a694c25c5 100644 --- a/engines/xeen/dialogs/dialogs_items.cpp +++ b/engines/xeen/dialogs/dialogs_items.cpp @@ -752,7 +752,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode, return (mode == ITEMMODE_CHAR_INFO) ? 0 : result; } -const char* ItemsDialog::getGoldPlurals(int cost) { +const char *ItemsDialog::getGoldPlurals(int cost) { if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) return Res.GOLDS[cost % 10 == 1 ? 0 : 1]; return Res.GOLDS[0]; @@ -933,7 +933,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite Common::String msg = Common::String::format(Res.FIX_IDENTIFY_GOLD, Res.FIX_IDENTIFY[0], c._items[category].getFullDescription(itemIndex).c_str(), - cost); + cost, getGoldPlurals(cost)); if (Confirm::show(_vm, msg) && party.subtract(CONS_GOLD, cost, WHERE_PARTY)) { item._state._broken = false; @@ -946,7 +946,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite Common::String msg = Common::String::format(Res.FIX_IDENTIFY_GOLD, Res.FIX_IDENTIFY[1], c._items[category].getFullDescription(itemIndex).c_str(), - cost); + cost, getGoldPlurals(cost)); if (Confirm::show(_vm, msg) && party.subtract(CONS_GOLD, cost, WHERE_PARTY)) { Common::String details = c._items[category].getIdentifiedDetails(itemIndex); diff --git a/engines/xeen/dialogs/dialogs_items.h b/engines/xeen/dialogs/dialogs_items.h index 3429d9fff82..64d9fccd5e9 100644 --- a/engines/xeen/dialogs/dialogs_items.h +++ b/engines/xeen/dialogs/dialogs_items.h @@ -67,7 +67,7 @@ private: /** * Get plural gold form */ - const char* getGoldPlurals(int val); + const char *getGoldPlurals(int val); int doItemOptions(Character &c, int actionIndex, int itemIndex, ItemCategory category, ItemsMode mode); diff --git a/engines/xeen/dialogs/dialogs_quick_ref.cpp b/engines/xeen/dialogs/dialogs_quick_ref.cpp index 329f74f3aac..096be16fd2b 100644 --- a/engines/xeen/dialogs/dialogs_quick_ref.cpp +++ b/engines/xeen/dialogs/dialogs_quick_ref.cpp @@ -20,6 +20,7 @@ * */ +#include "common/config-manager.h" #include "xeen/dialogs/dialogs_quick_ref.h" #include "xeen/resources.h" #include "xeen/xeen.h" @@ -32,6 +33,24 @@ void QuickReferenceDialog::show(XeenEngine *vm) { delete dlg; } +const char *QuickReferenceDialog::getDaysPlurals(int val) { + if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) { + int i = val % 100; + if (i < 5 || i > 20) + switch (val % 10) { + case 1: + return Res.DAYS[0]; + case 2: + case 3: + case 4: + return Res.DAYS[1]; + } + return Res.DAYS[2]; + } else { + return Res.DAYS[val == 1 ? 0 : 1]; + } +} + void QuickReferenceDialog::execute() { Combat &combat = *_vm->_combat; EventsManager &events = *_vm->_events; @@ -65,7 +84,7 @@ void QuickReferenceDialog::execute() { lines[3].c_str(), lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(), party._gold, party._gems, - food, food == 1 ? "" : "s" + food, getDaysPlurals(food) ); Window &w = windows[24]; diff --git a/engines/xeen/dialogs/dialogs_quick_ref.h b/engines/xeen/dialogs/dialogs_quick_ref.h index 4630043c3f5..e320cc4ca73 100644 --- a/engines/xeen/dialogs/dialogs_quick_ref.h +++ b/engines/xeen/dialogs/dialogs_quick_ref.h @@ -31,6 +31,11 @@ class QuickReferenceDialog : public ButtonContainer { private: QuickReferenceDialog(XeenEngine *vm) : ButtonContainer(vm) {} + /** + * Get plural day/days form + */ + const char *getDaysPlurals(int val); + void execute(); public: static void show(XeenEngine *vm); diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 38e5b8a141d..a2c29825308 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -662,7 +662,7 @@ int Party::subtract(ConsumableType consumableId, uint amount, PartyBank whereId, return true; } -const char* Party::getConsumableForm(ConsumableType consumableId) { +const char *Party::getConsumableForm(ConsumableType consumableId) { switch (consumableId) { case CONS_GOLD: return Res.CONSUMABLE_GOLD_FORMS[0]; case CONS_GEMS: return Res.CONSUMABLE_GEM_FORMS[0]; @@ -821,7 +821,7 @@ bool Party::arePacksFull() const { return total == (_activeParty.size() * NUM_ITEM_CATEGORIES); } -const char* Party::getFoundForm(const Character& c) { +const char *Party::getFoundForm(const Character &c) { if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) { switch (c._sex) { case MALE: @@ -1483,7 +1483,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int return false; } -const char* Party::getPickLockForm(const Character &c) { +const char *Party::getPickLockForm(const Character &c) { if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) { switch (c._sex) { case MALE: @@ -1495,7 +1495,7 @@ const char* Party::getPickLockForm(const Character &c) { return Res.PICK_FORM[0]; } -const char* Party::getUnablePickLockForm(const Character &c) { +const char *Party::getUnablePickLockForm(const Character &c) { if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) { switch (c._sex) { case MALE: diff --git a/engines/xeen/party.h b/engines/xeen/party.h index 44753a76d68..ecd6aa247e1 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -160,7 +160,7 @@ private: /** * Get gender form 'found' */ - const char* getFoundForm(const Character &c); + const char *getFoundForm(const Character &c); /** * Give a treasure item to the given character's inventory @@ -274,7 +274,7 @@ public: int subtract(ConsumableType consumableId, uint amount, PartyBank whereId, MessageWaitType wait = WT_FREEZE_WAIT); - const char* getConsumableForm(ConsumableType consumableId); + const char *getConsumableForm(ConsumableType consumableId); void notEnough(ConsumableType consumableId, PartyBank whereId, bool mode, MessageWaitType wait); @@ -305,12 +305,12 @@ public: /* * Get gender form 'picks' */ - const char* getPickLockForm(const Character &c); + const char *getPickLockForm(const Character &c); /* * Get gender form 'unable to pick' */ - const char* getUnablePickLockForm(const Character &c); + const char *getUnablePickLockForm(const Character &c); /** * Gives up to three different item/amounts to various character and/or party properties