Questions tagged [nslocalizedstring]

This is a function defined in the Foundation Framework. It returns a localized version of a string.

410 questions
2
votes
1 answer

Iphone Application in languages other than English

I am new iPhone application development. So please go easy with me :) I want to write my application in Swedish. When i started writing my app, i hard coded the swedish words. for example, in the for the navigationBar title (contact…
Neelesh
  • 3,673
  • 8
  • 47
  • 78
2
votes
1 answer

Multi language lable changes in the .xib file.

I have to develop the application into Four(4) languages (English, French, Italic, Spanish). So, for that I want to know is there any way to display different language data using only one(1) .xib file in the top bar. Example: I have the…
Jignesh Fadadu
  • 409
  • 4
  • 17
2
votes
0 answers

Why is NSLocalizedString generating 'Use of undeclared type' in the same file?

I am using Xcode 10.3 and Swift 5 I have a long struct with my Localizable Strings as follows: import Foundation struct Strings { static let string1 = NSLocalizedString("String 1", comment:"") .... } I wanted to get rid of all the…
eharo2
  • 2,553
  • 1
  • 29
  • 39
2
votes
1 answer

Localized Strings only applying translations through Interface Builder

I have created the strings files for a few languages and added texts to them. The spanish file, for example, is called Main.strings (Spanish) and I have added two texts to it. The first one to apply the translation to a label in the interface…
Victor Rius
  • 4,566
  • 1
  • 20
  • 28
2
votes
1 answer

Return static default value when localization key does not exist

How can I return a static string (i.e. "AAA") when I am passing a key to NSLocalizedString() that does not exist in the localization file? I could only find information on how to fall back to a default language but not how to return a hardcoded…
Dominik
  • 1,703
  • 6
  • 26
  • 46
2
votes
4 answers

storyboard localization in swift 4.0

I want to implement storyboard localization in swift language. (means I want to localization for fix label and button text) I have already idea about NSLocalizedString but I dont want to code for fix text Label for e.g NSLocalizedString("Welcome",…
Bhumesh Purohit
  • 491
  • 1
  • 8
  • 26
2
votes
1 answer

NSLocalizedString always fall back to english

I have a project with english and french translation. Everything used to work perfectly fine. Now for some reason the language always fallback to english. I tried to delete the English.lproj and French.lproj folders, regenerate them with genstrings…
vdaubry
  • 11,369
  • 7
  • 54
  • 76
2
votes
0 answers

Can Localizable Strings Files can dynamically be changed?

I need to know if localizable Strings files can dynamically be changed, I want to fetch and display the strings from my own server so that if a string has to be changed, a new build updated won't be needed. I know that a localized string can be read…
Zeeshan Anjum
  • 148
  • 13
2
votes
1 answer

how to localize language of the city with location in swift 4 for ios 9.0?

I used location in my app that will get latitude and longitude in the app and then can give me the name of the city that user is in the name is in English but I want to convert that to the Persian I found this method But this will work in iOS 11…
2
votes
1 answer

How to Localize NSString with format

How to localize the NSString with format. int value = 20; NSString *str = @"hello"; textLabel.text = [NSString stringWithFormat:@"%d %@", value, str]; I tried textLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%d %@", @"%d %@"),…
Karen
  • 169
  • 1
  • 16
2
votes
0 answers

Swift: NSLocalizedString(key, string) not working with AlertController - how to use the right way?

I am trying to localize my app and I have set up under the Info tab a localization for two languages. Xcode has created under Main.storyboard two new files called Main.strings (English) and Main.strings (German). Now when I change the different…
RjC
  • 827
  • 2
  • 14
  • 33
2
votes
0 answers

UILocalNotification missing NSLocalizedString value but is using it

We use UILocalNotification in my project as reminders. Our app is translated so we set the string value of the notification with NSLocalizedString. Xcode 9 displays an error while setting the notification (e.g.) : [strings] ERROR: C'est le moment…
thibaut noah
  • 1,474
  • 2
  • 11
  • 39
2
votes
3 answers

localization in iOS notifications?

I have my app running nicely and it uses local notifications. I have decided to internationalize the app now and have everything working just fine except notifications which were set on a language before changing the language on the device. I…
zambono
  • 1,397
  • 1
  • 17
  • 26
2
votes
1 answer

NSLocalizedString with format specifiers in Swift yields garbage

To facilitate easier localizing in a very small app of mine, I have this String extension method: extension String { func localized(with values: Any...) -> String { // debug values for v in values { print("\(type(of:…
Peter W.
  • 2,323
  • 4
  • 22
  • 42
2
votes
1 answer

Is it possible to force localization to another language?

Can I pass an argument to NSLocalizedString to override the localized string and tell it what language to use so that the user can choose a language from a Settings menu? How so?
Moshe
  • 57,511
  • 78
  • 272
  • 425