I have resource files for languages named as Resource.en-US.resx, Resource.en-GB.resx, Resource.en.resx, Resource.es-ES.resx, Resource.es-MX.resx, Resource.es.resx, Resource.resx ->English
When I give the CultureInfo
for language code es-ES
I get the correct translation. But when I send es-US
I get English. But I want the resource file Resource.es.resx to be chosen if the current culture resource file is not present.
CultureInfo cul = CultureInfo.CreateSpecificCulture("es-US");
//Parent shows es
var parent = cul.Parent;
ResourceManager res_man = new ResourceManager("Resources.Resource",typeof(Resources.Resource).Assembly);
var str = res_man.GetString("Hello", cul);
Output -> Hello
Expected -> Hola