I want implement multiple languages in my program. I’m using an xml file like this one:
<?xml version="1.0" encoding="utf-8"?>
<root>
<language id="EN">
<String id="rxtst_found">.rxtst found</String>
<String id="exe_found">.exe found</String>
<String id="rxtst_not_found">No .rxtst found</String>
<String id="exe_not_found">No .exe Found</String>
</language>
<language id="DE">
<String id="exe_found">.exe gefunden</String>
<String id="rxtst_found">.rxtst gefunden</String>
<String id="rxtst_not_found">Keine .rxtst gefunden</String>
<String id="exe_not_found">Keine .exe gefunden</String>
</language>
</root>
I want to call the language like this:
getStringValue(String string_id, language lang) ...
Whats the best way to parse the language correctly?
I thought about something like
XmlNodeList xmlNodesByLanguage = xdoc.GetElementsByTagName("language");
...
String tempLang = xmlNodesByLanguage.Item(i).Attributes["id"].Value;
But I have no clue…
I deserialized my xml by using xsd.exe and I read the data by using this code: