diff options
author | Johannes Schickel | 2011-08-20 19:36:54 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-08-20 19:36:54 +0200 |
commit | 59200bf426cc85b9ec49865010a035ce214bb2bd (patch) | |
tree | b8e7237896fa47827024e6f599ac37da1062912e /common | |
parent | 5a1f75eae3a1d15bf0c610d2468a2afef30a893b (diff) | |
download | scummvm-rg350-59200bf426cc85b9ec49865010a035ce214bb2bd.tar.gz scummvm-rg350-59200bf426cc85b9ec49865010a035ce214bb2bd.tar.bz2 scummvm-rg350-59200bf426cc85b9ec49865010a035ce214bb2bd.zip |
SCUMM: Fix compilation when translation support is disabled.
For this I added a convenience version of getLanguageYesNo, which works on the
currently setup GUI translation language. All other code which requires this
acan also use it instead of having to worry about the USE_TRANSLATION and thus
having two code paths.
Diffstat (limited to 'common')
-rw-r--r-- | common/localization.cpp | 9 | ||||
-rw-r--r-- | common/localization.h | 21 |
2 files changed, 28 insertions, 2 deletions
diff --git a/common/localization.cpp b/common/localization.cpp index c4c76c3b99..afd31b8d22 100644 --- a/common/localization.cpp +++ b/common/localization.cpp @@ -20,6 +20,7 @@ */ #include "common/localization.h" +#include "common/translation.h" namespace Common { @@ -54,4 +55,12 @@ void getLanguageYesNo(Language id, KeyCode &keyYes, KeyCode &keyNo) { } } +void getLanguageYesNo(KeyCode &keyYes, KeyCode &keyNo) { +#ifdef USE_TRANSLATION + getLanguageYesNo(Common::parseLanguageFromLocale(TransMan.getCurrentLanguage().c_str()), keyYes, keyNo); +#else + getLanguageYesNo(Common::EN_ANY, keyYes, keyNo); +#endif +} + } // End of namespace Common diff --git a/common/localization.h b/common/localization.h index 879c31c1c7..3945cf5fab 100644 --- a/common/localization.h +++ b/common/localization.h @@ -27,9 +27,26 @@ namespace Common { -/** Get localized equivalents for Y/N buttons */ +/** + * Get localized equivalents for Y/N buttons of the specified language. In + * case there is no specialized keys for the given language it will fall back + * to the English keys. + * + * @param id Language id + * @param keyYes Key code for yes + * @param keyYes Key code for no + */ void getLanguageYesNo(Language id, KeyCode &keyYes, KeyCode &keyNo); -} // End of namespace Common +/** + * Get localized equivalents for Y/N buttons of the current translation + * language of the ScummVM GUI. + * + * @param keyYes Key code for yes + * @param keyYes Key code for no + */ +void getLanguageYesNo(KeyCode &keyYes, KeyCode &keyNo); + +} // End of namespace Common #endif |