mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Localize: add language codes
Newly added g_LanguageCodes maps directly with g_LanguageNames.
This commit is contained in:
parent
02b5d77d2f
commit
99edd0229d
@ -32,13 +32,7 @@ bool Localize_LoadLocalizationFileLists(CLocalize* thisptr)
|
||||
|
||||
bool Localize_IsLanguageSupported(const char* pLocaleName)
|
||||
{
|
||||
for (int i = 0; i < SDK_ARRAYSIZE(g_LanguageNames); ++i)
|
||||
{
|
||||
if (strcmp(pLocaleName, g_LanguageNames[i]) == NULL)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return V_LocaleNameExists(pLocaleName);
|
||||
}
|
||||
|
||||
void VLocalize::Detour(const bool bAttach) const
|
||||
|
@ -65,6 +65,7 @@ inline const char* const g_LanguageNames[] = {
|
||||
"italian",
|
||||
"korean",
|
||||
"spanish",
|
||||
"mspanish",
|
||||
"schinese",
|
||||
"tchinese",
|
||||
"russian",
|
||||
@ -73,11 +74,40 @@ inline const char* const g_LanguageNames[] = {
|
||||
"polish",
|
||||
};
|
||||
|
||||
inline bool V_LocaleExists(const char* const pLocale)
|
||||
inline const char* const g_LanguageCodes[] = {
|
||||
"en_US",
|
||||
"de_DE",
|
||||
"fr_FR",
|
||||
"it_IT",
|
||||
"ko_KR",
|
||||
"es_ES",
|
||||
"es_MX",
|
||||
"zh_CN",
|
||||
"zh_TW",
|
||||
"ru_RU",
|
||||
"ja_JP",
|
||||
"pt_BR",
|
||||
"pl_PL",
|
||||
};
|
||||
|
||||
inline bool V_LocaleNameExists(const char* const localeName)
|
||||
{
|
||||
for (size_t i = 0; i < V_ARRAYSIZE(g_LanguageNames); i++)
|
||||
{
|
||||
if (V_strcmp(pLocale, g_LanguageNames[i]) == NULL)
|
||||
if (V_strcmp(localeName, g_LanguageNames[i]) == NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool V_LocaleCodeExists(const char* const localeCode)
|
||||
{
|
||||
for (size_t i = 0; i < V_ARRAYSIZE(g_LanguageCodes); i++)
|
||||
{
|
||||
if (V_strcmp(localeCode, g_LanguageCodes[i]) == NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -799,7 +799,7 @@ VPKChunkDescriptor_t::VPKChunkDescriptor_t(uint32_t nLoadFlags, uint16_t nTextur
|
||||
//-----------------------------------------------------------------------------
|
||||
VPKPair_t::VPKPair_t(const char* pLocale, const char* pTarget, const char* pLevel, int nPatch)
|
||||
{
|
||||
const bool bFoundLocale = V_LocaleExists(pLocale);
|
||||
const bool bFoundLocale = V_LocaleNameExists(pLocale);
|
||||
|
||||
if (!bFoundLocale)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user