Cwa-app-ios: Unlocalized user notification button titles (View_Exposure_Detection_Results, Ignore)

Created on 6 Sep 2020  路  5Comments  路  Source: corona-warn-app/cwa-app-ios

Avoid duplicates

  • [x] Bug is not mentioned in the FAQ
  • [x] Bug is not already reported in another issue

Describe the bug

The user notification for test results being available uses the raw enum values instead of localized strings.
The user notification shows "View_Exposure_Detection_Results" and "Ignore" for an otherwise German notification.

Expected behaviour

The buttons should be localized strings.

Steps to reproduce the issue

Register a test with the app. Wait for the result notification:
IMG_3361

Technical details

  • iOS Version: iOS 13.7
  • Device: iPhone 11 Pro

Possible Fix

UNNotificationCenter+Extension.swift uses raw enum values for titles instead of localized strings:

        let viewAction = UNNotificationAction(
            identifier: openActionIdentifier.rawValue,
            title: openActionIdentifier.rawValue, // <-- should be localized string
            options: [.authenticationRequired]
        )

        let deleteAction = UNNotificationAction(
            identifier: UserNotificationAction.ignore.rawValue,
            title: UserNotificationAction.ignore.rawValue, // <-- should be localized string
            options: [.destructive]
        )

A fix would be to use NSLocalizedString()

Additional context


Internal Tracking ID: EXPOSUREAPP-2558

bug mirrored-to-jira

Most helpful comment

Thanks @svengabr.

One additional note: It looks like the same notification function is used for both test result and risk detection user notifications. The button title should probably be differentiated based on the notification type or use a common string along the lines of "View details".

All 5 comments

Hello @toco

Thank you very much for your feedback and details. I have created an internal Jira ticket EXPOSUREAPP-2558 and assigned it to the development team.

Best regards,
SG

Corona-Warn-App Open Source Team

Thanks @svengabr.

One additional note: It looks like the same notification function is used for both test result and risk detection user notifications. The button title should probably be differentiated based on the notification type or use a common string along the lines of "View details".

Hi @GPclips ,
Please assign the task to @marcussc from now on. I'll leave the project.
Thanks.

@dsarkar
Is this Issue still here in 1.7.1?

@Ein-Tim, @toco,

Indeed resolved in CWA 1.7.1. Related PR: https://github.com/corona-warn-app/cwa-app-ios/pull/1482
Thanks. We will ill close this now. Many thanks to all contributors.

Best wishes,
DS


Corona-Warn-App Open Source Team

Was this page helpful?
0 / 5 - 0 ratings