title: HTML templating in C++ and translations
body: <p>I'm using <a href="http://nulidex.com/code/docs/html_template/" rel="nofollow noreferrer">HTML_Template</a> for templating in my C++-based web app (don't ask).  I chose that because it was very simple and it turns out to be a good solution.  </p>
  
  <p>The only problem right now is that I would like to be able to include translatable strings in the HTML templates (HTML_Template does not really support that).  </p>
  
  <p>Ultimately, what I would like is to have a single file that contains all the strings to be translated.  It can then be given to a translator and  plugged back in to the app and used depending on which language the user chose in settings.</p>
  
  <p>I've been going back and forth on some options and was wondering what others felt was the best choice (or if there's a better choice that isn't listed)</p>
  
  <ol>
  <li><p>Extend HTML_Template to include a tag for holding the literal string to translate. So, for example, in the HTML I would put something like </p>
  
  <p><code>&lt;TMPL_TRANS "this is the text to translate"/&gt;</code></p></li>
  <li><p>Use a completely separate scheme for translation and preprocess the HTML files to generate the final template files (without the special translation lingo).  For example, in the pre-processed file, translatable text would look like this: </p>
  
  <p><code>{{this is the text to translate}}</code> </p>
  
  <p>and the final would look like:</p>
  
  <p><code>this is the text to translate</code></p></li>
  <li><p>Don't do anything and let the translators find the string to translate in the html and js files themselves.</p></li>
  </ol>