title: How to associate dictionnary keys with description using Flask
body: <p>I am using Flask to build my web application.
  I have a dictionnary with some key in it, unfortunatly these keys are not easily readable for a user. I'd like to display nicer name and a descriptions sentence for each keys. </p>
  
  <p>The display of my keys is in jinja2 loop, iterating over the dictionnary.</p>
  
  <p>My actual page:</p>
  
  <pre><code>key_1 : value_1
  key_2 : value_2
  </code></pre>
  
  <p>The page I want to have:</p>
  
  <pre><code>Nice name for key1 (Description of the key1) : value_1
  Nice name for key2 (Description of the key2) : value_2
  </code></pre>
  
  <p>I already look in flask-babel extension, but it does not seems to fit since the keys in jinja2 template will be displayed at runtime. Even if I am manually creating a .po file with all possible keys, I doubt it will correctly work.</p>
  
  <p>I was thinking to use a database to make the correspondance, but I think it might not be the nicest way to do that</p>
  
  <pre><code>key_1 = { name : "Nice name for key1"
            description : "Nice description for key1"
           }
  </code></pre>
  
  <p>What do you think would be the best way of doing such correspondance ?</p>
  
  <p><strong>EDIT:</strong>
  My keys are coming from a dictionnary passed to the template from flask. I dont think from where the dictionnary is coming is important.</p>
  
  <p>So It looks like <code>return render_template(mypage.html, dictionnary=dictionnary)</code></p>
  
  <p>I am not really trying to translate my nice name and description in a first time, just make a link between the keys of the dictionnary and names and descriptions to display which are understandable to users. I though using flask-babel cause it first looks like a way of doing such links. Unfortunatly I think because my keys are generating at runtime with jinja2 it will not work.</p>
  
  <pre><code>{% for key,value dictionnary.iteritems()%}
  &lt;li&gt; {{ key }}, {{value}} &lt;/li&gt;
  {% endfor %}
  </code></pre>