Sefran2
Sefran2

Reputation: 3588

language vs locale for date-time formatting on ios

I noted that some apps change date-time formatting with the locale changing and not with the language changing, but also viceversa. What is the suggested way to localize date-time? According locale or language?

Fran

Upvotes: 2

Views: 1105

Answers (2)

Aravind Yarram
Aravind Yarram

Reputation: 80176

Locale is any combination of 3 things: country, language and a variant. There are well-known combinations of these 3 but you can mix and match these to make your own combination.

Now coming to your question, properly handling the date and time involves Locale, TimeZone and the date format. checkout this great presentation on i18n

Upvotes: 1

Gary
Gary

Reputation: 7257

In general you assume that the locale defines the presentation.

However, you can provide language specific choices for non-native speakers that essentially set their locale behind the scenes.

For example:

  1. User A speaks French and lives in UK - Locale is UK, but user prefs say Locale is France
  2. User B speaks English and lives in USA - Locale is USA, and user prefs default to American English.

That should satisfy most requirements.

Upvotes: 1

Related Questions