A
A
Anatoly Bereznyak2016-05-14 23:41:00
Objective-C
Anatoly Bereznyak, 2016-05-14 23:41:00

How to localize CocoaPods libraries?

Can you please tell me how to localize the CocoaPods libraries?
Firstly , for some reason, the Pods project does not allow adding another language:
26db9460068b40e0ac1c8a304671ee5b.png
And why are there no files in the pop-up window, what should I do to do this?
Secondly , with “Export For Localization”, only one of the libraries (AFNetworking) is unloaded, although MJRefresh is also used, which I would like to localize.
As far as I understand, it is also impossible to add Localizations.strings to packages, because at the next pod update they will be deleted.
Actually, I would like to know how to implement localization as conveniently (via Export for localization) as with the main project?
PS Do not hit with stones, I'm just starting to touch. Before asking a question, I went through a lot of articles.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Semchenko, 2016-05-15
@0xcffaedfe

There is nothing to localize, so leave everything as it is.

M
Maxim Globak, 2016-05-26
@maximglobak

If cocapods produces a string value, then you can turn the following trick:
1. You make an extension for strings

extension String {
    var localized: String {
        return NSLocalizedString(self, tableName: nil, bundle: NSBundle.mainBundle(), value: "", comment: "")
    }
}

and then you get the string you need and localize it
Example:
let string = cocoapodsFramework.func().name
myLabel.text = string.localized

stackoverflow.com/questions/25081757/whats-nslocal...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question