mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +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
|
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()
|
std::pair<std::string, std::string> getLocale()
|
||||||
{
|
{
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
|
@ -86,6 +90,7 @@ namespace Utils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sMenuScaleFactor = 1.0f;
|
||||||
std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")};
|
std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")};
|
||||||
std::vector<std::string> localeVector;
|
std::vector<std::string> localeVector;
|
||||||
std::pair<std::string, std::string> localePair;
|
std::pair<std::string, std::string> localePair;
|
||||||
|
@ -133,6 +138,10 @@ namespace Utils
|
||||||
locale = "en_US";
|
locale = "en_US";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Language-specific menu scale factor.
|
||||||
|
if (localePair.first == "sv")
|
||||||
|
sMenuScaleFactor = 1.02f;
|
||||||
|
|
||||||
std::string localePath;
|
std::string localePath;
|
||||||
localePath.append("/")
|
localePath.append("/")
|
||||||
.append(locale)
|
.append(locale)
|
||||||
|
|
|
@ -20,8 +20,8 @@ namespace Utils
|
||||||
{
|
{
|
||||||
namespace Localization
|
namespace Localization
|
||||||
{
|
{
|
||||||
static inline std::vector<std::pair<std::string, std::string>> sSupportedLocales {
|
extern const std::vector<std::pair<std::string, std::string>> sSupportedLocales;
|
||||||
{{"en"}, {"US"}}, {{"sv"}, {"SE"}}};
|
extern float sMenuScaleFactor;
|
||||||
|
|
||||||
std::pair<std::string, std::string> getLocale();
|
std::pair<std::string, std::string> getLocale();
|
||||||
void setLocale();
|
void setLocale();
|
||||||
|
|
Loading…
Reference in a new issue