title: Remove region code from NSLocale.preferredLanguages array
body: <p>After updating my Mac to OSX Sierra, I have noticed, that the <code>NSLocale.preferredLanguages()</code> array is now in different format (See quick explanation <a href="https://happyteamlabs.com/blog/nslocale-preferredlanguages-changes-in-ios-9/" rel="nofollow">here</a>)</p>
  
  <p>Also, same thing happens for IOS9, I suppose.</p>
  
  <p>So, in short, previously we had language format "en", "fr", "ru", e.t.c</p>
  
  <p>Now, we have format "en-US", "en-RU", "fr-US" e.t.c.</p>
  
  <p>In my application, some controls' coordinates were related to the locale. Now, because of the different format, they are all wrong. I was thinking about best way to fix this and to remain support for older versions.</p>
  
  <p>So, my question is:</p>
  
  <p>Is there any way of receiving the language code without region code only? The quick and dirty solution would be to read first two symbols from this string. Is there a more elegant one?</p>
  
  <p>P.S. Can someone please explain Apple's logic to me. I mean, why they have decided, that best option would be to change the existing object format(breaking the backwards compatibility) instead of adding additional field to NSLocale?</p>