Answer the question
In order to leave comments, you need to log in
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:
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
There is nothing to localize, so leave everything as it is.
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: "")
}
}
let string = cocoapodsFramework.func().name
myLabel.text = string.localized
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question