Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Bug 1876610 - Minor Translations UI Adjustments
Browse files Browse the repository at this point in the history
This patch completes a few minor translations UI adjustments. Including
updating mock data on the "never translate these sites" page and the
"language settings" page.

Additionally, adds a content description on the toolbar for the
translation icon.
  • Loading branch information
ohall-m committed Jan 25, 2024
1 parent aa64798 commit ffed911
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
context,
R.drawable.mozac_ic_translate_24,
)!!,
contentDescription = "",
contentDescription = context.getString(R.string.browser_toolbar_translate),
contentDescriptionSelected = "",
visible = {
translationsAvailable || context.settings().enableTranslations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,25 @@ internal fun getAutomaticTranslationListPreferences(): List<AutomaticTranslation
return mutableListOf<AutomaticTranslationItemPreference>().apply {
add(
AutomaticTranslationItemPreference(
displayName = Locale.CANADA.displayName,
displayName = Locale.CANADA.displayLanguage,
automaticTranslationOptionPreference = AutomaticTranslationOptionPreference.AlwaysTranslate(),
),
)
add(
AutomaticTranslationItemPreference(
displayName = Locale.FRANCE.displayName,
displayName = Locale.FRANCE.displayLanguage,
automaticTranslationOptionPreference = AutomaticTranslationOptionPreference.OfferToTranslate(),
),
)
add(
AutomaticTranslationItemPreference(
displayName = Locale.GERMANY.displayName,
displayName = Locale.GERMANY.displayLanguage,
automaticTranslationOptionPreference = AutomaticTranslationOptionPreference.NeverTranslate(),
),
)
add(
AutomaticTranslationItemPreference(
displayName = Locale.CHINA.displayName,
displayName = Locale.CHINA.displayLanguage,
automaticTranslationOptionPreference = AutomaticTranslationOptionPreference.AlwaysTranslate(),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ internal fun getNeverTranslateListItemsPreference(): List<NeverTranslateSiteList
return mutableListOf<NeverTranslateSiteListItemPreference>().apply {
add(
NeverTranslateSiteListItemPreference(
websiteUrl = "expedia.ca",
),
)
add(
NeverTranslateSiteListItemPreference(
websiteUrl = "wikipedia.com",
websiteUrl = "mozilla.org",
),
)
}
Expand Down
3 changes: 2 additions & 1 deletion fenix/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@
<string name="default_locale_text">Follow device language</string>
<!-- Placeholder text shown in the search bar before a user enters text -->
<string name="locale_search_hint">Search language</string>
<!-- Content description for the translate page toolbar button that opens the translations dialog when no translation has occurred. -->
<string name="browser_toolbar_translate">Translate page</string>

<!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code -->
Expand Down Expand Up @@ -2311,7 +2313,6 @@
<string name="a11y_links_available">Links available</string>

<!-- Translations feature-->

<!-- Translation request dialog -->
<!-- Title for the translation dialog that allows a user to translate the webpage. -->
<string name="translations_bottom_sheet_title">Translate this page?</string>
Expand Down

0 comments on commit ffed911

Please sign in to comment.