This is a function defined in the Foundation Framework. It returns a localized version of a string.
Questions tagged [nslocalizedstring]
410 questions
4
votes
2 answers
Spanish support for Retake and Use photo buttons of UIImagePickerController
I am developing an app that supports Spanish content, which i am achieving through localised strings.
Now i would like to know if there is any way to give Spanish support for the buttons Retake and Use Photo of UIImagePickerController
Have attached…

Manju Basha
- 665
- 1
- 9
- 29
4
votes
3 answers
Overriding preferred strings localization on the fly for testing
Using the Settings app in the iPhone simulator to switch languages is a PITA way of testing localization tweaks. I'm trying to figure out a way to switch localizations (en/fr/es/etc) on the fly in my app with a debug setting without restarting the…

Ben Zotto
- 70,108
- 23
- 141
- 204
4
votes
1 answer
Use default language fallback when key is untranslated
Can i use default language (e.g. English) for untranslated keys in my other language Localizable.strings files ?

Antoine Lenoir
- 524
- 1
- 3
- 17
4
votes
2 answers
Scale UISegmentedControl labels based on width of control
This seems like a no brainer, but I cannot find any way to do this. Basically what I have is a UISegmentedControl with two localized labels using NSLocalizedString. I have set the font size and everything looks great in English and a few other…

Nic Hubbard
- 41,587
- 63
- 251
- 412
4
votes
2 answers
Localization in iOS 7 : Selects the language settings used previously
I am using localization in iOS 7 and have the localizable string files for German and English.
When ever i select the corresponding language the localisation works perfect. But if i switch to any other language, then the display is based on the…

Rahul Raj
- 367
- 3
- 17
4
votes
4 answers
Change iphone app language with buttons and without restart of the app
I want to change the language of my app. At the moment I am doing it at the following way.
I have two buttons which are change the languages in NSUserDefaults. But before this affects my app I need to restart it.
Here is my code.
-…

Sarah Geebelen
- 173
- 1
- 9
4
votes
6 answers
NSLocalization on xCode 4.5 and iOS 6
Is there any way to use Localizable.strings with NSLocalizedString(@"KEY", @"") in xCode 4.5 for iOS6 like in older iOS5?
Here is my sample code:
In Localizable.strings
"KEY" = "Hello World!";
In .m script
NSString *tempString =…

ndman
- 153
- 8
4
votes
2 answers
"%" symbol in an NSLocalizedString
I have the following line of code:
NSLog([NSString stringWithFormat:NSLocalizedString(@"KEY", nil),80.1]);
The 80.1 is a float that is being inserted into the localized string. This works fine. However I want a % symbol in the localized string. I…

Darren
- 10,091
- 18
- 65
- 108
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
4
votes
1 answer
unable to mantain localization on a UIButton after
I am using NSLocalizedString function to change the language of a UIButton
reset.titleLabel.text=NSLocalizedString(@"Reset", nil);
I put this line in the viewDiLoad , viewWillAppear , viewDidAppear , viewDidDisappear and viewWillDisappear
when…

user1415780
- 1,153
- 5
- 16
- 33
3
votes
1 answer
Localization doesn't affect some .strings files
I use SORelativeDateTransformer in my project.
I localized my project (translated storyboard and created Localizable.strings(I used NSLocalizedString)) and that part translates perfect.
The problem is that SORelativeDateTransformer uses it's own…

Shmidt
- 16,436
- 18
- 88
- 136
3
votes
3 answers
Making part of localised string bold swift
I have a string let's say " my name is %@ and i study in class %@" now I want to bold the placeholder text which i will be inserting , so that the result will look something like this:" My name is Harsh and i study in class 10" and i will display it…

Harsh Chaturvedi
- 679
- 6
- 13
3
votes
1 answer
SwiftUI Text and LocalizedStringKey with parameter
I am trying to add a SwiftUI localized Text with parameter. However in the whole app we use a wrapper around localization keys so we have something like this:
static let helloWorldText = NSLocalizedString("helloWorldText", comment: "")
with…

Maciej Zajda
- 165
- 9
3
votes
7 answers
Custom NSLocalizedString?
Is it possible to use the NSLocalizedString infrastructure (based on localizable.strings) with a custom-defined "localization"?
The thing is, there are some languages that have different wordings for males and females. I want to ask the user's…

Amiram Stark
- 2,208
- 22
- 32
3
votes
0 answers
How to localize string interpolation for notification message localizedUserNotificationString?
Tried to add a number inside a localized string with localizedUserNotificationString function. However, passing the argument into the function would cause a server connection error despite its a local notification. Replacing the arguments with a nil…

XY L
- 25,431
- 14
- 84
- 143