For some weird reason only part of the texts in the Localizable.strings translates properly. If the string contain more the 1 word (the english side), it won't be translated. I made sure it is the same string (copied and pasted)
"Login" = "כניסה"; //translates properly
"Email" = "דואר אלקטרוני"; //translates properly
"Password" = "סיסמא"; //translates properly
"forgot password?" = "שכחת סיסמא?"; //translation does not work
"Sign up" = "הירשם"; //translation does not work
I use this extension:
extension String {
var localized: String {
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
}
}
and in the code:
override func viewDidLoad() {
super.viewDidLoad()
self.emailTextField.placeholder = "Email".localized
self.passwordTextField.placeholder = "Password".localized
self.loginButton.setTitle("Login".localized, for: .normal)
self.signupButton.setTitle("Sign up".localized, for: .normal)
self.forgetPasswordButton.setTitle("forgot password?", for: .normal)
}