Localization support for Push Notifications

We live in a diverse world, filled with a myriad of languages and cultures. Communicating with users in their native tongue not only adds a personal touch but also enhances user engagement. With this in mind, we are excited to introduce a significant upgrade to our push notification system: Localization.

Now, your push notifications can be tailored to align with the linguistic preferences of each user. Users are more likely to engage with content in their native language. 

Why Does Localization Matter?

 

In an interconnected digital age, localization is no longer a luxury but a necessity. Localizing content, especially in the form of notifications, showcases respect and understanding for your diverse user base. By transcending language barriers, you’re not just broadening your reach, but also deepening the relationship with your audience, reinforcing trust and loyalty, regardless of where they are.

How to Get Started?

 

Our comprehensive documentation provides step-by-step guidance to assist you in seamlessly configuring push notification localization on the server side: https://developers.connectycube.com/server/push_notifications?id=payload-formation-rules

Also you need to follow next steps to configuring push notification localization: 

  1. Navigate to the Admin Panel (https://admin.connectycube.com).
  2. Proceed to ‘Chat’.
  3. Click on ‘Offline notifications’.
  4. Here, you’ll find a section labeled ‘LOCALIZATION SETTINGS’ and configure the necessary settings.

As you proceed with setting up the localization of push notifications on the client side, we kindly advise you to consider the following essential points:

 

 For Android projects (including cross-platform frameworks):

The android project must have string resources for a specific  localization, which must contain the strings localization for the title and body.

For example, we have two files:

  • android/app/src/main/res/values/strings.xml (default localization) 

                                                               and 

  • android/app/src/main/res/values-pl/strings.xml (Polish localization)

Both of these files have the following keys:

Default 

   <string name="notif_body_res">%1$s writes: %2$s</string>

   <string name="notif_title_res">You have %1$s unread messages, last from %2$s</string>

Polish 

   <string name="notif_body_res">%1$s pisze: %2$s</string>

   <string name="notif_title_res">Masz %1$s nieprzeczytanych wiadomości, ostatnie od %2$s</string>

i.e. title localization key ‘notif_title_res and body localization key notif_body_res.

These keys must have exactly the same name as specified in the Admin panel.

The corresponding arguments specified in the Admin panel will be substituted instead of %1$s and %2$s.

While the examples provided here use two arguments, you’re welcome to use any number, but do ensure that the quantity matches the number of arguments specified in the admin panel. 

 

For iOS projects (including cross-platform frameworks):

Setting up localization for iOS projects is very similar to the localization setting up process for Android projects. For both, it’s essential to create and incorporate two specific localization files with the requisite keys. 

For example, we added English localization to the base file (ios/Runner/en.lproj/Localizable.strings):

"notif_body_res" = "%@ writes: %@";

"notif_title_res" = "You have %@ unread messages, last from %@";

We added Polish localization to Polish localization  (ios/Runner/pl.lproj/Localizable.strings):

"notif_body_res" = "%@ pisze: %@";

"notif_title_res" = "Masz %@ nieprzeczytanych wiadomości, ostatnia od %@";

The corresponding arguments specified in the Admin panel will be substituted instead of %@ and %@.

Kindly note, when implementing localization across multiple platforms, it’s essential to ensure that the key names remain consistent across all of them. Failure to maintain this consistency may result in the system’s inability to locate the necessary localization data.

Helpful links

 

Android Localization Tutorial: https://developer.android.com/guide/topics/resources/localization

iOS Localization Tutorial: https://medium.com/lean-localization/ios-localization-tutorial-938231f9f881

Conclusion

 

With the addition of localization to your push notifications, you are not only enhancing the user experience but also establishing a more personalized connection with your audience. This strategic move can lead to increased engagement as users feel acknowledged and valued in their native tongue.

Should you have any queries, uncertainties, or require support, our team is readily available to assist you.

To a world without language barriers!