Stub GetLanguageCode

This commit is contained in:
Dima 2022-11-20 12:38:53 +03:00 committed by Billy Laws
parent 3e078d54b6
commit 41cf4bb12d
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,13 @@
namespace skyline::service::settings { namespace skyline::service::settings {
ISettingsServer::ISettingsServer(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} ISettingsServer::ISettingsServer(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {}
Result ISettingsServer::GetLanguageCode(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
auto systemLanguage{language::GetApplicationLanguage(*state.settings->systemLanguage)};
response.Push(language::GetLanguageCode(language::GetSystemLanguage(systemLanguage)));
return {};
}
Result ISettingsServer::GetAvailableLanguageCodes(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { Result ISettingsServer::GetAvailableLanguageCodes(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
request.outputBuf.at(0).copy_from(span(language::LanguageCodeList).first(constant::OldLanguageCodeListSize)); request.outputBuf.at(0).copy_from(span(language::LanguageCodeList).first(constant::OldLanguageCodeListSize));
response.Push<i32>(constant::OldLanguageCodeListSize); response.Push<i32>(constant::OldLanguageCodeListSize);

View File

@ -14,6 +14,12 @@ namespace skyline::service::settings {
public: public:
ISettingsServer(const DeviceState &state, ServiceManager &manager); ISettingsServer(const DeviceState &state, ServiceManager &manager);
/**
* @brief Gets the current system language
* @url https://switchbrew.org/wiki/Settings_services#GetLanguageCode
*/
Result GetLanguageCode(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/** /**
* @brief Reads the available language codes that an application can use (pre 4.0.0) * @brief Reads the available language codes that an application can use (pre 4.0.0)
*/ */
@ -45,6 +51,7 @@ namespace skyline::service::settings {
Result GetAvailableLanguageCodeCount2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); Result GetAvailableLanguageCodeCount2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
SERVICE_DECL( SERVICE_DECL(
SFUNC(0x0, ISettingsServer, GetLanguageCode),
SFUNC(0x1, ISettingsServer, GetAvailableLanguageCodes), SFUNC(0x1, ISettingsServer, GetAvailableLanguageCodes),
SFUNC(0x2, ISettingsServer, MakeLanguageCode), SFUNC(0x2, ISettingsServer, MakeLanguageCode),
SFUNC(0x3, ISettingsServer, GetAvailableLanguageCodeCount), SFUNC(0x3, ISettingsServer, GetAvailableLanguageCodeCount),