Skip to content

Hardcoded English content descriptions in fourteen layouts, two of them inaccurate #2067

Description

@NAME-ASHWANIYADAV

Fourteen android:contentDescription values across the layout tree are hardcoded English literals rather than @string references, so they never reach the translation pipeline and screen readers announce untranslated English in every locale:

Layout Line Value
bookmarks.xml 106 "Bookmarks feed"
history.xml 102 "History feed"
downloads.xml 82 "Downloads"
system_notifications.xml 66 "System notifications"
addons_list.xml 34 "Addons List"
addon_options_permissions.xml 37 "Addons List"
options_saved_logins.xml 93 "Logins List"
prompt_select_login.xml 42 "Saved Logins list"
options_custom_search_engines.xml 82 "Search Engines List"
custom_search_engine_item.xml 87 "Delete custom search engine"
navigation_url.xml 171 "SSL icon"
title_bar.xml 55 "SSL icon"
new_tab.xml 86 "Top sites"
new_tab.xml 109 "Experiences"

These are the last hardcoded values in the tree: of the 38 android:contentDescription occurrences across all 157 layout files (including every flavor directory), the rest are already @string references, several of them from #2039 and the recent settings fix.

Two of the fourteen are not only untranslated but say the wrong thing:

  • addon_options_permissions.xml:37 labels @+id/permissions_list as "Addons List". That list holds one add-on's requested permissions (AddonOptionsPermissionsView populates it with addon.translatePermissions(...)), not a list of add-ons.
  • navigation_url.xml:171 and title_bar.xml:55 label the icon "SSL icon". Both are the same ic_icon_security_state_insecure drawable shown only when viewmodel.isInsecureVisible is true, so the announcement names the widget and its implementation instead of telling the user the connection is not secure.

The custom_search_engine_item.xml:87 one matters most for operability: it labels the trash icon of an actionable row, so a screen-reader user in a non-English locale gets an English label for a destructive control.

Fix: move all fourteen to translatable strings with translator comments, following the convention used by the existing *_content_description strings, and correct the wording of the inaccurate ones.

Related, but left out

title_bar.xml:67 sets android:contentDescription="Page URL" on the @+id/url TextView. A contentDescription on a TextView replaces its text for accessibility services, so this would normally mask the URL — but that TextView binds its text with tools:text="@{viewmodel.titleBarUrl}", a design-time attribute, so it appears not to be populated at runtime at all. (tools:text with a binding expression appears only twice in the repo - here and addon_options_permissions_item.xml:19.) Deciding the right fix needs a look at what that view actually renders, so it is worth treating separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions