I have a windows form in VB.net 2010 which needs to read remote .exe's language string.
Usually, this could be done via
oFileInfo = FileVersionInfo.GetVersionInfo("path to .exe here")
Dim sMyLanguage = oFileInfo.Language
Unfortunately, this will return something like "englisch", "französisch" on a German Windows which is absolutely useless for me.
The best would be an ISO-based code, like EN, DE, FR, etc. Another unique identifier like a codepage number or something similar would also be okay.
System.Globalization also doesn't seem to have kind of a mapping of language strings to something useful.
Any idea how to get such a language identification de-coupled from the language of my operating system? Currently, my idea is to use a .csv file with three gazillions of translations which doesn't sound to be appropriate.
Okay, I found a solution:
In System.Globalization, there is not quite a direct mapping, but as in https://msdn.microsoft.com/de-de/library/system.globalization.cultureinfo.lcid(v=vs.110).aspx there are just about 140 languages listed, so I made a .csv file with Culture ID and to returning string and looped thru it with a simple For loop.
No question, this may not be the best solution. But in my testing, it had a very high chance to hit, so this is good enough for me.