How to Localize Push Notification Permission Dialog alert?
Solution 1
The only post I have found is Customizing the iOS permission dialog for push notifications Unfortunately, it is not possible to change the text / localisation of the message.
Solution 2
You won't see any change in system alert when you run the app in the simulator it will be in English try running it in a real device after changing device language. Now the system alert for push notification will be in device language. Hope it helps:)
Solution 3
You need to add the following lines into Info.plist
:
<key>CFBundleDevelopmentRegion</key>
<string>en,ru</string>
Value must contain at least two languages (it doesn't matter which ones).
Solution 4
You can change the messages for location permission, camera usage description, photo library usage description etc by adding a new file InfoPlist.strings and add strings for supported languages against keys NS*UsageDescription in the above file.
Related videos on Youtube
Comments
-
Sourabh Sharma over 1 year
I am trying from the last 3 hours but not able to find any method to localize it. I am using iOS 10.0 means UNUserNotificationCenter. I want to localize it in Spanish-Mexico(es-MX) Language.
-
Sourabh Sharma over 7 years@Axel There is no key for PushNotification alert in InfoPlist to show custom message.
-
Muhammad Adnan over 7 yearsI am sure that its immutable for developer. Try removing permission for your app in real device after changing language (other than english). Localization will be applied if its implemented by apple itself .Otherwise (NO) there is no way or no implementation provided for localizing permission text
-
-
Sourabh Sharma over 7 yearsThanks looking for more answer. If it will confirm I will accept your answer. I don't want to change just localize it.
-
Pavel Alexeev over 5 yearsAnd what is NS*UsageDescription for push notifications? :)
-
Himani Sharma almost 5 yearsIf you know the answer please explain it using an example.
-
AnthonyMDev almost 5 yearsI don't believe there is one for push notifications. It will always display the default message for notifications, you can't change it. And it will localize based on device language.
-
Dhananjay M almost 3 yearsWhat if we want the exact locale (region and language) specific messages like pt-pt or pt-br ?
-
Dhananjay M almost 3 yearsI've tried with Xcode version 11.5 and it doesn't seem to work. Can you please confirm if it still works?