Merge pull request #4986 from ufdada/master

Also set the PSP-internal Language if possible on first-run
This commit is contained in:
Henrik Rydgård committed 2014-01-03 05:55:34 -08:00
commit 3e11785aa3
2 files changed
+10 -1

No files matched your search

+8 -1
View File
@@ -77,12 +77,19 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
if (!File::Exists(currentDirectory))
currentDirectory = "";
int defaultLang = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
std::string defaultLangRegion = "en_US";
if (bFirstRun) {
std::string langRegion = System_GetProperty(SYSPROP_LANGREGION);
if (i18nrepo.IniExists(langRegion))
defaultLangRegion = langRegion;
// TODO: Be smart about same language, different country
langValuesMapping = GetLangValuesMapping();
if (!defaultLangRegion.empty()) {
if (langValuesMapping.find(defaultLangRegion) != langValuesMapping.end()) {
defaultLang = langValuesMapping[defaultLangRegion].second;
}
}
}
general->Get("Language", &sLanguageIni, defaultLangRegion.c_str());
@@ -342,7 +349,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
pspConfig->Get("NickName", &sNickName, "PPSSPP");
pspConfig->Get("proAdhocServer", &proAdhocServer, "localhost");
pspConfig->Get("MacAddress", &localMacAddress, "01:02:03:04:05:06");
pspConfig->Get("Language", &iLanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
pspConfig->Get("Language", &iLanguage, defaultLang);
pspConfig->Get("TimeFormat", &iTimeFormat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR);
pspConfig->Get("DateFormat", &iDateFormat, PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD);
pspConfig->Get("TimeZone", &iTimeZone, 0);
+2
View File
@@ -18,6 +18,7 @@
#pragma once
#include <string>
#include <map>
#include <vector>
#include "CommonTypes.h"
@@ -306,6 +307,7 @@ private:
std::string controllerIniFilename_;
std::vector<std::string> searchPath_;
std::string defaultPath_;
std::map<std::string, std::pair<std::string, int>> langValuesMapping;
};
// TODO: Find a better place for this.