Closed Bug 1809972 Opened 2 years ago Closed 2 years ago

Cookie banner CFR: code should not try to replace localized text when it can pass a variable

Categories

(Fenix :: Privacy, defect)

All
Android
defect

Tracking

(firefox109 unaffected, firefox110 unaffected, firefox111 fixed)

RESOLVED FIXED
111 Branch
Tracking Status
firefox109 --- unaffected
firefox110 --- unaffected
firefox111 --- fixed

People

(Reporter: flod, Assigned: giorga)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

https://github.com/mozilla-mobile/firefox-android/blame/4af98f17650c9c3215b7c24b497b99357ab8dc78/focus-android/app/src/main/java/org/mozilla/focus/browser/integration/BrowserToolbarIntegration.kt#L337-L359

These are the strings in question

    <!-- Contextual Feature Recommendation Popups -->
    <!-- CFR for Cookie Banner (Banner Info Message). The placeholder will be updated with the app name. -->
    <string name="cfr_for_cookie_banner">%1$s tries to reject cookie requests to dismiss annoying cookie banners.\n\nManage cookie banner preferences in settings.</string>

    <!-- CFR for Cookie Banner (Banner Info Message).This text should be the same as the settings text from "cfr_for_cookie_banner".The text should be underlined and should redirect the user to the cookie banner settings screen. -->
    <string name="cfr_for_cookie_banner_underline_settings">settings</string>

The code tries to find the localized text for settings in the first string, which doesn't make a lot of sense, because it's going to break if the translation is not consistent (including capitalization, as far as I understand Kotlin).

On the other hand, the link for the text could just be passed as a variable.

    <!-- CFR for Cookie Banner (Banner Info Message). %1$s will be replaced by the app name, %2$s will be an active link using the string cfr_cookie_banner_link as text. -->
    <string name="cfr_cookie_banner">%1$s tries to reject cookie requests to dismiss annoying cookie banners.\n\nManage cookie banner preferences in %2$s.</string>

    <!-- CFR for Cookie Banner (Banner Info Message). This string is used as text for a link in cfr_cookie_banner and takes the user to the app settings. -->
    <string name="cfr_cookie_banner_link">settings</string>

:giorga, since you are the author of the regressor, bug 1797600, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(giorga)
Assignee: nobody → giorga
Flags: needinfo?(giorga)
Status: NEW → ASSIGNED

Note that I used different IDs in the second example, because we need them at this point.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: