From 9dd4e71f1d85346bfeea6da860ec301e9a95423f Mon Sep 17 00:00:00 2001 From: Gallaecio Date: Tue, 22 Apr 2014 06:35:51 +0000 Subject: [PATCH] Internationalized some messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • You can now translate “The production queue is full”. • Internationalized the “Pause” and “Resume” buttons. Only the initial label was internationalized, it would switch to English as soon as you pause the game for the first time. • Internationalized the “Screenshot written to” message in the engine. This was SVN commit r14968. --- binaries/data/mods/public/gui/session/menu.js | 4 ++-- .../mods/public/simulation/components/ProductionQueue.js | 2 +- source/ps/Util.cpp | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/binaries/data/mods/public/gui/session/menu.js b/binaries/data/mods/public/gui/session/menu.js index 0b6d6421ac..442d51d45c 100644 --- a/binaries/data/mods/public/gui/session/menu.js +++ b/binaries/data/mods/public/gui/session/menu.js @@ -1,5 +1,5 @@ -const PAUSE = "Pause"; -const RESUME = "Resume"; +const PAUSE = translate("Pause"); +const RESUME = translate("Resume"); /* * MENU POSITION CONSTANTS diff --git a/binaries/data/mods/public/simulation/components/ProductionQueue.js b/binaries/data/mods/public/simulation/components/ProductionQueue.js index a18a0ad072..f97ec7ea16 100644 --- a/binaries/data/mods/public/simulation/components/ProductionQueue.js +++ b/binaries/data/mods/public/simulation/components/ProductionQueue.js @@ -342,7 +342,7 @@ ProductionQueue.prototype.AddBatch = function(templateName, type, count, metadat } else { - var notification = {"player": cmpPlayer.GetPlayerID(), "message": "The production queue is full."}; + var notification = {"player": cmpPlayer.GetPlayerID(), "message": markForTranslation("The production queue is full."), "translateMessage": true }; var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification(notification); } diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp index 6fa78a4ace..18a021def3 100644 --- a/source/ps/Util.cpp +++ b/source/ps/Util.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2014 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -35,6 +35,9 @@ #include "lib/sysdep/smbios.h" #include "lib/tex/tex.h" +#include "i18n/L10n.h" +#include "lib/utf8.h" + #include "ps/GameSetup/Config.h" #include "ps/GameSetup/GameSetup.h" #include "ps/Game.h" @@ -238,7 +241,7 @@ void WriteScreenshot(const VfsPath& extension) { OsPath realPath; g_VFS->GetRealPath(filename, realPath); - LOGMESSAGERENDER(L"Screenshot written to '%ls'", realPath.string().c_str()); + LOGMESSAGERENDER(wstring_from_utf8(L10n::Instance().Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); } else LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str()); @@ -371,7 +374,7 @@ void WriteBigScreenshot(const VfsPath& extension, int tiles) { OsPath realPath; g_VFS->GetRealPath(filename, realPath); - LOGMESSAGERENDER(L"Screenshot written to '%ls'", realPath.string().c_str()); + LOGMESSAGERENDER(wstring_from_utf8(L10n::Instance().Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); } else LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str());