title: Flatten nested Json objects with JQ
body: <p>I am creating a script to transform JSON objects to "string" files (for translation purposes). the idea is to transform:</p>
  
  <pre><code>{
     "TRANSLATION1": "text1",
     "TRANSLATION2": "text2"
  }
  </code></pre>
  
  <p>into </p>
  
  <pre><code>"TRANSLATION1" = "text1";
  "TRANSLATION2" = "text2";
  </code></pre>
  
  <p>That was done with :
  <code>jq  -r 'to_entries|map("\"\(.key)\"=\(.value|tojson);")|.[]'</code></p>
  
  <p>Nice!</p>
  
  <p>Now, my problem is with nested objects:</p>
  
  <pre><code>{
     "TRANSLATION1": "text1",
     "TRANSLATION2": "text2",
     "TRANSLATION3": {
       "SUBTRANS1": "subtranslation1",
       "SUBTRANS2": "subtranslation2",
     }
  }
  </code></pre>
  
  <p>I would like to have as result: </p>
  
  <pre><code>"TRANSLATION1" = "text1";
  "TRANSLATION2" = "text2";
  "TRANSLATION3.SUBTRANS1" = "subtranslation1";
  "TRANSLATION3.SUBTRANS2" = "subtranslation2";
  </code></pre>
  
  <p>Can anyone help?! I have been scratching my head for hours now...</p>