This is a function defined in the Foundation Framework. It returns a localized version of a string.
Questions tagged [nslocalizedstring]
410 questions
7
votes
3 answers
iOS : mismatched translation
I'm trying to add a language to my app and it was working until now. After a day to try to understand what's happen, I give up.
This is my problem :
My base language is english (development language) and my other language is french. I have some…

Arnaud Verrier
- 71
- 3
7
votes
2 answers
Advanced Localization with Omission of Arguments in Xcode
I have this formatted string that I am having a translator work on.
ENGLISH
"Check out the %1$@ %2$@ in %3$@: %4$@" = "Check out the %1$@ %2$@ in %3$@: %4$@"
GERMAN TRANSLATION
"Check out the %1$@ %2$@ in %3$@: %4$@" = "Hör Dir mal %2$@ in %3$@…

coneybeare
- 33,113
- 21
- 131
- 183
7
votes
3 answers
NSLocalizedString loads the string sometimes, not always
NSLocalizedString works only half of the time where I get back the expected the value for the referenced key. The other times I get back the key name specified in NSLocalizedString and consistently happens on every other run.
Currently, I am only…

Howard Spear
- 551
- 1
- 5
- 14
7
votes
1 answer
NSLocalizedString - Use of undeclared identifier issue
I'm using NSLocalizedString in a particular message that works fine if the second parameter is passed as a variable, but fails with Use of undeclared identifier 'NSLocalizedString' and Too many arguments provided to function-like macro invocation if…

David Ravetti
- 2,030
- 1
- 17
- 22
6
votes
4 answers
Is it safe to use "real" keys in NSLocalizedString()? Is there a guaranteed fallback language?
I know many developers just do it like this: They start developing their app in English, and put NSLoclaizedString(@"Tap this to do that!", @"Telling what to do...") instead of simply @"Tap this to do that!".
Then they run genstrings which creates a…

dontWatchMyProfile
- 45,440
- 50
- 177
- 260
6
votes
1 answer
Possible iOS 16 bug in NSLocalizedString passing from Swift to Objective-C
I've encountered what I think is a bug in iOS16: When a localized string is passed from Swift to Objective-C and compared with another identical localized string (defined in Objective-CC), the result can be false and the parameter order can affect…

刘maxwell
- 187
- 10
6
votes
1 answer
NSLocalizedString always returns capitalized text
Ive run into an issue where NSLocalizedString is always returning strings capitalized regardless of its input. localization was working
and Im assuming I did something that caused this but I cannot seem
to figure out exactly what changed.
Here's my…

Tim
- 647
- 1
- 10
- 21
6
votes
1 answer
Swift: dynamic strings with local variable injections
Not sure if this is possible. But I want to do this:
let version = "2.0.1"
let year = 2017
let version = "Build \(version), \(year)"
However, I want to source the version string from a localised file. ie.
let version = "2.0.1"
let year = 2017
let…

drekka
- 20,957
- 14
- 79
- 135
6
votes
1 answer
Set substrings of NSLocalizedString to be bold
I have a method that sets a NSAttributedString to be bold:
func setBold(text: String) -> NSMutableAttributedString {
guard let font = UIFont.CustomNormalBoldItalic() else {
fatalError("font not found")
}
let string =…

coderdojo
- 187
- 1
- 17
6
votes
1 answer
NSLocalizedString With Dynamic Variable (Swift) - Not Working
I began integrating localization into my app using this guide. It worked great until I localized a string that included a dynamic variable. The original was this:
let myString = "I have \(countOfMoney) dollars in my wallet."
Then I tried to mimiic…

Dave G
- 12,042
- 7
- 57
- 83
6
votes
1 answer
Force localize image or image assets
As in this question, How to force NSLocalizedString to use a specific language
I can force localise by this method.
Header file
@interface NSBundle (Language)
+(void)setLanguage:(NSString*)language;
@end
Implementation
#import…

Khant Thu Linn
- 5,905
- 7
- 52
- 120
6
votes
3 answers
Localized String with Interface Builder User Defined Runtime Attributes
I am currently trying to create a localized accessibilityLabel in the storyboard (I am trying to avoid doing it programatically). It seems that whenever I use the Localized String option, the accessibilityLabels ends up being set to the localized…

user1927638
- 1,133
- 20
- 42
6
votes
3 answers
Adding new language to existing localized app
I have an app that uses localization, I need to add one more language, I want to display two different language images of same name in one xib file, the xib file is not localized as I am localizing the images. Can it be done using interface…

Queshi Zakir
- 464
- 1
- 6
- 15
6
votes
1 answer
How do I reverse engineer Mac OS X language localisation files for natural language learning?
OK, the goal of this question is not strictly programming related but it is a question programmers can answer using programming tools, and programmers may find useful answers here. Bear with me.
I find changing the system language in Mac OS X a…

arandomlypickedname
- 1,349
- 1
- 11
- 12
6
votes
1 answer
Localization of CFBundleDisplayName doesn't work on device
I tried to make the localization of the app name using CFBundleDisplayName.
I made the localized InfoPlist.strings according two different language.
In one strings file wrote:
CFBundleDisplayName="x11111"
and in another:
…

Stella
- 1,197
- 1
- 10
- 18