Locales encapsulate information about linguistic, cultural, and technological conventions and standards. Examples of information encapsulated by a locale include the symbol used for the decimal separator in numbers and the way dates are formatted. Locales are typically used to provide, format, and interpret information about and according to the user’s customs and preferences. They are frequently used in conjunction with formatters.
Questions tagged [nslocale]
257 questions
2
votes
1 answer
How can i get the locale from currency names list
i am making a currency selecting screen.for that i am displaying the list of currencies using the following code to create an array of currencies from which a tableview is populated
NSArray *countryArray = [NSLocale ISOCurrencyCodes];
…

sujith1406
- 2,822
- 6
- 40
- 60
2
votes
0 answers
Setting up iOS device / simulator to retrieve en_150 as locale
How do iOS apps evaluate to a specific Locale?
Regarding Apple Docs, it follows standardized way (CLDR) with apple customized fallback strategies.
In Swift, I'm trying to figure out how Locale.current.identifier or Objective-C equivalent…

boehlefeld
- 201
- 2
- 7
2
votes
0 answers
iOS 12 - NSLocale issue
If you are using iOS >= 12 and set device language and region to France (fr_FR) Device settings IMG and fetch current locale from the code:
[NSLocale currentLocale]
or
[[NSLocale autoupdatingCurrentLocale] localeIdentifier]
result will be…

ndekic
- 21
- 3
2
votes
2 answers
Get language name from windows locale code
I have an integer language code looking like this '1031' that needs to be translated to a string like 'German'.
On iOS it's implemented like so
locale = localeIdentifier(fromWindowsLocaleCode:)
language = locale.displayName(forKey:…

noev
- 980
- 8
- 26
2
votes
1 answer
NSNumberFormatter.number for currency format not working in Device but works in simulator
I've been trying to implement currency format based on passing my custom language identifier.
Below is my code
func currencyFormatter(language:String, amount:String) -> String {
let nsFormatter = NumberFormatter()
nsFormatter.numberStyle…

Steve Gear
- 757
- 2
- 16
- 44
2
votes
1 answer
NSLocale.current.language returning the wrong value
When I change my language in iPhone settings it isn't reflected in NSLocale.current.language.
Is this because my app does not support Spanish? I would expect it to be reflected regardless. Ultimately I'm trying to get the ISO 639-1 (2-digit) region…

Jeremiah
- 1,471
- 1
- 13
- 22
2
votes
2 answers
Cocoa Touch display Multiple Currencies
I am using Cocoa Touch to develop an iPhone App.
I am storing currency amounts in a table along with associated Currency Codes From the ISO 4217 Currency Code List :
for example : 123.45 GBP, 456.45 USD, 321.98 AUD etc.
When I am displaying these…

arossco
- 77
- 1
- 7
2
votes
2 answers
How to get user's preferred language, that is not supported by application
I'd like to figure out the system's preferred language, I've put at the top in the system's preferences. I was hoping Locale.preferredLanguages or Locale.current would work, unfortunately it seems to only return those languages that are also…

Daniel
- 1,473
- 3
- 33
- 63
2
votes
1 answer
best way to convert date in English to French, nsdate, localization
My property dob of Patient object is String and currently storing 12-Jan-2017 and I want to convert it to French locale such as 12-Janv.-2017.
Below are my steps:
Converting 12-Jan-2017 into 1954-09-07 04:00:00 UTC
let dateFormatter =…

tonytran
- 1,068
- 2
- 14
- 24
2
votes
0 answers
Set English as default language in Localization iOS, Swift
getting issue here:
How to set English as default language for non-implemented languages in MultiLingual app. If changing language to e.g. Hrvatski or Polish which are not implemented the App does not use English as default language but seems to…

himanshu rai
- 21
- 3
2
votes
0 answers
Get Currency Code From Culture Info(en-IN)
How to get Currency Code 356 for the culture info (en-IN) .
I used the following API to get currency code, but it returns INR, but i need 356 as currency code.
-(NSString*)currencyCode
{
NSLocale *lcl = [[NSLocale alloc]…

stacker
- 25
- 5
2
votes
1 answer
NSLocale NSLocaleCalendar causes EXC_BAD_ACCESS
I'm using the follow doc -https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSLocale_Class/index.html#//apple_ref/occ/clm/NSLocale/localeIdentifierFromComponents:
Find localeIdentifierFromComponents(_:) if the…

wyu
- 1,793
- 17
- 33
2
votes
3 answers
Convert Local Time To EST in iOS
Please suggest how to convert local time to EST time.
I have googled it But did not get any relevant answer foe the same.
Any help will be appreciated.

Sundeep Saluja
- 1,089
- 2
- 14
- 36
2
votes
1 answer
iOS How to get currency symbol by currency code?
How i can get currency symbol by currency code when device in any Locale?
I try use something like this:
- (NSLocale *)priv_findLocaleByCurrencyCode:(NSString *)currencyCode
{
NSArray *locales = [NSLocale availableLocaleIdentifiers];
…

Nubaslon
- 741
- 2
- 11
- 27
2
votes
3 answers
How to get Particular Country language from NSLocale in ios?
i am newbie here and New to iOS development, i want to get language of Particular country from NSLocale in iOs it i Possible or not?
i try this code but it give me all language but i want particular country language
NSArray *test = [NSLocale…

iOS Developer
- 133
- 3
- 14