Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7976251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:52:16+00:00 2026-06-04T08:52:16+00:00

I want implement multiple languages in my program. I’m using an xml file like

  • 0

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…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:52:17+00:00Added an answer on June 4, 2026 at 8:52 am

    I deserialized my xml by using xsd.exe and I read the data by using this code:

                //deserializes language xml
    
                XmlSerializer ser = new XmlSerializer(typeof(root));
                String asdf = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
    
     FileStream fs = new FileStream(asdf + "\\XML\\language.xml", FileMode.Open);
    
                    XmlReader reader = new XmlTextReader(fs);
                    //root = head node of the xml file
    
     root ts = (root)ser.Deserialize(reader);
                fs.Close();
                //sprachennummer nach enum in Siro_Settings
                int languageNr = (int)lang;
    
                //sucht nach dem passenden Value zu der stringID und gibt ihn zurück
                for (int j = 0; j < ts.Items[languageNr].String.Length; j++)
                {
                    if (ts.Items[languageNr].String[j].id.Equals(stringID))
                    {
                        return ts.Items[languageNr].String[j].Value;
                    }
    
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this facebook page: LINK And i want to implement multiple facebook like
I want to implement multiple auth providers (like stackoverflow). I have downloaded the dotnetauth
I want to implement something like a WCF OData provider but using NetTcpBinding instead
I want to implement a ContentProvider that manipulates multiple tables. Here is what I
I am trying to implement a multiple choice quiz and will want to store
I am performing data changes on multiple databases, and I want to implement a
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
I want to implement file uploading with behaviour which is commonly seen in various
I want to implement a design in Java where I have multiple event sources
I am building a WP theme and want to implement multiple color schemes. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.