moved the translator init code earlier; added some translation support for the code of r2517 and r2907; updated some Chinese translation.

This commit is contained in:
linshier
2011-01-31 14:21:46 +00:00
parent 6bf8a1209d
commit 6bde3d0ee6
7 changed files with 85 additions and 39 deletions
+37 -6
View File
@@ -1,5 +1,5 @@
#LANG:Chinese #LANG:Chinese
#Wagic 0.12.1 简体中文语言文件 by linshier and Phantom #Wagic 0.14.1 简体中文语言文件 by linshier and Phantom
#Note: #Note:
# - Limitation: Special characters that are not in the limited GB2312 # - Limitation: Special characters that are not in the limited GB2312
@@ -118,7 +118,7 @@ NO DECK AVAILABLE,=û
PRESS CIRCLE TO GO TO THE DECK EDITOR!=按○键返回套牌编辑界面! PRESS CIRCLE TO GO TO THE DECK EDITOR!=按○键返回套牌编辑界面!
# Opponent deck menu: # Opponent deck menu:
Choose Your Opponent=选择对手 Choose Opponent=选择对手
##(easy)=(简单) ##(easy)=(简单)
##(hard)=(困难) ##(hard)=(困难)
Random=随机 Random=随机
@@ -126,6 +126,7 @@ Random=
LOADING DECKS=加载套牌 LOADING DECKS=加载套牌
Can you play against yourself?=你能击败你自己吗? Can you play against yourself?=你能击败你自己吗?
Choose a different player deck=重新选择一个套牌进行游戏 Choose a different player deck=重新选择一个套牌进行游戏
Detailed Info=详细信息
########################## ##########################
@@ -164,8 +165,9 @@ Cleanup=
# Interrupts: # Interrupts:
Interrupt?=是否获得优先权? Interrupt?=是否获得优先权?
X Interrupt - 0 No - [] No to All=按×键确认-○键让过-□键让过所有 : Interrupt=获得优先权
X Interrupt - 0 No=按×键确认-○键让过 : No=让过
: No To All=让过所有
# Stack: # Stack:
Deals %i damage to=造成%i点伤害-> Deals %i damage to=造成%i点伤害->
@@ -221,6 +223,7 @@ Doesnotuntap=
Double strike=连击 Double strike=连击
Exalted=颂威 Exalted=颂威
First strike=先攻 First strike=先攻
Flanking=侧面攻击
Flying=飞行 Flying=飞行
Foresthome=树林居者 Foresthome=树林居者
Forestwalk=树林行者 Forestwalk=树林行者
@@ -260,6 +263,7 @@ Retrace=׷
Shadow=次元幽影 Shadow=次元幽影
Shroud=帷幕 Shroud=帷幕
Storm=风暴 Storm=风暴
Sunburst=晖映
Swamphome=沼泽居者 Swamphome=沼泽居者
Swampwalk=沼泽行者 Swampwalk=沼泽行者
Trample=践踏 Trample=践踏
@@ -632,13 +636,34 @@ Victories against AI:=
Games played: %i=游戏场数: Games played: %i=游戏场数:
Victory ratio: %i%%=胜率:%i%% Victory ratio: %i%%=胜率:%i%%
# Statistics - menu:
------- Deck Summary -----= ----- 套牌数据摘要 ----- 
Cards: =总卡牌:
Creatures: =生物:
Enchantments: = 结界:
Instants: =瞬间:
Sorceries: = 法术:
Lands: =地:
A: =总
G: =绿
R: =红
U: =蓝
B: =黑
W: =白
--- Card color count --- = ----- 卡牌颜色费用 ----- 
--- Average Cost --- = ----- 卡牌平均费用 ----- 
Creature: =生物:
Mana: =非地:
Spell: =咒语:
########################## ##########################
# SHOP # # SHOP #
########################## ##########################
credits: %i=积分点数:%i ##credits: %i=积分点数:%i
[]:other cards=按□键查看其他卡牌 Credits: =积分点数:
: Other cards=查看其他卡牌
%s & %s (15 Cards)=补充包%s+%s(共15张) %s & %s (15 Cards)=补充包%s+%s(共15张)
%s Booster (15 Cards)=补充包%s(共15张) %s Booster (15 Cards)=补充包%s(共15张)
%s (%i)=%s(限%i张) %s (%i)=%s(限%i张)
@@ -765,6 +790,8 @@ Minimum Card Grade=
-3: Unsupported= -3:不支持的 -3: Unsupported= -3:不支持的
-4: Dangerous (risk of crash)= -4:危险的 -4: Dangerous (risk of crash)= -4:危险的
Phase Skip Automation=回合阶段自动跳过 Phase Skip Automation=回合阶段自动跳过
First Turn Player=第一回合先手
Opponent=对手
Off=关 Off=关
On=开 On=开
@@ -983,6 +1010,7 @@ Elemental=Ԫ
Elephant=象 Elephant=象
Elf=妖精 Elf=妖精
Elk=麋鹿 Elk=麋鹿
Eight-and-a-half-tails=八尾半
Eye=眼 Eye=眼
Faerie=仙灵 Faerie=仙灵
Ferret=雪貂 Ferret=雪貂
@@ -999,12 +1027,14 @@ Goblin=
Golem=魔像 Golem=魔像
Gorgon=蛇发妖 Gorgon=蛇发妖
Graveborn=墓生兽 Graveborn=墓生兽
Gremlin=怪灵
Griffin=狮鹫 Griffin=狮鹫
Hag=巫婆 Hag=巫婆
Harpy=哈痞 Harpy=哈痞
Hellion=地狱兽 Hellion=地狱兽
Hippo=河马 Hippo=河马
Homarid=荷马利 Homarid=荷马利
Homnuculus=造妖
Homunculus=造妖 Homunculus=造妖
Horror=惊惧兽 Horror=惊惧兽
Horse=马 Horse=马
@@ -1053,6 +1083,7 @@ Ninja=
Noggle=诺格 Noggle=诺格
Nomad=游牧人 Nomad=游牧人
Octopus=章鱼 Octopus=章鱼
Oculus=眼球妖
Ogre=食人魔 Ogre=食人魔
Ooze=流浆 Ooze=流浆
Orb=法球 Orb=法球
+12 -5
View File
@@ -21,9 +21,10 @@ namespace
{ {
float kGamepadIconSize = 0.5f; float kGamepadIconSize = 0.5f;
const std::string kInterruptString(": Interrupt"); std::string kInterruptMessageString("Interrupt?");
const std::string kNoString(": No"); std::string kInterruptString(": Interrupt");
const std::string kNoToAllString(": No To All"); std::string kNoString(": No");
std::string kNoToAllString(": No To All");
} }
/* /*
@@ -636,6 +637,12 @@ ActionStack::ActionStack(GameObserver* game)
pspIcons[i] = WResourceManager::Instance()->RetrieveQuad("iconspsp.png", (float) i * 32, 0, 32, 32, stream.str(), RETRIEVE_MANAGE); pspIcons[i] = WResourceManager::Instance()->RetrieveQuad("iconspsp.png", (float) i * 32, 0, 32, 32, stream.str(), RETRIEVE_MANAGE);
pspIcons[i]->SetHotSpot(16, 16); pspIcons[i]->SetHotSpot(16, 16);
} }
// fix for translation.
kInterruptMessageString = _(kInterruptMessageString);
kInterruptString = _(kInterruptString);
kNoString = _(kNoString);
kNoToAllString = _(kNoToAllString);
} }
int ActionStack::has(MTGAbility * ability) int ActionStack::has(MTGAbility * ability)
@@ -1101,9 +1108,9 @@ void ActionStack::Render()
// Mootpoint 01/12/2011: draw the interrupt text first, at the top. Offset the rest of the // Mootpoint 01/12/2011: draw the interrupt text first, at the top. Offset the rest of the
// unresolved stack effects down so that they don't collide with the interrupt text. // unresolved stack effects down so that they don't collide with the interrupt text.
if (options[Options::INTERRUPT_SECONDS].number == 0) if (options[Options::INTERRUPT_SECONDS].number == 0)
stream << "Interrupt?"; stream << kInterruptMessageString;
else else
stream << "Interrupt? " << static_cast<int>(timer); stream << kInterruptMessageString << " " << static_cast<int>(timer);
mFont->DrawString(stream.str(), x0 + 5, currenty); mFont->DrawString(stream.str(), x0 + 5, currenty);
+25 -24
View File
@@ -5,6 +5,7 @@
#include "JTypes.h" #include "JTypes.h"
#include "GameApp.h" #include "GameApp.h"
#include <iomanip> #include <iomanip>
#include "Translate.h"
DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const char * _title, DeckDataWrapper *_selectedDeck, StatsWrapper *stats) : DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const char * _title, DeckDataWrapper *_selectedDeck, StatsWrapper *stats) :
DeckMenu(id, listener, fontId, _title), selectedDeck(_selectedDeck), stw(stats) DeckMenu(id, listener, fontId, _title), selectedDeck(_selectedDeck), stw(stats)
@@ -64,31 +65,31 @@ void DeckEditorMenu::drawDeckStatistics()
ostringstream deckStatsString; ostringstream deckStatsString;
deckStatsString deckStatsString
<< "------- Deck Summary -----" << endl << _("------- Deck Summary -----") << endl
<< "Cards: "<< stw->cardCount << endl << _("Cards: ") << stw->cardCount << endl
<< "Creatures: "<< setw(2) << stw->countCreatures << _("Creatures: ") << setw(2) << stw->countCreatures
<< " Enchantments: " << stw->countEnchantments << endl << _(" Enchantments: ") << stw->countEnchantments << endl
<< "Instants: " << setw(4) << stw->countInstants << _("Instants: ") << setw(4) << stw->countInstants
<< " Sorceries: " << setw(2) << stw->countSorceries << endl << _(" Sorceries: ") << setw(2) << stw->countSorceries << endl
<< "Lands: " << _("Lands: ")
<< "A: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_ARTIFACT ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_ARTIFACT ] << " " << _("A: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_ARTIFACT ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_ARTIFACT ] << " "
<< "G: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_GREEN ] + stw->countLandsPerColor[ Constants::MTG_COLOR_GREEN ] << " " << _("G: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_GREEN ] + stw->countLandsPerColor[ Constants::MTG_COLOR_GREEN ] << " "
<< "R: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_RED ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_RED ] << " " << _("R: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_RED ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_RED ] << " "
<< "U: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_BLUE ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_BLUE ] << " " << _("U: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_BLUE ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_BLUE ] << " "
<< "B: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_BLACK ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_BLACK ] << " " << _("B: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_BLACK ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_BLACK ] << " "
<< "W: " << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_WHITE ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_WHITE ] << endl << _("W: ") << setw(2) << left << stw->countLandsPerColor[ Constants::MTG_COLOR_WHITE ] + stw->countBasicLandsPerColor[ Constants::MTG_COLOR_WHITE ] << endl
<< " --- Card color count --- " << endl << _(" --- Card color count --- ") << endl
<< "A: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_ARTIFACT) << " " << _("A: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_ARTIFACT) << " "
<< "G: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_GREEN) << " " << _("G: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_GREEN) << " "
<< "U: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_BLUE) << " " << _("U: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_BLUE) << " "
<< "R: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_RED) << " " << _("R: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_RED) << " "
<< "B: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_BLACK) << " " << _("B: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_BLACK) << " "
<< "W: " << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_WHITE) << endl << _("W: ") << setw(2) << left << selectedDeck->getCount(Constants::MTG_COLOR_WHITE) << endl
<< " --- Average Cost --- " << endl << _(" --- Average Cost --- ") << endl
<< "Creature: "<< setprecision(2) << stw->avgCreatureCost << endl << _("Creature: ") << setprecision(2) << stw->avgCreatureCost << endl
<< "Mana: " << setprecision(2) << stw->avgManaCost << " " << _("Mana: ") << setprecision(2) << stw->avgManaCost << " "
<< "Spell: " << setprecision(2) << stw->avgSpellCost << endl; << _("Spell: ") << setprecision(2) << stw->avgSpellCost << endl;
WFont *mainFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); WFont *mainFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mainFont->DrawString(deckStatsString.str().c_str(), descX, descY + 25); mainFont->DrawString(deckStatsString.str().c_str(), descX, descY + 25);
+1 -1
View File
@@ -200,7 +200,7 @@ void DeckMenu::Render()
if (showDetailsScreen()) if (showDetailsScreen())
{ {
float pspIconsSize = 0.5; float pspIconsSize = 0.5;
const string detailedInfoString = "Detailed Info"; const string detailedInfoString = _("Detailed Info");
float stringWidth = mainFont->GetStringWidth(detailedInfoString.c_str()); float stringWidth = mainFont->GetStringWidth(detailedInfoString.c_str());
float boxStartX = detailedInfoBoxX - stringWidth / 2; float boxStartX = detailedInfoBoxX - stringWidth / 2;
DWORD currentColor = mainFont->GetColor(); DWORD currentColor = mainFont->GetColor();
+2
View File
@@ -181,6 +181,8 @@ void GameApp::Create()
string lang = options[Options::LANG].str; string lang = options[Options::LANG].str;
std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower); std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower);
WResourceManager::Instance()->InitFonts(lang); WResourceManager::Instance()->InitFonts(lang);
Translator::GetInstance()->init();
// The translator is ready now.
LOG("--Loading various textures"); LOG("--Loading various textures");
WResourceManager::Instance()->RetrieveTexture("phasebar.png", RETRIEVE_MANAGE); WResourceManager::Instance()->RetrieveTexture("phasebar.png", RETRIEVE_MANAGE);
+2 -1
View File
@@ -465,7 +465,8 @@ void GameStateMenu::Update(float dt)
if (primitivesLoadCounter == -1) if (primitivesLoadCounter == -1)
{ {
listPrimitives(); listPrimitives();
Translator::GetInstance()->init(); // Move translator init to GameApp::Create().
// Translator::GetInstance()->init();
} }
if (primitivesLoadCounter < (int) (primitives.size())) if (primitivesLoadCounter < (int) (primitives.size()))
{ {
+6 -2
View File
@@ -29,7 +29,8 @@ float GameStateShop::_y4[] = { 169, 188, 250, 182, 182, 168, 220, 208, 198, 259,
namespace namespace
{ {
float kGamepadIconSize = 0.5f; float kGamepadIconSize = 0.5f;
const std::string kOtherCardsString(": Other cards"); std::string kOtherCardsString(": Other cards");
std::string kCreditsString("Credits: ");
} }
@@ -74,6 +75,9 @@ GameStateShop::GameStateShop(GameApp* parent) :
mCounts[i] = 0; mCounts[i] = 0;
} }
mTouched = false; mTouched = false;
kOtherCardsString = _(kOtherCardsString);
kCreditsString = _(kCreditsString);
} }
GameStateShop::~GameStateShop() GameStateShop::~GameStateShop()
@@ -731,7 +735,7 @@ void GameStateShop::Render()
//Render the info bar //Render the info bar
r->FillRect(0, SCREEN_HEIGHT - 17, SCREEN_WIDTH, 17, ARGB(128,0,0,0)); r->FillRect(0, SCREEN_HEIGHT - 17, SCREEN_WIDTH, 17, ARGB(128,0,0,0));
std::ostringstream stream; std::ostringstream stream;
stream << "Credits: " << playerdata->credits; stream << kCreditsString << playerdata->credits;
mFont->SetColor(ARGB(255,255,255,255)); mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(stream.str(), 5, SCREEN_HEIGHT - 14); mFont->DrawString(stream.str(), 5, SCREEN_HEIGHT - 14);