fastlane-old / snapshot

Automate taking localized screenshots of your iOS app on every device
https://fastlane.tools
1.96k stars 141 forks source link

Improved language and locale handling. #437

Closed bartoszj closed 8 years ago

bartoszj commented 8 years ago

Hi,

Currently, user provides list of languages which are then converted to "generic language id"[*] and the provided language is used as locale value. It is not the best approach, because "different" languages like pt-PT and pt-BR are treated as the same language pt (-AppleLanguages "(pt)") with different locale (-AppleLocale "pt-BR"), which can cause problems like #422 and #396. Better approach would be to use language that the user provided (i.e. pt-BR) and "guess" locale for the given language. Right now Xcode doesn't guess locale value when the language was selected in the scheme options, it just use the same value for language and locale. I think that snapshot should not be smarter here and use the same approach. But it should also allows to select locale different than language.

In this PR, I've fixed issue (I hope :wink: ) with device languages #422 and #396 and added possibility to provide locale next to language:

languages([
  "en-US",
  ["fr", "fr_CA"], # French language with French Canadian locale
  "de-DE"
])