title: Resource file for language dictionary in C#
body: <p>I have a web application that works in several languages. On the client side, I store words in JavaScript arrays like this:</p>
  
  <pre><code>var SomeSectionOfThePage = ['word1', 'word2', ... ]
  </code></pre>
  
  <p>And then when I'm generating the HTML dynamically in the client I do this:</p>
  
  <pre><code>var TheHTML = '&lt;div&gt;' + SomeSectionOfThePage[0] + '&lt;/div&gt;';
  </code></pre>
  
  <p>I keep the dictionary arrays in a different .js files and when I need to generate the page, the URL for the JavaScript file is resolved according to the user's language. This works great because I don't need to touch the code to modify words in the language dictionaries. </p>
  
  <p>I want to do the same thing for the back-end: I want to have different resource files that get loaded  depending on the user's language.</p>
  
  <p>For now, this is what I'm doing for generating HTML on the server:</p>
  
  <pre><code>&lt;div&gt;&lt;asp:Literal runat="server" ID="SomeID" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And then in my code-behind, I do something like this:</p>
  
  <pre><code>switch (TheLanguage)
  {
     case 1:
         SomeID.Text = "hi";
  
     case 2:
         SomeID.Text = "bonjour";
  }
  </code></pre>
  
  <p>As you can see, the text is stored in my C# file and that works well for now but I want to move the text to a resource file. How do I store the words so that they're easy to restore in C# when I generating the HTML? I'm looking for ideas on how to put this functionality together.</p>