diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2015-12-15 18:13:26 +0100 |
|---|---|---|
| committer | Markus Wick <degasus@users.noreply.github.com> | 2015-12-15 18:13:26 +0100 |
| commit | e4b83d17bf5e79351d3ceddb2f856bb048a52afc (patch) | |
| tree | b84791bb83b29865cea8e15d02de89770209a5d6 /Source/Core/Common | |
| parent | 3e2ac3df43f057fdbbdfa2bd1466e5390d850a81 (diff) | |
| parent | 74ea765427ad499dd16667d8939cb67d83dcdf04 (diff) | |
Merge pull request #3270 from JosJuice/more-translations
Mark more strings for translation
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Assert.h | 4 | ||||
| -rw-r--r-- | Source/Core/Common/MsgHandler.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/Common/MsgHandler.h | 5 |
3 files changed, 13 insertions, 1 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 |
