19

Push Notification Permission Alert Image

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sourabh Sharma
  • 8,222
  • 5
  • 68
  • 78
  • I think this is what you are looking for: http://stackoverflow.com/questions/25736700/how-to-localise-a-string-inside-the-ios-info-plist-file – Axel Dec 27 '16 at 11:17
  • 1
    @Axel There is no key for PushNotification alert in InfoPlist to show custom message. – Sourabh Sharma Dec 27 '16 at 11:32
  • You cannot customize push notification alert . You don't have a key to provide localization – Muhammad Adnan Dec 27 '16 at 13:06
  • @MuhammadAdnan Are you sure? Is there any other way to do it. Client wants to localize it. – Sourabh Sharma Dec 27 '16 at 13:11
  • 1
    I 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 – Muhammad Adnan Dec 27 '16 at 13:25

6 Answers6

7

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:)

CazzyTheCoder
  • 101
  • 1
  • 7
6

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.

Community
  • 1
  • 1
Axel
  • 768
  • 6
  • 20
1

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).

sɐunıɔןɐqɐp
  • 3,332
  • 15
  • 36
  • 40
Mirzohid Akbarov
  • 1,192
  • 1
  • 10
  • 17
1

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.

Prabhu
  • 109
  • 2
  • 5
1

This will now be localized properly in the Simulator when using Xcode 14 and above.

I filed a bug with Apple and they’ve confirmed to have fixed this issue, which I tested and is true.

On device localization has been working fine for a while now.

Ethan Allen
  • 14,425
  • 24
  • 101
  • 194
0

Adding NSUserNotificationsUsageDescription value to the info.plist fixed problem for me.

exmav10
  • 41
  • 3