diff options
| author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-06-05 15:39:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-05 15:39:33 -0400 |
| commit | 2beaaa35c5002f762e82757b8db70a687e4faa7a (patch) | |
| tree | ee7d89a593226e207871fe320679980df327ef7c /src/core/hle/service/ns/language.h | |
| parent | 1eb979221f6664938456cefdbd5c79b7e59e2b8c (diff) | |
| parent | 016f2eab730ef9eb5035cd9217e6a8b0ace696ae (diff) | |
Merge pull request #2510 from SciresM/desired_language
Implement/Fix IApplicationFunctions::GetDesiredLanguage
Diffstat (limited to 'src/core/hle/service/ns/language.h')
| -rw-r--r-- | src/core/hle/service/ns/language.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/core/hle/service/ns/language.h b/src/core/hle/service/ns/language.h new file mode 100644 index 000000000..e9829f9d2 --- /dev/null +++ b/src/core/hle/service/ns/language.h @@ -0,0 +1,45 @@ +// Copyright 2019 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <optional> +#include <string> +#include "common/common_types.h" + +namespace Service::Set { +enum class LanguageCode : u64; +} + +namespace Service::NS { +/// This is nn::ns::detail::ApplicationLanguage +enum class ApplicationLanguage : u8 { + AmericanEnglish = 0, + BritishEnglish, + Japanese, + French, + German, + LatinAmericanSpanish, + Spanish, + Italian, + Dutch, + CanadianFrench, + Portuguese, + Russian, + Korean, + TraditionalChinese, + SimplifiedChinese, + Count +}; +using ApplicationLanguagePriorityList = + const std::array<ApplicationLanguage, static_cast<std::size_t>(ApplicationLanguage::Count)>; + +constexpr u32 GetSupportedLanguageFlag(const ApplicationLanguage lang) { + return 1U << static_cast<u32>(lang); +} + +const ApplicationLanguagePriorityList* GetApplicationLanguagePriorityList(ApplicationLanguage lang); +std::optional<ApplicationLanguage> ConvertToApplicationLanguage(Set::LanguageCode language_code); +std::optional<Set::LanguageCode> ConvertToLanguageCode(ApplicationLanguage lang); +} // namespace Service::NS
\ No newline at end of file |
