title: Handling Android Locale
body: <p>I was struggling with date formatting in Kotlin.</p>
  <p>Does someone know why using :</p>
  <pre class="lang-kotlin prettyprint-override"><code>val locale = ConfigurationCompat.getLocales(Resources.getSystem().configuration).get(0)
  java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, locale).format(Date())
  </code></pre>
  <p>give me :</p>
  <ul>
  <li>In FR_fr = 08/09/2022 (expected)</li>
  <li>In EN_gb = 08/09/2022 (unexpected)</li>
  </ul>
  <p>BUT</p>
  <pre class="lang-kotlin prettyprint-override"><code>val currentLanguage = ConfigurationCompat.getLocales(Resources.getSystem().configuration).get(0).language
  val locale = Locale(currentLanguage)
  java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, locale).format(Date())
  </code></pre>
  <p>gives me :</p>
  <ul>
  <li>In FR_fr = 08/09/2022 (expected)</li>
  <li>In EN_gb = 9/8/2022 (expected)</li>
  </ul>
  <p>Is there a simpler way?</p>