title: Change language from dynamically content using Javascript
body: <p>My project should support different languages for the GUI (spanish, english, german, etc). I'm using CodeIgniter, so I haven't got any problem with PHP views using Language Class. I can load some previously defined vars on PHP to create views in different languages.</p>
  
  <p>The problem comes here:</p>
  
  <p>Some features (a lot of them actually) use Javascript: personalized context menu for some items, differents DIVs created dynamically, etc. The most of this features are created dynamically, so I can't know the language selected (I can create a lot of duplicated code, one for each language, but this is too redundant).</p>
  
  <p>I need to find a way to translate this content into the new language previously selected by user.</p>
  
  <p>For example:</p>
  
  <p>The user right-click and the context menu have the following options (created dynamically using Javascript):</p>
  
  <ul>
  <li>Hi</li>
  <li>Goodbye</li>
  </ul>
  
  <p>When the user change the page language to 'Spanish', the context menu should show:</p>
  
  <ul>
  <li>Hola</li>
  <li>Adios</li>
  </ul>
  
  <p>Is there any way to save some variables with all the names in different languages, and then load to create the menus?</p>
  
  <p>Sorry for the big post. I hope everyone can help me or bring me a little tip.</p>