mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Added support for per-language menu scaling
This commit is contained in:
parent
dfc217d006
commit
661bb5d539
|
@ -27,6 +27,10 @@ namespace Utils
|
|||
{
|
||||
namespace Localization
|
||||
{
|
||||
const std::vector<std::pair<std::string, std::string>> sSupportedLocales {{{"en"}, {"US"}},
|
||||
{{"sv"}, {"SE"}}};
|
||||
float sMenuScaleFactor {1.0f};
|
||||
|
||||
std::pair<std::string, std::string> getLocale()
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
|
@ -86,6 +90,7 @@ namespace Utils
|
|||
}
|
||||
}
|
||||
|
||||
sMenuScaleFactor = 1.0f;
|
||||
std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")};
|
||||
std::vector<std::string> localeVector;
|
||||
std::pair<std::string, std::string> localePair;
|
||||
|
@ -133,6 +138,10 @@ namespace Utils
|
|||
locale = "en_US";
|
||||
}
|
||||
|
||||
// Language-specific menu scale factor.
|
||||
if (localePair.first == "sv")
|
||||
sMenuScaleFactor = 1.02f;
|
||||
|
||||
std::string localePath;
|
||||
localePath.append("/")
|
||||
.append(locale)
|
||||
|
|
|
@ -20,8 +20,8 @@ namespace Utils
|
|||
{
|
||||
namespace Localization
|
||||
{
|
||||
static inline std::vector<std::pair<std::string, std::string>> sSupportedLocales {
|
||||
{{"en"}, {"US"}}, {{"sv"}, {"SE"}}};
|
||||
extern const std::vector<std::pair<std::string, std::string>> sSupportedLocales;
|
||||
extern float sMenuScaleFactor;
|
||||
|
||||
std::pair<std::string, std::string> getLocale();
|
||||
void setLocale();
|
||||
|
|
Loading…
Reference in a new issue