mirror of https://github.com/OpenVPN/openvpn-gui
Fallback to default sublanguage when loading resources
When a resource is not found in user's preferred language, first try the primary language with SUBLANG set to default before falling back to English. See: https://github.com/OpenVPN/openvpn-gui/issues/216 Signed-off-by: Selva Nair <selva.nair@gmail.com>pull/298/head
parent
8a93336c97
commit
87c5e16723
|
@ -53,6 +53,12 @@ FindResourceLang(PTSTR resType, PTSTR resId, LANGID langId)
|
|||
if (res)
|
||||
return res;
|
||||
|
||||
/* try to find the resource in the default sublanguage */
|
||||
LANGID defLangId = MAKELANGID(PRIMARYLANGID(langId), SUBLANG_DEFAULT);
|
||||
res = FindResourceEx(o.hInstance, resType, resId, defLangId);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
/* try to find the resource in the default language */
|
||||
res = FindResourceEx(o.hInstance, resType, resId, fallbackLangId);
|
||||
if (res)
|
||||
|
|
Loading…
Reference in New Issue