nslocalizedstring

NSLocalizedString with swift variable

半世苍凉 提交于 2019-12-17 07:15:39
问题 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:

Standard (or Best) Method for Localizing Long Strings for iOS

China☆狼群 提交于 2019-12-14 03:15:42
问题 I have a couple of help menus associated with the app I'm building for iPhone. Frankly, it's a lot of text, some of it courtesy of attorneys! I'm wrestling with several methods to implement this and wonder if there is a standard or best way. Here are the options I've been considering: Put all of the text in a database and load the text at runtime based on the language selected. Build several different ViewControllers with the text for each language and then switch which segue gets called

storyboard localization in swift 4.0

早过忘川 提交于 2019-12-13 02:57:53
问题 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", comment: "") I have already add Localizable.strings file as well as Main.string file for particular language. but I can not success in implement Localization 回答1: Bhumesh I have used this library for in - app localisation. Which is very easy to use.

How to use get all NSLocalization using genstrings while preserved current translations

一笑奈何 提交于 2019-12-12 20:57:13
问题 Let say my iOS app already have translation localizatible.strings for Japanese. Say "Continue" = "続ける"; However, I've added new NSLocalization additions to my code but I want to use genstrings to get all new NSLocalizations without having to merge them manually. Is there any way to do that? 回答1: There are tools that manage localization and that automatically make updates to translations based on changes to the base language (and helping the translator make the necessary changes only to

How to localize some strings from a HTML file that is displayed in a UIWebView controller under iOS?

久未见 提交于 2019-12-11 10:16:22
问题 I am looking for a way that would allow me to localize some strings from inside a HTML file that is displayed in a UIWebView under iOS. I want to use NSLocalizesString() for doing the localization, so I am looking for a simple solution that would like me to generate the localized html file before displaying it. I do have full control over the HTML file and plant to use some kind of placeholders. 回答1: Use a custom tag then, parse the HTML with NSXMLParser, and anything within your custom tag..

Localization failed to read a strings file (Xcode 6.3.2)

不打扰是莪最后的温柔 提交于 2019-12-11 03:35:57
问题 I can't export for localization, I just get a "Localization failed to read a strings file" error. The system log says: 2015-06-07 01:41:48,305 Xcode[1914]: [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-7718/IDEFoundation/Localization/IDELocalizationWork.m:434 Details: Failed to read strings file "/var/folders/vh/z7jrdtc16mv_ml4rdf3c_yf40000gn/T/Xcode3SourceStringsAdaptor-8B1BF14F-E8BF-4354-9FB6-BFF843BD6623/Localizable.strings", underlying error: The data couldn’t be

Multi language lable changes in the .xib file.

删除回忆录丶 提交于 2019-12-10 22:14:16
问题 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 Setting.xib (.xib file) in which there are four labels in the view part and in the top bar of that Nib file I want to change the label names according to the set language using One & Only one Nib file. So, please give me the appropriate solution. Which will

Scale UISegmentedControl labels based on width of control

a 夏天 提交于 2019-12-10 17:49:55
问题 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 languages. But, in Japanese and other languages the characters are larger and cause the label to be truncated. self.segmentedControl = [[UISegmentedControl alloc] initWithItems: [NSArray arrayWithObjects: NSLocalizedString(@"Miles", nil)

NSLocalization on xCode 4.5 and iOS 6

旧巷老猫 提交于 2019-12-10 15:35:57
问题 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 = NSLocalizedString(@"KEY", NULL); NSLog(@"My String is: %@", tempString); The log for iOS5.1 is: "My String is: Hello World!" The log for iOS6 is: "My String is: KEY" ...I'm really going to become crazy! Where is my error? Thanks a lot!!! 回答1: Their is no need to

Force localize image or image assets

烈酒焚心 提交于 2019-12-10 14:58:53
问题 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 <objc/runtime.h> static const char _bundle=0; @interface BundleEx : NSBundle @end @implementation BundleEx -(NSString*)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString *)tableName { NSBundle* bundle=objc_getAssociatedObject(self, &_bundle);