Locale
Localization (l10n) is the process of adapting your application for a specific market, or locale. Internationalization (i18n) is the process of preparing your app to be localized. Internationalization is a necessary, but not sufficient condition for localization. And whether or not you decide to localize your app for other markets, it’s always a good idea to do everything with internationalization in mind.
The hardest thing about internationalization (aside from saying the word itself) is learning how to think outside of your cultural context. Unless you’ve had the privilege to travel or to meet people from other places, you may not even be aware that things could be any other way. But when you venture out into the world, everything from the price of bread to the letters in the alphabet to the numbers of hours in a day — all of that is up in the air.
Internationalisation (i18n) means building your app so it can support many regions and languages. Localisation (l10n) means actually translating and adapting it for a specific market.
Always design with internationalisation from the start, even if you never localise.
The hardest part is thinking beyond your own culture: dates, numbers, currencies, quotation marks, text direction, and even how names are written all differ around the world.
Foundation’s Locale object holds all these rules for a user or region. Use Locale.current for the user’s settings, or create a specific Locale with an identifier like "fr_FR".
Locale tells you:
- language and script
- region
- currency and symbols
- decimal and grouping separators
- calendar
- quotation marks
- sorting order
- measurement units
It can also give the local name for any country or language (useful for settings screens) and the user’s ordered list of preferred languages (perfect for the Accept-Language HTTP header).
Small details from Locale, like using the right quotation marks or currency symbol, make an app feel truly native everywhere. With Locale as your guide, you can make your app work correctly for every user without hard-coded assumptions.
Category:
Tags:
Year: