For #22189 - Replace the 'Firefox' word in all strings with placeholder

upstream-sync
Alexandru2909 2 years ago committed by mergify[bot]
parent f47a428f44
commit 5153cee0e0

@ -443,7 +443,7 @@ private fun assertWelcomeHeader() =
private fun assertStartSyncHeader() {
scrollToElementByText(STRING_ONBOARDING_ACCOUNT_SIGN_IN_HEADER)
onView(allOf(withText(R.string.onboarding_account_sign_in_header_1)))
onView(allOf(withText("Sync $appName between devices")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertAccountsSignInButton() =
@ -507,7 +507,7 @@ private fun assertAlwaysPrivacyText() {
onView(
allOf(
withText(
R.string.onboarding_tracking_protection_description_3
"$appName automatically stops companies from secretly following you around the web."
)
)
)

@ -93,9 +93,10 @@ class OpenInAppOnboardingObserver(
@VisibleForTesting
internal fun createInfoBanner(): DynamicInfoBanner {
val appName = context.getString(R.string.app_name)
return DynamicInfoBanner(
context = context,
message = context.getString(R.string.open_in_app_cfr_info_message),
message = context.getString(R.string.open_in_app_cfr_info_message_2, appName),
dismissText = context.getString(R.string.open_in_app_cfr_negative_button_text),
actionText = context.getString(R.string.open_in_app_cfr_positive_button_text),
container = container,

@ -27,7 +27,9 @@ class OnboardingManualSignInViewHolder(view: View) : RecyclerView.ViewHolder(vie
fun bind() {
val context = itemView.context
binding.headerText.text = context.getString(R.string.onboarding_account_sign_in_header_1)
val appName = context.getString(R.string.app_name)
binding.headerText.text =
context.getString(R.string.onboarding_account_sign_in_header_2, appName)
}
companion object {

@ -27,8 +27,9 @@ class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHold
standardTrackingProtection = binding.trackingProtectionStandardOption
strictTrackingProtection = binding.trackingProtectionStrictDefault
val appName = view.context.getString(R.string.app_name)
binding.descriptionText.text = view.context.getString(
R.string.onboarding_tracking_protection_description_3
R.string.onboarding_tracking_protection_description_4, appName
)
val isTrackingProtectionEnabled = view.context.settings().shouldUseTrackingProtection

@ -33,6 +33,14 @@ class HomeOnboardingDialogFragment : DialogFragment() {
super.onViewCreated(view, savedInstanceState)
val binding = FragmentOnboardingHomeDialogBinding.bind(view)
val appName = requireContext().getString(R.string.app_name)
binding.welcomeTitle.text =
requireContext().getString(R.string.onboarding_home_screen_title_3, appName)
binding.homeTitle.text = requireContext().getString(
R.string.onboarding_home_screen_section_home_title_3,
appName
)
binding.finishButton.setOnClickListener {
context?.settings()?.let { settings ->
settings.hasShownHomeOnboardingDialog = true

@ -114,7 +114,8 @@ class StudiesView(
@VisibleForTesting
internal fun bindDescription() {
val sumoUrl = SupportUtils.getGenericSumoURLForTopic(OPT_OUT_STUDIES)
val description = context.getString(R.string.studies_description)
val appName = context.getString(R.string.app_name)
val description = context.getString(R.string.studies_description_2, appName)
val learnMore = context.getString(R.string.studies_learn_more)
val rawText = "$description <a href=\"$sumoUrl\">$learnMore</a>"
val text = HtmlCompat.fromHtml(rawText, HtmlCompat.FROM_HTML_MODE_COMPACT)

@ -321,7 +321,10 @@ private fun SyncedTabsErrorPreview() {
FirefoxTheme {
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
SyncedTabsErrorItem(
errorText = stringResource(R.string.synced_tabs_no_tabs),
errorText = stringResource(
R.string.synced_tabs_no_tabs_2,
stringResource(R.string.app_name)
),
errorButton = SyncedTabsListItem.ErrorButton(
buttonText = stringResource(R.string.synced_tabs_sign_in_button)
) {

@ -112,7 +112,10 @@ class SyncedTabsIntegration(
SyncedTabsView.ErrorType.SYNC_UNAVAILABLE ->
SyncedTabsListItem.Error(
errorText = context.getString(R.string.synced_tabs_no_tabs),
errorText = context.getString(
R.string.synced_tabs_no_tabs_2,
context.getString(R.string.app_name)
),
errorButton = SyncedTabsListItem.ErrorButton(
buttonText = context.getString(R.string.synced_tabs_sign_in_button)
) {

@ -176,6 +176,12 @@ class SearchWidgetProvider : AppWidgetProvider() {
)?.toBitmap()
)
}
val appName = context.getString(R.string.app_name)
setContentDescription(
R.id.button_search_widget_new_tab_icon,
context.getString(R.string.search_widget_content_description_2, appName)
)
}
// Cell sizes obtained from the actual dimensions listed in search widget specs

@ -37,7 +37,6 @@
android:layout_marginTop="16dp"
android:layout_marginHorizontal="@dimen/oboarding_home_dialog_margin_horizontal"
android:lineHeight="24sp"
android:text="@string/onboarding_home_screen_title_2"
android:textAppearance="@style/Header20TextStyle"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
@ -78,7 +77,6 @@
android:layout_marginEnd="@dimen/oboarding_home_dialog_margin_horizontal"
android:layout_marginTop="26dp"
android:lineHeight="20sp"
android:text="@string/onboarding_home_screen_section_home_title_2"
android:textAppearance="@style/Header14TextStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/home_icon"

@ -55,7 +55,7 @@
android:layout_height="wrap_content"
android:layout_width="0dp"
android:padding="8dp"
android:text="@string/tab_tray_inactive_auto_close_body"
android:text="@string/tab_tray_inactive_auto_close_body_2"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintTop_toBottomOf="@id/banner_info_message"
app:layout_constraintStart_toStartOf="parent" />

@ -33,14 +33,14 @@
app:layout_constraintStart_toStartOf="@id/avatar_icon"
app:layout_constraintBottom_toBottomOf="@id/avatar_icon"
android:layout_marginStart="52dp"
tools:text="@string/onboarding_account_sign_in_header_1" />
tools:text="@string/onboarding_account_sign_in_header_2" />
<TextView
android:id="@+id/description_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="@string/onboarding_manual_sign_in_description"
android:text="@string/onboarding_manual_sign_in_description_2"
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintStart_toStartOf="@id/avatar_icon"
app:layout_constraintTop_toBottomOf="@id/header_text" />

@ -35,7 +35,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text"
tools:text="@string/onboarding_tracking_protection_description_3" />
tools:text="@string/onboarding_tracking_protection_description_4" />
<org.mozilla.fenix.onboarding.OnboardingRadioButton

@ -15,7 +15,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description"
android:contentDescription="@string/search_widget_content_description_2"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher_foreground" />

@ -15,7 +15,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description"
android:contentDescription="@string/search_widget_content_description_2"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher_foreground" />
</FrameLayout>

@ -14,7 +14,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"
android:contentDescription="@string/search_widget_content_description"
android:contentDescription="@string/search_widget_content_description_2"
android:scaleType="centerInside" />
<TextView

@ -11,7 +11,7 @@
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:contentDescription="@string/search_widget_content_description"
android:contentDescription="@string/search_widget_content_description_2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"

@ -13,7 +13,7 @@
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="@string/search_widget_content_description"
android:contentDescription="@string/search_widget_content_description_2"
android:scaleType="centerInside" />
<ImageView

@ -15,5 +15,5 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description" />
android:contentDescription="@string/search_widget_content_description_2" />
</FrameLayout>

@ -69,7 +69,9 @@
<!-- Open in App "contextual feature recommendation" (CFR) -->
<!-- Text for the info message. 'Firefox' intentionally hardcoded here.-->
<string name="open_in_app_cfr_info_message">You can set Firefox to automatically open links in apps.</string>
<string name="open_in_app_cfr_info_message" moz:RemovedIn="99" tools:ignore="UnusedResources">You can set Firefox to automatically open links in apps.</string>
<!-- Text for the info message. The first parameter is the name of the application.-->
<string name="open_in_app_cfr_info_message_2">You can set %1$s to automatically open links in apps.</string>
<!-- Text for the positive action button -->
<string name="open_in_app_cfr_positive_button_text">Go to settings</string>
<!-- Text for the negative action button -->
@ -95,7 +97,10 @@
<!-- Text for title for the auto-close dialog of the inactive tabs. -->
<string name="tab_tray_inactive_auto_close_title">Auto-close after one month?</string>
<!-- Text for the body for the auto-close dialog of the inactive tabs. -->
<string name="tab_tray_inactive_auto_close_body">Firefox can close tabs you havent viewed over the past month.</string>
<string name="tab_tray_inactive_auto_close_body" moz:RemovedIn="99" tools:ignore="UnusedResources">Firefox can close tabs you havent viewed over the past month.</string>
<!-- Text for the body for the auto-close dialog of the inactive tabs.
The first parameter is the name of the application.-->
<string name="tab_tray_inactive_auto_close_body_2">%1$s can close tabs you havent viewed over the past month.</string>
<!-- Content description for close button in the auto-close dialog of the inactive tabs. -->
<string name="tab_tray_inactive_auto_close_button_content_description">Close</string>
@ -237,11 +242,15 @@
<!-- Home onboarding -->
<!-- Onboarding home screen dialog title text. Firefox is intentionally hardcoded. -->
<string name="onboarding_home_screen_title_2">Whats new in Firefox</string>
<string name="onboarding_home_screen_title_2" moz:removedIn="99" tools:ignore="UnusedResources">Whats new in Firefox</string>
<!-- Onboarding home screen dialog title text. The first parameter is the name of the application.-->
<string name="onboarding_home_screen_title_3">Whats new in %1$s</string>
<!-- Onboarding home screen dialog description text. -->
<string name="onboarding_home_screen_description_2">Its now easier to pick back up where you left off.</string>
<!-- Onboarding home screen dialog title text for the home section. Firefox is intentionally hardcoded. -->
<string name="onboarding_home_screen_section_home_title_2">Personalized Firefox homepage</string>
<string name="onboarding_home_screen_section_home_title_2" moz:RemovedIn="99" tools:ignore="UnusedResources">Personalized Firefox homepage</string>
<!-- Onboarding home screen dialog title text for the home section. The first parameter is the name of the application.-->
<string name="onboarding_home_screen_section_home_title_3">Personalized %1$s homepage</string>
<!-- Onboarding home screen dialog description text for the home section. -->
<string name="onboarding_home_screen_section_home_description_2">Jump to your open tabs, bookmarks, and browsing history.</string>
<!-- Onboarding home screen dialog description text for the tab tray section. -->
@ -258,7 +267,9 @@
<!-- Search Widget -->
<!-- Content description for searching with a widget. Firefox is intentionally hardcoded.-->
<string name="search_widget_content_description">Open a new Firefox tab</string>
<string name="search_widget_content_description" moz:RemovedIn="99" tools:ignore="UnusedResources">Open a new Firefox tab</string>
<!-- Content description for searching with a widget. The first parameter is the name of the application.-->
<string name="search_widget_content_description_2">Open a new %1$s tab</string>
<!-- Text preview for smaller sized widgets -->
<string name="search_widget_text_short">Search</string>
<!-- Text preview for larger sized widgets -->
@ -624,7 +635,9 @@
<!-- Title of the active section on the studies list -->
<string name="studies_active">Active</string>
<!-- Description for studies, it indicates why Firefox use studies -->
<string name="studies_description">Firefox may install and run studies from time to time.</string>
<string name="studies_description" moz:RemovedIn="99" tools:ignore="UnusedResources">Firefox may install and run studies from time to time.</string>
<!-- Description for studies, it indicates why Firefox use studies. The first parameter is the name of the application. -->
<string name="studies_description_2">%1$s may install and run studies from time to time.</string>
<!-- Learn more link for studies, links to an article for more information about studies. -->
<string name="studies_learn_more">Learn more</string>
<!-- Dialog message shown after removing a study -->
@ -1115,9 +1128,12 @@
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_header">Welcome to %s!</string>
<!-- text for the Firefox account onboarding sign in card header. The word "Firefox" should not be translated -->
<string name="onboarding_account_sign_in_header_1">Sync Firefox between devices</string>
<string name="onboarding_account_sign_in_header_1" moz:RemovedIn="99" tools:ignore="UnusedResources">Sync Firefox between devices</string>
<!-- text for the Firefox account onboarding sign in card header. The first parameter is the name of the application.-->
<string name="onboarding_account_sign_in_header_2">Sync %1$s between devices</string>
<!-- Text for the button to learn more about signing in to your Firefox account -->
<string name="onboarding_manual_sign_in_description">Bring bookmarks, history, and passwords to Firefox on this device.</string>
<!-- Text for the button to learn more about signing in to your Firefox account. The first parameter is the name of the application.-->
<string name="onboarding_manual_sign_in_description_2">Bring bookmarks, history, and passwords to %1$s on this device.</string>
<!-- text for the button to manually sign into Firefox account. -->
<string name="onboarding_firefox_account_sign_in_1">Sign up</string>
<!-- text to display in the snackbar once account is signed-in -->
@ -1125,7 +1141,9 @@
<!-- text for the tracking protection onboarding card header -->
<string name="onboarding_tracking_protection_header_3">Always-on privacy</string>
<!-- text for the tracking protection card description. 'Firefox' intentionally hardcoded here -->
<string name="onboarding_tracking_protection_description_3">Firefox automatically stops companies from secretly following you around the web.</string>
<string name="onboarding_tracking_protection_description_3" moz:RemovedIn="99" tools:ignore="UnusedResources">Firefox automatically stops companies from secretly following you around the web.</string>
<!-- text for the tracking protection card description. The first parameter is the name of the application.-->
<string name="onboarding_tracking_protection_description_4">%1$s automatically stops companies from secretly following you around the web.</string>
<!-- text for tracking protection radio button option for standard level of blocking -->
<string name="onboarding_tracking_protection_standard_button_2">Standard (default)</string>
<!-- text for standard blocking option button description -->
@ -1615,7 +1633,9 @@
<!-- Text displayed when user has disabled tab syncing in Firefox Sync Account -->
<string name="synced_tabs_enable_tab_syncing">Please enable tab syncing.</string>
<!-- Text displayed when user has no tabs that have been synced -->
<string name="synced_tabs_no_tabs">You dont have any tabs open in Firefox on your other devices.</string>
<string name="synced_tabs_no_tabs" moz:removedIn="99" tools:ignore="UnusedResources">You dont have any tabs open in Firefox on your other devices.</string>
<!-- Text displayed when user has no tabs that have been synced. The first parameter is the name of the application.-->
<string name="synced_tabs_no_tabs_2">You dont have any tabs open in %1$s on your other devices.</string>
<!-- Text displayed in the synced tabs screen when a user is not signed in to Firefox Sync describing Synced Tabs -->
<string name="synced_tabs_sign_in_message">View a list of tabs from your other devices.</string>
<!-- Text displayed on a button in the synced tabs screen to link users to sign in when a user is not signed in to Firefox Sync -->

@ -51,7 +51,8 @@ class OnboardingManualSignInViewHolderTest {
@Test
fun `bind header text`() {
OnboardingManualSignInViewHolder(binding.root).bind()
val string = testContext.getString(R.string.onboarding_account_sign_in_header_1)
val appName = testContext.getString(R.string.app_name)
val string = testContext.getString(R.string.onboarding_account_sign_in_header_2, appName)
assertEquals(
string,
binding.headerText.text

@ -34,7 +34,9 @@ class OnboardingTrackingProtectionViewHolderTest {
every { testContext.components.settings } returns Settings(testContext)
OnboardingTrackingProtectionViewHolder(binding.root)
val string = testContext.getString(R.string.onboarding_tracking_protection_description_3)
val appName = testContext.getString(R.string.app_name)
val string =
testContext.getString(R.string.onboarding_tracking_protection_description_4, appName)
assertEquals(string, binding.descriptionText.text)
}
}

Loading…
Cancel
Save