mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Removed my previous PanicAlert translation hack. Fixed with a better method suggested by BhaaL. The translation is done by a callback in the MsgHandler routine that is set at program start. Added macros PanicAlertT, SuccessAlertT, PanicYesNoT, and AskYesNoT that are identical to the non T versions except those strings will be added by gettext to the po files to be translated. These can and should be used anywhere in the code for strings that should be translated.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6838 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -27,7 +27,11 @@ enum MSG_TYPE
|
||||
|
||||
typedef bool (*MsgAlertHandler)(const char* caption, const char* text,
|
||||
bool yes_no, int Style);
|
||||
typedef const char * (*StringTranslator)(const char* text);
|
||||
|
||||
void RegisterMsgAlertHandler(MsgAlertHandler handler);
|
||||
void RegisterStringTranslator(StringTranslator translator);
|
||||
|
||||
extern bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 4, 5)))
|
||||
@ -41,11 +45,21 @@ void SetEnableAlert(bool enable);
|
||||
#define PanicAlert(format, ...) MsgAlert("Warning", false, WARNING, format, __VA_ARGS__)
|
||||
#define PanicYesNo(format, ...) MsgAlert("Warning", true, WARNING, format, __VA_ARGS__)
|
||||
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, __VA_ARGS__)
|
||||
// Use these macros (that do the same thing) if the message should be translated.
|
||||
#define SuccessAlertT(format, ...) MsgAlert("Information", false, INFORMATION, format, __VA_ARGS__)
|
||||
#define PanicAlertT(format, ...) MsgAlert("Warning", false, WARNING, format, __VA_ARGS__)
|
||||
#define PanicYesNoT(format, ...) MsgAlert("Warning", true, WARNING, format, __VA_ARGS__)
|
||||
#define AskYesNoT(format, ...) MsgAlert("Question", true, QUESTION, format, __VA_ARGS__)
|
||||
#else
|
||||
#define SuccessAlert(format, ...) MsgAlert("Information", false, INFORMATION, format, ##__VA_ARGS__)
|
||||
#define PanicAlert(format, ...) MsgAlert("Warning", false, WARNING, format, ##__VA_ARGS__)
|
||||
#define PanicYesNo(format, ...) MsgAlert("Warning", true, WARNING, format, ##__VA_ARGS__)
|
||||
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
|
||||
// Use these macros (that do the same thing) if the message should be translated.
|
||||
#define SuccessAlertT(format, ...) MsgAlert("Information", false, INFORMATION, format, ##__VA_ARGS__)
|
||||
#define PanicAlertT(format, ...) MsgAlert("Warning", false, WARNING, format, ##__VA_ARGS__)
|
||||
#define PanicYesNoT(format, ...) MsgAlert("Warning", true, WARNING, format, ##__VA_ARGS__)
|
||||
#define AskYesNoT(format, ...) MsgAlert("Question", true, QUESTION, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
#else
|
||||
// GEKKO
|
||||
@ -53,6 +67,10 @@ void SetEnableAlert(bool enable);
|
||||
#define PanicAlert(format, ...) ;
|
||||
#define PanicYesNo(format, ...) ;
|
||||
#define AskYesNo(format, ...) ;
|
||||
#define SuccessAlertT(format, ...) ;
|
||||
#define PanicAlertT(format, ...) ;
|
||||
#define PanicYesNoT(format, ...) ;
|
||||
#define AskYesNoT(format, ...) ;
|
||||
#endif
|
||||
|
||||
#endif // _MSGHANDLER_H_
|
||||
|
Reference in New Issue
Block a user