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
4
votes
2 answers
Speech Synthezis API : which locale is used by NSLocalizedString?
I want to use iOS 7 new speech synthezis API, and my application is localized in french & english.
For this to work, 2 things have to be localized :
speech text : I put it in usual localizable.string file, and retrieve it in code using…

Vinzzz
- 11,746
- 5
- 36
- 42
4
votes
2 answers
Localized weekday from NSDate in iOs app
I'm trying to get the localized weekday from an nsdate object
+ (NSString *)localizedWeekdayForDate:(NSDate *)date
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSString *language = [[[NSBundle mainBundle]…

user1028028
- 6,323
- 9
- 34
- 59
4
votes
2 answers
Native iOS Language Translated String and its Language Code Identification (LCID)
How does iOS Show the List of Languages in the Translated String or in the Language's Locale.
Is there an LCID associated with it?
If so, where can I find it's Mapping?
How does it work?
Is there an API or any documentation you can point me…

aliasgar
- 359
- 4
- 20
4
votes
2 answers
Changing numeral symbols for NSDateFormatter
So my scenario is basically this: If a user has an Arabic Locale, a date is formatted into this string: ١٩/١٠/٢٠١٢ ٣:٢١ م
The numerals are Arabic and the date is ordered/formatted a certain way according to the Arabic locale/region format. The…

baselq
- 301
- 6
- 17
4
votes
1 answer
Find out number of fraction digits in currency in iOS
I use NSNumberFormatter to format currencies in a localized way, and it works fine. But I want to override this and give the user the option to override the number of digits after the decimal separator.
How can I find out the number of digits the…

thejaz
- 2,763
- 2
- 26
- 40
4
votes
1 answer
Time Zone Support value - objective-c - cocoa-touch
I've been looking for a while now and have done a good amount of research as well as experimenting, but I cannot find a way to retrieve the value stored in a users settings for Time Zone Support on iOS devices.
I have looked into NSTimeZone…

Kevin
- 436
- 4
- 12
4
votes
1 answer
NSDateFormatter: Only show localized dates if app is localized for the language
I'm currently writing an app for the iPhone that heavily works with dates. I'm using NSDateFormatter to convert dates to strings. Conveniently, NSDateFormatter automatically creates strings in the user's language based on the region format.
Because…

Fabian Kreiser
- 8,307
- 1
- 34
- 60
4
votes
1 answer
Determining if the current locale uses non-arabic numerals in iOS?
In iOS I'd like to perform some specific functions if the user's [NSLocale currentLocale] does not use Arabic Numerals (i.e. not 0123456789). How can I check for this condition?

MattyG
- 8,449
- 6
- 44
- 48
3
votes
1 answer
Get a language's ISO identifier from its name
I know I can get the device's current Locale easily but in my case, the user chooses the language from a UIPickerView. Each language is a string in a array typed exactly the same way the phone has it in the settings for setting the device…

SimplyKiwi
- 12,376
- 22
- 105
- 191
3
votes
1 answer
How to test NSLocale return value?
I am using NSLocale to determine my current country and then pass it as an argument to my web service but i can't test other countries such as Africa etc. through this.
Is there a way to test this?
I am doing this to get the country name:
NSLocale…

Ashutosh
- 5,614
- 13
- 52
- 84
3
votes
1 answer
using NSDate to find the DATE from string
I am having problem finding date from string that is formatted using NSDateFormatter
Now, I am using this code:
NSDate *afterDate=[NSDate dateWithNaturalLanguageString:balanceDateAfter.stringValue];
This code returning date with GeorgianCalendar…

Prooshani
- 534
- 7
- 20
3
votes
2 answers
How to get localized list of available iPhone language names in objective-c?
In Objective-C, I can easily get a list of the available Locales, like this:
NSArray *test = [NSLocale availableLocaleIdentifiers];
NSLog(@"%@", test);
for (int i = 0; i < [test count]; i++) {
NSLog(@"%@", [[NSLocale currentLocale]…

Jason
- 14,517
- 25
- 92
- 153
3
votes
0 answers
NSLocale.currentLocale returning wrong locale, Canada (English) instead of Canada (French)
A user reported some internalization problems with my app when it came to using periods vs commas for the decimal separator. When I test it with US Region (periods) and with Germany Region (commas) everything works fine.
I got him to send me a…

Kenny Wyland
- 20,844
- 26
- 117
- 229
3
votes
2 answers
Changing locale of UIDatePicker in Countdown Timer mode
I have UIDatePicker in CountdownTimer mode and need to change the wording of hours and min to German locale. I tried both, to set locale to German (Germany) in storyboard and in code, but both failed and the app still shows default english words for…

Martin Koles
- 5,177
- 8
- 39
- 59
3
votes
0 answers
NSLocale displayName - native language display incorrect
In my app I wanted to display a list of supported languages, displayed in their respective native language.
Like so without the detailText:
Apple has provided a sample code to get the values via this link which works fine
let frLocale =…

user829227
- 256
- 2
- 7