[Scummvm-git-logs] scummvm master -> 5a313198532b96aacfe5ed9637a9f0fbf76f8a93
rsn8887
rsn8887 at users.noreply.github.com
Sat Nov 7 03:40:06 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5a31319853 SWITCH: Implement OSystem_Switch::getSystemLanguage()
Commit: 5a313198532b96aacfe5ed9637a9f0fbf76f8a93
https://github.com/scummvm/scummvm/commit/5a313198532b96aacfe5ed9637a9f0fbf76f8a93
Author: Matthieu Milan (usineur0 at gmail.com)
Date: 2020-11-06T21:40:01-06:00
Commit Message:
SWITCH: Implement OSystem_Switch::getSystemLanguage()
Changed paths:
backends/platform/sdl/switch/switch.cpp
backends/platform/sdl/switch/switch.h
diff --git a/backends/platform/sdl/switch/switch.cpp b/backends/platform/sdl/switch/switch.cpp
index d67a8288ad..f4b3eb2885 100644
--- a/backends/platform/sdl/switch/switch.cpp
+++ b/backends/platform/sdl/switch/switch.cpp
@@ -22,6 +22,8 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+#include <switch.h>
+
#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/translation.h"
@@ -164,3 +166,29 @@ Common::HardwareInputSet *OSystem_Switch::getHardwareInputSet() {
return inputSet;
}
+
+Common::String OSystem_Switch::getSystemLanguage() const {
+ u64 lang;
+ SetLanguage langcode;
+
+ setInitialize();
+ setGetSystemLanguage(&lang);
+ setMakeLanguage(lang, &langcode);
+
+ switch (langcode) {
+ case SetLanguage_JA: return "ja_JP";
+ case SetLanguage_ENUS: return "en_US";
+ case SetLanguage_FR: return "fr_FR";
+ case SetLanguage_FRCA: return "fr_FR";
+ case SetLanguage_DE: return "de_DE";
+ case SetLanguage_IT: return "it_IT";
+ case SetLanguage_ES: return "es_ES";
+ case SetLanguage_ZHCN: return "zh_CN";
+ case SetLanguage_KO: return "ko_KR";
+ case SetLanguage_NL: return "nl_NL";
+ case SetLanguage_PT: return "pt_PT";
+ case SetLanguage_RU: return "ru_RU";
+ case SetLanguage_ZHTW: return "zh_HK";
+ default: return "en_US";
+ }
+}
diff --git a/backends/platform/sdl/switch/switch.h b/backends/platform/sdl/switch/switch.h
index ea2a21f652..a4cec06267 100644
--- a/backends/platform/sdl/switch/switch.h
+++ b/backends/platform/sdl/switch/switch.h
@@ -34,6 +34,7 @@ public:
virtual bool getFeatureState(Feature f) override;
virtual void logMessage(LogMessageType::Type type, const char *message) override;
virtual Common::HardwareInputSet *getHardwareInputSet() override;
+ virtual Common::String getSystemLanguage() const;
protected:
virtual Common::String getDefaultLogFileName() override;
More information about the Scummvm-git-logs
mailing list