title: Why Locale.current.identifier is invalid?
body: <p>The problem arises when setup the "Language &amp; Region" (Settings => General => Language &amp; Region) as follows:</p>
  
  <ul>
  <li>"iPhone Language" to "English (Canada)".</li>
  <li>"Region" to "Jordan".</li>
  </ul>
  
  <p>However, (as mentioned answer for: <a href="https://stackoverflow.com/questions/30141174/how-to-get-detailed-language-of-device-in-swift_">How to get detailed language of device in swift</a> calling:</p>
  
  <pre><code>print(Locale.current.identifier)
  </code></pre>
  
  <p>Logs:</p>
  
  <blockquote>
    <p>en_JO</p>
  </blockquote>
  
  <p>which is an <em>invalid</em> <a href="https://gist.github.com/jasef/337431c43c3addb2cbd5eb215b376179" rel="nofollow noreferrer">local identifier</a> (Logically speaking, Jordan is a Middle-East country which its native language is Arabic not English).</p>
  
  <p>I also checked the <a href="https://developer.apple.com/documentation/foundation/locale/2293697-availableidentifiers" rel="nofollow noreferrer">availableIdentifiers</a>:</p>
  
  <pre><code>print(Locale.availableIdentifiers)
  </code></pre>
  
  <p>and -obviously -it does <em>not</em> contains "en_JO".</p>
  
  <p>Also, I tried:</p>
  
  <pre><code>if let regionCode = Locale.current.regionCode, let languageCode = Locale.current.languageCode {
      print("\(languageCode)_\(regionCode)")
  }
  </code></pre>
  
  <p>and the output was the same.</p>
  
  <p>It seems that it has nothing to do with identifier validity, but how can I make sure to get a valid identifier? As an example, in my case the expected result should be:</p>
  
  <blockquote>
    <p>en_CA</p>
  </blockquote>
  
  <p>So what am I missing here?</p>