summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2015-12-15 18:13:26 +0100
committerMarkus Wick <degasus@users.noreply.github.com>2015-12-15 18:13:26 +0100
commite4b83d17bf5e79351d3ceddb2f856bb048a52afc (patch)
treeb84791bb83b29865cea8e15d02de89770209a5d6 /Source/Core
parent3e2ac3df43f057fdbbdfa2bd1466e5390d850a81 (diff)
parent74ea765427ad499dd16667d8939cb67d83dcdf04 (diff)
Merge pull request #3270 from JosJuice/more-translations
Mark more strings for translation
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Assert.h4
-rw-r--r--Source/Core/Common/MsgHandler.cpp5
-rw-r--r--Source/Core/Common/MsgHandler.h5
-rw-r--r--Source/Core/Core/HW/GCPadEmu.cpp2
-rw-r--r--Source/Core/Core/State.cpp5
-rw-r--r--Source/Core/DiscIO/CompressedBlob.cpp9
-rw-r--r--Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp10
-rw-r--r--Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp32
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp6
-rw-r--r--Source/Core/DolphinWX/GameListCtrl.cpp4
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.cpp6
11 files changed, 50 insertions, 38 deletions
diff --git a/Source/Core/Common/Assert.h b/Source/Core/Common/Assert.h
index 0b359433ff..5114808e7e 100644
--- a/Source/Core/Common/Assert.h
+++ b/Source/Core/Common/Assert.h
@@ -4,6 +4,7 @@
#pragma once
+#include "Common/Common.h"
#include "Common/CommonFuncs.h"
#include "Common/MsgHandler.h"
#include "Common/Logging/Log.h"
@@ -37,7 +38,8 @@
#endif
#define _assert_(_a_) \
- _assert_msg_(MASTER_LOG, _a_, "Error...\n\n Line: %d\n File: %s\n\nIgnore and continue?", \
+ _assert_msg_(MASTER_LOG, _a_, \
+ _trans("An error occurred.\n\n Line: %d\n File: %s\n\nIgnore and continue?"), \
__LINE__, __FILE__)
#define _dbg_assert_(_t_, _a_) \
diff --git a/Source/Core/Common/MsgHandler.cpp b/Source/Core/Common/MsgHandler.cpp
index 075196ced2..e73efe9020 100644
--- a/Source/Core/Common/MsgHandler.cpp
+++ b/Source/Core/Common/MsgHandler.cpp
@@ -38,6 +38,11 @@ void SetEnableAlert(bool enable)
AlertEnabled = enable;
}
+std::string GetTranslation(const char* string)
+{
+ return str_translator(string);
+}
+
// This is the first stop for gui alerts where the log is updated and the
// correct window is shown
bool MsgAlert(bool yes_no, int Style, const char* format, ...)
diff --git a/Source/Core/Common/MsgHandler.h b/Source/Core/Common/MsgHandler.h
index bf080c5a81..f289486c02 100644
--- a/Source/Core/Common/MsgHandler.h
+++ b/Source/Core/Common/MsgHandler.h
@@ -22,6 +22,7 @@ typedef std::string (*StringTranslator)(const char* text);
void RegisterMsgAlertHandler(MsgAlertHandler handler);
void RegisterStringTranslator(StringTranslator translator);
+std::string GetTranslation(const char* string);
bool MsgAlert(bool yes_no, int Style, const char* format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 3, 4)))
@@ -41,6 +42,8 @@ void SetEnableAlert(bool enable);
#define PanicYesNoT(format, ...) MsgAlert(true, WARNING, format, __VA_ARGS__)
#define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, __VA_ARGS__)
#define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, __VA_ARGS__)
+
+ #define GetStringT(string) GetTranslation(string)
#else
#define SuccessAlert(format, ...) MsgAlert(false, INFORMATION, format, ##__VA_ARGS__)
#define PanicAlert(format, ...) MsgAlert(false, WARNING, format, ##__VA_ARGS__)
@@ -53,4 +56,6 @@ void SetEnableAlert(bool enable);
#define PanicYesNoT(format, ...) MsgAlert(true, WARNING, format, ##__VA_ARGS__)
#define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__)
#define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__)
+
+ #define GetStringT(string) GetTranslation(string)
#endif
diff --git a/Source/Core/Core/HW/GCPadEmu.cpp b/Source/Core/Core/HW/GCPadEmu.cpp
index 8069e8f06c..66f90594a7 100644
--- a/Source/Core/Core/HW/GCPadEmu.cpp
+++ b/Source/Core/Core/HW/GCPadEmu.cpp
@@ -36,7 +36,7 @@ static const char* const named_buttons[] =
"Y",
"Z",
_trans("Start"),
- "Mic"
+ _trans("Mic")
};
static const char* const named_triggers[] =
diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp
index a83e54a2a2..a346c2ed96 100644
--- a/Source/Core/Core/State.cpp
+++ b/Source/Core/Core/State.cpp
@@ -9,6 +9,7 @@
#include "Common/CommonTypes.h"
#include "Common/Event.h"
+#include "Common/MsgHandler.h"
#include "Common/ScopeGuard.h"
#include "Common/StringUtil.h"
#include "Common/Thread.h"
@@ -452,11 +453,11 @@ std::string GetInfoStringOfSlot(int slot)
{
std::string filename = MakeStateFilename(slot);
if (!File::Exists(filename))
- return "Empty";
+ return GetStringT("Empty");
State::StateHeader header;
if (!ReadHeader(filename, header))
- return "Unknown";
+ return GetStringT("Unknown");
return Common::Timer::GetDateTimeFormatted(header.time);
}
diff --git a/Source/Core/DiscIO/CompressedBlob.cpp b/Source/Core/DiscIO/CompressedBlob.cpp
index a947f944e4..e41642d483 100644
--- a/Source/Core/DiscIO/CompressedBlob.cpp
+++ b/Source/Core/DiscIO/CompressedBlob.cpp
@@ -182,7 +182,7 @@ bool CompressFileToBlob(const std::string& infile, const std::string& outfile, u
return false;
}
- callback("Files opened, ready to compress.", 0, arg);
+ callback(GetStringT("Files opened, ready to compress."), 0, arg);
CompressedBlobHeader header;
header.magic_cookie = kBlobCookie;
@@ -219,7 +219,8 @@ bool CompressFileToBlob(const std::string& infile, const std::string& outfile, u
if (inpos != 0)
ratio = (int)(100 * position / inpos);
- std::string temp = StringFromFormat("%i of %i blocks. Compression ratio %i%%", i, header.num_blocks, ratio);
+ std::string temp = StringFromFormat(GetStringT("%i of %i blocks. Compression ratio %i%%").c_str(),
+ i, header.num_blocks, ratio);
bool was_cancelled = !callback(temp, (float)i / (float)header.num_blocks, arg);
if (was_cancelled)
{
@@ -312,7 +313,7 @@ bool CompressFileToBlob(const std::string& infile, const std::string& outfile, u
if (success)
{
- callback("Done compressing disc image.", 1.0f, arg);
+ callback(GetStringT("Done compressing disc image."), 1.0f, arg);
}
return success;
}
@@ -355,7 +356,7 @@ bool DecompressBlobToFile(const std::string& infile, const std::string& outfile,
{
if (i % progress_monitor == 0)
{
- bool was_cancelled = !callback("Unpacking", (float)i / (float)num_buffers, arg);
+ bool was_cancelled = !callback(GetStringT("Unpacking"), (float)i / (float)num_buffers, arg);
if (was_cancelled)
{
success = false;
diff --git a/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp b/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp
index 721a1eecc3..db6a22751f 100644
--- a/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp
+++ b/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp
@@ -30,11 +30,11 @@
#define EXIDEV_MEMCARD_STR _trans("Memory Card")
#define EXIDEV_MEMDIR_STR _trans("GCI Folder")
-#define EXIDEV_MIC_STR _trans("Mic")
-#define EXIDEV_BBA_STR "BBA"
-#define EXIDEV_AGP_STR "Advance Game Port"
-#define EXIDEV_AM_BB_STR _trans("AM-Baseboard")
-#define EXIDEV_GECKO_STR "USBGecko"
+#define EXIDEV_MIC_STR _trans("Microphone")
+#define EXIDEV_BBA_STR _trans("Broadband Adapter")
+#define EXIDEV_AGP_STR _trans("Advance Game Port")
+#define EXIDEV_AM_BB_STR _trans("AM Baseboard")
+#define EXIDEV_GECKO_STR _trans("USB Gecko")
GameCubeConfigPane::GameCubeConfigPane(wxWindow* parent, wxWindowID id)
: wxPanel(parent, id)
diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
index a6432edecb..c894c6b9ce 100644
--- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
+++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
@@ -285,7 +285,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
const wxString path = wxFileSelector(
_("Load map file"), File::GetUserPath(D_MAPS_IDX),
title_id_str + ".map", ".map",
- "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
+ _("Dolphin Map File (*.map)") + "|*.map|" + wxGetTranslation(wxALL_FILES),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path.IsEmpty())
@@ -302,7 +302,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
const wxString path = wxFileSelector(
_("Load bad map file"), File::GetUserPath(D_MAPS_IDX),
title_id_str + ".map", ".map",
- "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
+ _("Dolphin Map File (*.map)") + "|*.map|" + wxGetTranslation(wxALL_FILES),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path.IsEmpty())
@@ -322,7 +322,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
const wxString path = wxFileSelector(
_("Save map file as"), File::GetUserPath(D_MAPS_IDX),
title_id_str + ".map", ".map",
- "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*",
+ _("Dolphin Map File (*.map)") + "|*.map|" + wxGetTranslation(wxALL_FILES),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this);
if (!path.IsEmpty())
@@ -338,7 +338,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
const wxString path = wxFileSelector(
_("Apply signature file"), wxEmptyString,
wxEmptyString, wxEmptyString,
- "Dolphin Symbol Rename File (*.sym)|*.sym",
+ _("Dolphin Symbol Rename File (*.sym)") + "|*.sym|" + wxGetTranslation(wxALL_FILES),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path.IsEmpty())
@@ -382,8 +382,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
wxString path = wxFileSelector(
_("Save signature as"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this);
if (!path.IsEmpty())
{
SignatureDB db;
@@ -408,8 +408,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
wxString path = wxFileSelector(
_("Append signature to"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_SAVE, this);
if (!path.IsEmpty())
{
SignatureDB db;
@@ -426,8 +426,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
wxString path = wxFileSelector(
_("Apply signature file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path.IsEmpty())
{
SignatureDB db;
@@ -442,15 +442,15 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
wxString path1 = wxFileSelector(
_("Choose priority input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path1.IsEmpty())
{
SignatureDB db;
wxString path2 = wxFileSelector(
_("Choose secondary input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString,
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST, this);
if (!path2.IsEmpty())
{
db.Load(WxStrToStr(path2));
@@ -458,8 +458,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
path2 = wxFileSelector(
_("Save combined output file as"), File::GetSysDirectory(), wxEmptyString, ".dsy",
- "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
- this);
+ _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + wxGetTranslation(wxALL_FILES),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this);
db.Save(WxStrToStr(path2));
db.List();
}
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index d5d5c7e6bb..da1301fb13 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -1451,14 +1451,12 @@ void CFrame::OnImportSave(wxCommandEvent& WXUNUSED (event))
{
wxString path = wxFileSelector(_("Select the save file"),
wxEmptyString, wxEmptyString, wxEmptyString,
- _("Wii save files (*.bin)|*.bin"),
+ _("Wii save files (*.bin)") + "|*.bin|" + wxGetTranslation(wxALL_FILES),
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
if (!path.IsEmpty())
- {
CWiiSaveCrypted::ImportWiiSave(WxStrToStr(path));
- }
}
void CFrame::OnShowCheatsWindow(wxCommandEvent& WXUNUSED (event))
@@ -1493,7 +1491,7 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
wxString path = wxFileSelector(
_("Select a Wii WAD file to install"),
wxEmptyString, wxEmptyString, wxEmptyString,
- "Wii WAD file (*.wad)|*.wad",
+ _("Wii WAD files (*.wad)") + "|*.wad|" + wxGetTranslation(wxALL_FILES),
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
fileName = WxStrToStr(path);
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp
index 2164b6dcca..1ad6849f41 100644
--- a/Source/Core/DolphinWX/GameListCtrl.cpp
+++ b/Source/Core/DolphinWX/GameListCtrl.cpp
@@ -1030,7 +1030,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
if (!iso)
return;
if (wxMessageBox(_("Are you sure you want to delete this file? It will be gone forever!"),
- wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION) == wxYES)
+ _("Warning"), wxYES_NO | wxICON_EXCLAMATION) == wxYES)
{
File::Delete(iso->GetFileName());
Update();
@@ -1039,7 +1039,7 @@ void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event))
else
{
if (wxMessageBox(_("Are you sure you want to delete these files?\nThey will be gone forever!"),
- wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION) == wxYES)
+ _("Warning"), wxYES_NO | wxICON_EXCLAMATION) == wxYES)
{
int selected = GetSelectedItemCount();
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp
index 3f2bd68eb3..000711b19e 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -77,8 +77,8 @@ static void InterpretDisplayListPreprocess(u32 address, u32 size)
static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
{
// TODO(Omega): Maybe dump FIFO to file on this error
- PanicAlert(
- "GFX FIFO: Unknown Opcode (0x%02x @ %p, preprocessing=%s).\n"
+ PanicAlertT(
+ "GFX FIFO: Unknown Opcode (0x%02x @ %p, %s).\n"
"This means one of the following:\n"
"* The emulated GPU got desynced, disabling dual core can help\n"
"* Command stream corrupted by some spurious memory bug\n"
@@ -88,7 +88,7 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
"Dolphin will now likely crash or hang. Enjoy." ,
cmd_byte,
buffer,
- preprocess ? "yes" : "no");
+ preprocess ? "preprocess=true" : "preprocess=false");
{
SCPFifoStruct &fifo = CommandProcessor::fifo;