title: How to manage backend content in different languages and then send the information through webservices?
body: <p>(This is a very minimized version of my actual project, that has much more tables that are linked together and a lot of more data and columns for each tabel).</p>
  
  <ul>
  <li>How would you recommend setting up the structure of a content management system that supports content in different languages? Is the following way a good option?</li>
  </ul>
  
  <p>In my current project i have a database with articles, these articles are defined by the columns <strong>id</strong>, <strong>title</strong> and <strong>text</strong>. The title and text columns are forign keys to the table <strong>LanguageData</strong> on the column <strong>text_id</strong>. That table holds all the strings for the entire project. This table consists of the columns <strong>id</strong>, <strong>text_id</strong>, <strong>text</strong> and <strong>language_id</strong>.</p>
  
  <p>Example:</p>
  
  <pre><code>Article : { id : 1, title : 1, text : 2 }
  
  LanguageData : { id : 1, text_id : 1, text : "Title in english", language_id : 1 }
  LanguageData : { id : 2, text_id : 1, text : "Tittel på svenska", language_id : 2 }
  LanguageData : { id : 3, text_id : 2, text : "Text in english", language_id : 1 }
  LanguageData : { id : 4, text_id : 2, text : "Texto en español", language_id : 3 }
  </code></pre>
  
  <ul>
  <li>How do i make a fast webservices that return articles with a specified language?</li>
  </ul>
  
  <p>In my project i also have a webservice that takes a language_id as input and returns all the articles with the correct language strings added. For this i connect to the database with entity framework and for each article in the database and each column that is a foreign key to LanguageData, i call a method:</p>
  
  <pre><code>GetLanguageString(text_id, language_id)
     return LanguageData.First(ld =&gt; ld.text_id == text_id &amp;&amp; ld.language_id == language_id)
  </code></pre>
  
  <ul>
  <li>This seems to be very slow when i want to go through 600 articles with a lot of columns that are linked to LanguageData. Is there a better way of doing this? Some columns that arent mentioned here are often repeated from article to article (for example the column category). Should i save the result of the lambda questions so that they dont need to be executed again if i already have searched the string for the same text and same language? And does it mather if i use lambda expressions or LINQ? Are they equally fast?</li>
  </ul>
  
  <p>Some documentation on the topic would be gladly recieved. I am new to backend programing and i dont seem to be able to find information about this on the net.</p>
  
  <p>Many thanks.</p>