Android O: Notification Channel name localization

411 Views Asked by At

I'm facing similar problem mentioned here in this SO post. Have notification channel got created something like this,

NotificationChannel channel = new NotificationChannel(CHANNEL_ID_FOOBAR, getContext().getString(R.string.notification_channel_foobar), NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);

The string used as channel name R.string.notification_channel_foobar is not getting reflected with appropriate locale string when keyboard language gets changed. The suggested solution is to listen for ACTION_LOCALE_CHANGED and update the channel name again by invoking createNotificationChannel api.

Consider the following scenario,

  1. Device keyboard language is English now
  2. Changed the language to Japanese
  3. Rebooted the device

I'm expecting the appropriate Japanese string to get updated for the notification channel name. But this is not happening. Am I missing something? Or how this could have happened?

0

There are 0 best solutions below