Reputation: 21
When I am using in this line
alertView.message=NSLocalizedString("Please_enter_all_fields",comment:"Please_enter_all_fields")
alert pop up messages shows Please_enter_all_fields
, but I was declared the Localized.string
file: Please_enter_all_fields="Please enter all fields"
.
How can I display the alert message related declared String of Localized.string
variables?
Upvotes: 1
Views: 973
Reputation: 6469
let title = NSLocalizedString("TITLE", comment: "TITLE")
let msg = NSLocalizedString("Please_enter_all_fields", comment: "Please_enter_all_fields")
let alert = UIAlertController.init(title: title, message: msg, preferredStyle: .alert)
The NSLocalizedString is default as "English - Development Language".
you can just define the value as you want
let msg = NSLocalizedString("Please enter all fields", comment: "Please enter all fields")
Or you have to add "English" Localisations, and translate inside "Localizable.String(English(United States))"
/* Please_enter_all_fields */
"Please_enter_all_fields" = "Please enter all fields";
Upvotes: 2
Reputation: 166
may be this is wrong
Please_enter_all_fields="Please enter all fields"
It's must be setting like below:
"Please_enter_all_fields"="Please enter all fields";
Upvotes: 2