How to get iOS language + region codes - ios

I can retrieve all language codes like so:
Locale.isoLanguageCodes
And all region codes:
Locale.isoRegionCodes
But I would like a list of all language ID's. There is a short example list described in the Apple Language and Locale IDs reference
en-AU for English as used in Australia
en-GB for English as used in United Kingdom
fr-FR for French as used in France
fr-CA for French as used in Canada
de-AT for German as used in Austria
de-CH for German as used in Switzerland
I'm hoping there's some standard list so I wouldn't list all possible permutations of Language + Region. Then I'll get combinations like, Italian as used in Mongolia. Anyone know of a source or method to produce a standard list of language ID's?
Bonus Question - Does anyone know how to get a list of the full spelling of the languages or regions and not just the code?

Related

What is the actual i18n for the support of Nepali language as like es for spain and it for italy

As there are country code in i18n in grails for the country languages like messages_es.properties for Spain, messages_it.properties for Italy. I want same for the Nepali language. I have tried for messages_np_NP.properties but not working for me as it shows ??????? in my view page. So what is the actual correct code for Nepali language?
Try this ones:
{ne-np} Nepal Nepali;
{ne-in} India Nepali
M
You can customize your own message properties file in grails under i18n>>Resources Bundle'messages'that ends with country locale you are interested. Example: messages_en_GB.properties for British English.

iOS10: German Localization not working

Currently my app supports English & German localization and I've used Localizable.strings for this purpose. You can see the project settings and Localizable in pictures below.
Now I've issues in German localizations. In iPhone there are 4 variations of German language.
App runs fine in first and the last 2 but it's not localized in Deutsch (Deutschland). Can someone know what's the reason? Also when I sewlected this variation then Main german language selection is no more available in languages.
After banging my head arouind the possible reasons, I tried one thing which worked. I added another localizable for Germany (Germany).
But I still don't know the original reason of the problem. Ideally one German localization should have sufficed for all variations of language.
There are some languages that have regional variants in iOS, starting in iOS 9. Sometimes, when you tap a language, another menu will appear with some regional variants. Here are some examples with regional variants.
Deutsch
Deutschland
Österreich
Schweiz
English
Australia
Canada
India
Ireland
New Zealand
Singapore
South Africa
United Kingdom
United States
Español
Argentina
Bolivia
Chile
Costa Rica
Ecuador
El Salvador
España
Estados Unidos
Guatemala
Honduras
Latinoamérica
México
Nicaragua
Panamá
Paraguay
Perú
Puerto Rico
República Dominicana
Uruguay
Venezuela
Français
Belgique
Canada
France
Suisse
Italiano
Italia
Svizzera
Nederlands
België
Nederland
繁體中文
台灣
澳門
香港
Remember to choose the closest regional variant if you're localizing an app with the languages listed above.

Is there a standard for localized locale codes?

I am currently working on a project that would benefit from localized locale codes. For example, RFC 5646 and the parent-standard BCP 47 define locale codes for various locales, such as en-GB for British English and zh-Hans-SG for Singaporean Chinese using simplified Chinese characters. Unfortunately, these codes use only a small subset of the latin alphabet.
I am looking for a similar standard or commonly used system that defines a set of language codes in the respective writing system of each language (somewhat akin to an autoglossonym).
EDIT: I am strictly seeking localized locale codes since in the problem's context (URI i18n/l10n), it would be unreasonable to use an autoglossonym or other verbose equivalent.
Locale codes as specified by RFC 5656 and BCP 47 are meant to be machine parseable. Thus, en-GB is "English (Great Britain)" and zh-Hans-SG is "Chinese (Singapore, Simplified Chinese Script)".
They are designed so that web pages, e-books and other documents can specify the language and script they are written in in a standard way.
Thus, each language, script and country is given a unique code from the respective standards and collated in the IANA Language Subtag Registry (http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
For a localized version of this, you are better off mapping the codes to a localized name (e.g. localizing the Description field of the subtag registry database, or using a project like iso-codes) and formatting that in a presentable way, keeping the locale code as an internal representation.

Seeking source for localized Countries, Languages and Region names

I seek a source for the world's main language names, country names, and territory names, localised into a long list of languages.
Example of localised names of languages:
EN EN English
EN ES Inglés
ES EN Spanish
ES ES Español
Example of localised names of a certain country in south-west Europe:
ES ES España
ES FR Espagne
ES EN Spain
Any idea where can I take/build that from?
You can find the information you are looking for in the Unicode Common Locale Data Repository (CLDR) here: http://cldr.unicode.org/
Data is supplied in XML so you will need to import this into your database.
The CLDR publishes human-readable charts for language names and territory (country, continent, etc.) names. In each, there is a section for each language or territory, identified by a standardised code. Then the rows of each section give a localised name, and codes for the languages which use that localised name to refer to the language or territory.
The underlying CLDR data is in XML form. The language and territory names you seek are in directory, repos/cldr/trunk/common/main/, with an XML file for each language, containing the names for various languages and territories localised into that language. For instance, the file es.xml has the Spanish-language names for languages ("español", "inglés") and countries ("España").
For country names, you can use geonames, for example here is a list of alternate names for the south west European country. Geonames has an api and data dump that you can use in your programs.
For language names, this list could be useful
HERE is a database in multiple formats.
Best of luck learning all those languages in their local slang.

Localization by Location or Region?

How can I make the localization independent on the OS settings?
For example, if the device language is en-US,
But I want the user to be able to set the app to work using Hebrew localization.
In my case – I have an app that in emergency cases the user (in Israel) need to call a number (101).
I made localization to hebrew & english for that app, & when the user is switching to english lang' the dial number & pic' is changing to 911,
But what if a user in Israel wants to use english lang' on his iphone? he doesn't need 911, he needs 101.
I thought maybe to create tableview with all the numbers rather than a specific number but the access to the numbers list will not be quick and easy for dialing because of the multiple numbers.
Is it possible to make localization by location or any other way for doing that?
I appreciate the help.
query NSLocale for the NSLocaleCountryCode. The values from [NSLocale currentLocale] do not depend on the language setting, they depend on the region settings.
These are the values for my currentLocale. Language is set to english and region is set to germany.
NSLocaleIdentifier : de_DE
NSLocaleLanguageCode : de
NSLocaleCountryCode : DE
preferredLanguages are:
en,
fr,
de,
ja,
[...]
more fanciness: use geolocation to figure out the actual location of the device. It's possible that your users travel outside of their country ;-)

Resources