nslocalizedstring

How to make iOS app name localizable? [duplicate]

☆樱花仙子☆ 提交于 2019-11-28 06:54:07
This question already has an answer here: How to localize bundle display name in iPhone app? 5 answers I'm trying to find the easiest way to localize my app. I'm using sqlite, so I need basically only to switch my database name. Problem is the app name - can it be localized from code or I have to make x apps for x languages, so anyone will have app name in his/hers native language? The latter one seems like already rejected app to me... anyone? I assume you mean the Bundle Display Name that appears on the device's home screen: You should create a localized file called InfoPlist.strings similar

AppleLanguages value overrides the value of language set in IOS settings preferred language

我们两清 提交于 2019-11-28 06:51:49
问题 I am working on Localization of my app that supports both spanish and English languages.These options are listed in a tableview.On clicking English i am setting the value "en" for the key "AppleLanguages" in NSUserDefaults.So that it can show the content in English. NSUserDefaults *nsdefault=[NSUserDefaults standardUserDefaults]; [nsdefault setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"]; [nsdefault synchronize]; Also at the same time i am trying to fetch the Language

iOS 8.1 Simulator Localization broken (NSLocalizedString)

萝らか妹 提交于 2019-11-28 03:17:16
TL;DR: It seems localization does not work with xCode 6.1 and 8.1 simulator. Workaround: Go to "edit schemes" >> "Run" (side bar) >> "Options" tab >> "Application Language" Select the language you wish to run the app on the simulator. Long Story: I've updated xCode to 6.1. The update deleted the iOS 7.x simulators and left me only with 8.x simulator. I've done the following steps: I've installed the 7.x simulator Cleaned the project Deleted the app from the simulators Deleted the derived folder for my project The project supports English and Japanese. on 7.1 simulator (5s) the localization

Xcode 7 crash: [NSLocalizableString length] 30000

余生长醉 提交于 2019-11-27 23:46:30
The app just hangs on iOS7,8,9, makes 30000 calls to [NSLocalizableString length] The cpu is on max. see https://forums.developer.apple.com/thread/16001 also (lldb) bt * thread #1: tid = 0x2cb4df, 0x0349065c Foundation`-[NSLocalizableString length] + 6, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0xbf728ffc) * frame #0: 0x0349065c Foundation`-[NSLocalizableString length] + 6 frame #1: 0x03490680 Foundation`-[NSLocalizableString length] + 42 frame #2: 0x03490680 Foundation`-[NSLocalizableString length] + 42 frame #3: 0x03490680 Foundation`-[NSLocalizableString

NSLocalizedString only retrieves the key, not the value in Localizable.strings (IOS)

时光总嘲笑我的痴心妄想 提交于 2019-11-27 20:22:59
I've made a strings file named "Localizable.strings" and added two languages to it, like so: "CONNECTIONERROR" = "Check that you have a working internet connection."; "CONNECTIONERRORTITLE" = "Network error"; I have also converted the files to Unicode UTF-8 However, when I create a UIAlertView like this: UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"CONNECTIONERRORITLE",nil) message:NSLocalizedString(@"CONNECTIONERROR",nil) delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; the alert view only shows the key text, not the value. It works if I, for

How to localize an iOS storyboard

▼魔方 西西 提交于 2019-11-27 10:23:36
I've an iPhone storyboard with some views. For instance, a navigation item title is named News , which should be translated for other languages. When I add a new localization to my storyboard, it created a duplicate of my current storyboard for the new language. Here I can change the title for the navigation item, but for me it does not seem very useful. What if my storyboard contains 100 views and I need to support 10 languages? If I need to change something in my original storyboard, I have to make the same changes for all languages. That seems very odd. In which situations can this be

How to set font family to Navigation Controller Title in swift?

家住魔仙堡 提交于 2019-11-27 08:44:38
问题 I have one View Controller named "Home". I embed it in Navigation Controller. self.navBar.topItem?.title = "Home" I would like to change "Tharlon" font to my UIViewController title bar. self.navBar.topItem?.title = NSLocalizedString("Home", comment: "") self.navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName: UIFont(name: "Tharlon", size: 17)!] Both these codes are in ViewDidLoad() function. When I run the app, Translated text shows well at the first time. Then, I

Custom NSLocalizedString?

北战南征 提交于 2019-11-27 07:22:46
问题 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 gender on first launch and then use the appropriate phrases. Of course, both are based on the same language. I can do it with my own code but I'd rather do it the easy way if possible. 回答1: NSLocalizedString is just a macro defined in NSBundle.h

Advanced Localization with Omission of Arguments in Xcode

痴心易碎 提交于 2019-11-27 06:57:13
问题 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$@ an: %4$@"; These are passed to a [NSString stringWithFormat:] call: ////////////////////////////////////// // Share Over Twitter NSString *frmt = NSLocalizedString(@"Check out the %1$@ %2$@ in %3$@: %4$@", @"The default tweet for sharing sounds. Use %1

NSLocalizedString with swift variable

余生颓废 提交于 2019-11-27 03:31:09
I'm trying to localize my app using NSLocalizedString. When i import the XLIFF file, most works like a charm but something do not and some string is not localized. I have noticed that the problem is from NSLocalizedString containing something variable inside like: NSLocalizedString(" - \(count) Notifica", comment: "sottotitolo prescrizione per le notifiche al singolare") or NSLocalizedString("Notifica per \(medicina!) della prescrizione \(prescription!)\nMemo: \(memoTextView.text)", comment: "Messaggio della Local Notification") Maybe this is not the correct syntax for thi kind of stuff. Some