Add langCode for English and convert passed value to one format

Fix #8927, close #13272
pull/13168/head
ArkadiuszMichalski 2023-03-01 15:18:45 +01:00 committed by Don Ho
parent dc0c8d6510
commit 20f381e506
2 changed files with 3 additions and 0 deletions

View File

@ -4262,6 +4262,8 @@ LangType NppParameters::getLangIDFromStr(const TCHAR *langName)
generic_string NppParameters::getLocPathFromStr(const generic_string & localizationCode)
{
if (localizationCode == TEXT("en") || localizationCode == TEXT("en-au") || localizationCode == TEXT("en-bz") || localizationCode == TEXT("en-ca") || localizationCode == TEXT("en-cb") || localizationCode == TEXT("en-gb") || localizationCode == TEXT("en-ie") || localizationCode == TEXT("en-jm") || localizationCode == TEXT("en-nz") || localizationCode == TEXT("en-ph") || localizationCode == TEXT("en-tt") || localizationCode == TEXT("en-us") || localizationCode == TEXT("en-za") || localizationCode == TEXT("en-zw"))
return TEXT("english.xml");
if (localizationCode == TEXT("af"))
return TEXT("afrikaans.xml");
if (localizationCode == TEXT("sq"))

View File

@ -251,6 +251,7 @@ generic_string getLocalizationPathFromParam(ParamVector & params)
generic_string locStr;
if (!getParamVal('L', params, locStr))
return TEXT("");
locStr = stringToLower(stringReplace(locStr, TEXT("_"), TEXT("-"))); // convert to lowercase format with "-" as separator
return NppParameters::getLocPathFromStr(locStr.c_str());
}