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 n
I created an extension to String since I had many strings to be localized.
extension String {
var localized: String {
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
}
}
For example:
let myValue = 10
let anotherValue = "another value"
let localizedStr = "This string is localized: \(myValue) \(anotherValue)".localized
print(localizedStr)