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
0
votes
1 answer
Get SKProduct Price in USD instead of store locale price
There is no issue to use user's store locale price for inAppPurchases. But I need to get product price in USD for my personal statistics. Is there a way to get SKProduct Price in USD instead of store locale price?
SKProduct *product = [self…

isuru
- 3,385
- 4
- 27
- 62
0
votes
2 answers
Converting GMT date format to locale based format
How can we convert NSDate object in GMT format to the date format with current locale/device settings?
For example if a device is in US and in PDT time zone then I want to convert GMT time to its equivalent PDT time.

Abhinav
- 37,684
- 43
- 191
- 309
0
votes
2 answers
How to save a specific NSLocale in CoreData
Trying to save Locales into CoreData and just wasn't sure what format I should save the data.
let locale = Locale.current
let currencyCodesArray = Locale.commonISOCurrencyCodes
for currencyCode in currencyCodesArray {
// let currencyName =…

icekomo
- 9,328
- 7
- 31
- 59
0
votes
2 answers
NSLocale is not returning correct Language code
I'm trying to get device current selected language code by using the code below.
NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
This line works fine for the first time after installation. When I change the device language…

KP26
- 283
- 3
- 14
0
votes
1 answer
UIDatePicker wrong time position when set locale
I have a UIDatePicker, that shows date and time UIDatePickerMode.dateAndTime, when I present the picker while the language is Arabic, the picker is normally presented with hours on the left and minutes on the right with no issues as the below…

Mutawe
- 6,464
- 3
- 47
- 90
0
votes
2 answers
NSDateFormatter dateFromString for 24hr date gives wrong time
I want to add event to native calender.I am having problem in getting date accurate time from string. I have set locale,24 hr format. but still getting the same bug.
EKEvent *event = [EKEvent eventWithEventStore:self.eventStore];
…

krusty
- 41
- 5
0
votes
1 answer
UIDatePicker changing NSLocale Issue
Hope every body is doing great.
I just came across a strange issue, changing manually NSLocale of UIDatepicker is not working but in only specific mode
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(10, 130, [UIScreen…

umer sufyan
- 1,005
- 1
- 12
- 22
0
votes
1 answer
How to set supported languages to an iOS app
I have a requirement where my backend supports only few locales, So when I am uploading some data I am suppose to tag the locale, so I should feed the supported locales to the app, And How do I do it? could somebody help me out

Ravi Kiran
- 219
- 3
- 14
0
votes
0 answers
NSDateComponenets giving wrong year value
I use some code to translate a list of dates into different sections by month:
- (NSString *) calculateSectionPeriod{
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar…

Z S
- 7,039
- 12
- 53
- 105
0
votes
0 answers
Use fixed locale format for dates when Base locale is being used
I am developing a multi language app.
When none of the supported languages is chosen by the user as its iOS language, I am showing all text in English.
Everything works just fine, except that I also want in this case to have the dates formatted in…

Mig70
- 61
- 10
0
votes
1 answer
Printing the locale names
I want to know and print the locale names which I am changing on my device. Is there any way to print them. Printing a NSLocale object does not help.

Abhinav
- 37,684
- 43
- 191
- 309
0
votes
1 answer
How to retrieve a value for NSLocale .scriptCode in Swift
I'm trying to print some basic infos from NSLocale, but I'm not able to get a value back from the .scriptCode property.
Currently, the relevant bits are
let localeIdent = NSLocale.autoupdatingCurrent.identifier
let userLocale =…

Matt
- 217
- 1
- 11
0
votes
1 answer
Weird errors when using a 3G connection?
I'm making a web browser and when I'm connected to a Wi-Fi network everything works fine. When I'm using a 3G connection just from a short 10 minutes of debugging session with his iPhone I found two errors:
The code below throws an…

Vulkan
- 1,004
- 16
- 44
0
votes
0 answers
iOS ISOCountryCodes returns empty array
I have the following code:
NSArray *_countryCodes = [NSLocale ISOCountryCodes];
NSMutableArray *names = [NSMutableArray arrayWithCapacity:_countryCodes.count];
[_countryCodes enumerateObjectsUsingBlock:^(NSString *code, NSUInteger idx, BOOL *stop)…

user2786037
- 495
- 1
- 12
- 27
0
votes
3 answers
Bug with iPhone Currency for Euro format with NSDecimalNumber using NSLocale?
My app uses monetary values, and I would like to represent these values in the currency and formats that the user has set on their iPhone however, when testing, I seem to be having troubles with the German EURO format.
I have a method that returns…

Glynton
- 185
- 9