Question

My iOS application has language selection option.
Its a server based application that receives all the strings from server that are to be displayed in the app.
In one of the view, i've to convert text to "upper case", for that I'm using NSString's upperCaseString method. This is working good for English. But for other languages like French, Chinese, Russian, German etc, it might create problem. So, I've to use "uppercaseStringWithLocale" to provider appropriate upper case string.
My question is how to create the NSLocate and pass it to "upperCaseStringWithLocale" method based on the language name. I know what's the language of the app that user has selected. Can I create locale object based on language name.?

Was it helpful?

Solution

I think you are looking for:

NSString *theLocaleIdentifier = @"es_ES_PREEURO";
[[NSLocale alloc] initWithLocaleIdentifier:theLocaleIdentifier];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top