How Can you Localize a Label in iPhone SDK? - iphone

I know you can localize a NSString or even an image (which is pretty cool), but can you localize a label that is text in the iPhone SDK?

If the label is part of a XIB, you localize the XIB. If it's programmatically created, then you localize the NSString.

Related

Swift: how to change the text of buttons in UIImagePickerController?

Could you please explain how to change the text of "Use Photo" and "Retake" buttons in image picker using Swift? I need to substitute them with an italian translation. I have found something in Objective-C but I don't know that language and I am not even sure it was for my case... Thank you
you need to make a UIImagePickerView as overlay view.
you can follow this solution
Change UIImagePicker Buttons

UIButton not Changing Length in Different Language

I have developed an iOS app that I have localized in both French and English. I have a UIButton in my UINavigationBar that reads Back in English and Retournerin French. My UIButton seems to just take the length from the English button as default so when the app is opened on a French device the text doesn't fit in the button.
I've tried having the UIButton read Retourner in my Storyboard and I can't seem to set a constraint for the length. Am I missing something?
Try this then
button.titleLabel?.adjustsFontSizeToFitWidth = true
Found in: How to adjust font size of text in a UIButton to fit the width programmatically in Swift?
Well it turns out theres a provided method for this!
I just set:
backButton.sizeToFit()
In my viewDidLoad and it worked like a charm.

iOS 7 storyboard localization with attributed Labels

I am generating my String- Files with ibtool from my Base Storyboard for all my languages...For some reason ibtool is not extracting UILabels with style "attributed"...
I have no Key/Value Pair for those labels...Does somebody has a clue why?!
I ended up concluding that it couldn't be done using ibtool in the
present version.
Instead I let the Textview be a plain text view and, using my
subclass, parsed its text property so I could make a
NSMutableAttributedString and set the needed properties.
That enabled me to use ibtool to extract the strings and still have an
attributed textview.
Localizing attributed UITextView from storyboard

Localize a UITextView

How do I localize a UITextView?
I saw a lot of examples for a UITextField but none for UITextView.
I need to localize my application's description in the about section.
If you've written the description directly into a UITextView in the XIB, you will need to duplicate the XIB (just use Xcode's localization tool) and then copy and paste the translated text into the new XIB.
If there are several XIBs or you need to send the text to translators, just use GENSTRINGS on all the XIBs. See here: http://kb.applingua.com/2011/07/extracting-strings-from-your-m-class-files/

Localising xib's (iPhone) workflow

I have figured out how to loclize, but it seems yo end up with a lot of paralell xib's.
Is there a good way to manage changes in xib's that as been localized, or do I have to be very strict about not localizing before the xib's are fixed?
I usually create outlets for those buttons and labels that need to be localized. I then localize these in viewDidLoad or awakeFromNib. This however does not allow you to also reposition and resize the buttons depending on the language, but for now I did not have to do that.
The problem I have with localizing the XIBs themselves is that, as soon as you want to add functionality (e.g. an additional button) later, you have to meticulously apply these changes to all localizations of that XIB. For me a XIB is almost never fixed.