1
0
Fork 0

For #7208 For #7212 - Update parameterized strings

master
ekager 2020-04-09 17:48:20 -07:00 committed by Emily Kager
parent 152642d98d
commit 5039546dc5
6 changed files with 28 additions and 11 deletions

View File

@ -56,7 +56,7 @@ class BackgroundServices(
fun defaultDeviceName(context: Context): String = fun defaultDeviceName(context: Context): String =
context.getString( context.getString(
R.string.default_device_name, R.string.default_device_name_2,
context.getString(R.string.app_name), context.getString(R.string.app_name),
Build.MANUFACTURER, Build.MANUFACTURER,
Build.MODEL Build.MODEL

View File

@ -25,8 +25,18 @@ object PrivateShortcutCreateManager {
val icon = IconCompat.createWithResource(context, R.mipmap.ic_launcher_private_round) val icon = IconCompat.createWithResource(context, R.mipmap.ic_launcher_private_round)
val shortcut = ShortcutInfoCompat.Builder(context, UUID.randomUUID().toString()) val shortcut = ShortcutInfoCompat.Builder(context, UUID.randomUUID().toString())
.setShortLabel(context.getString(R.string.app_name_private_2)) .setShortLabel(
.setLongLabel(context.getString(R.string.app_name_private_2)) context.getString(
R.string.app_name_private_5,
context.getString(R.string.app_name)
)
)
.setLongLabel(
context.getString(
R.string.app_name_private_5,
context.getString(R.string.app_name)
)
)
.setIcon(icon) .setIcon(icon)
.setIntent(Intent(context, HomeActivity::class.java).apply { .setIntent(Intent(context, HomeActivity::class.java).apply {
action = Intent.ACTION_VIEW action = Intent.ACTION_VIEW

View File

@ -76,7 +76,7 @@ class SessionNotificationService : Service() {
return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setOngoing(true) .setOngoing(true)
.setSmallIcon(R.drawable.ic_pbm_notification) .setSmallIcon(R.drawable.ic_pbm_notification)
.setContentTitle(getString(R.string.app_name_private_3)) .setContentTitle(getString(R.string.app_name_private_4, getString(R.string.app_name)))
.setContentText(getString(R.string.notification_pbm_delete_text_2)) .setContentText(getString(R.string.notification_pbm_delete_text_2))
.setContentIntent(createNotificationIntent()) .setContentIntent(createNotificationIntent())
.setVisibility(NotificationCompat.VISIBILITY_SECRET) .setVisibility(NotificationCompat.VISIBILITY_SECRET)

View File

@ -49,7 +49,12 @@ class SignOutFragment : BottomSheetDialogFragment() {
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
accountManager = requireComponents.backgroundServices.accountManager accountManager = requireComponents.backgroundServices.accountManager
return inflater.inflate(R.layout.fragment_sign_out, container, false) val view = inflater.inflate(R.layout.fragment_sign_out, container, false)
view.sign_out_message.text = view.context.getString(
R.string.sign_out_confirmation_message_2,
view.context.getString(R.string.app_name)
)
return view
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View File

@ -16,7 +16,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
app:drawableStartCompat="@drawable/ic_info" app:drawableStartCompat="@drawable/ic_info"
android:text="@string/sign_out_confirmation_message" android:text="@string/sign_out_confirmation_message_2"
android:textSize="16sp" android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@ -2,10 +2,10 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources> <resources>
<!-- App name for private browsing mode, only the "Private" portion should be localized. --> <!-- App name for private browsing mode. The first parameter is the name of the app defined in app_name (for example: Fenix)-->
<string name="app_name_private_2">Private Firefox Preview</string> <string name="app_name_private_5">Private %s</string>
<!-- App name for private browsing mode, only the "Private" portion should be localized. --> <!-- App name for private browsing mode. The first parameter is the name of the app defined in app_name (for example: Fenix)-->
<string name="app_name_private_3">Firefox Preview (Private)</string> <string name="app_name_private_4">%s (Private)</string>
<!-- Home Fragment --> <!-- Home Fragment -->
<!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. --> <!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. -->
<string name="content_description_menu">More options</string> <string name="content_description_menu">More options</string>
@ -292,7 +292,7 @@
<!-- Text for displaying the default device name. <!-- Text for displaying the default device name.
The first parameter is the application name, the second is the device manufacturer name The first parameter is the application name, the second is the device manufacturer name
and the third is the device model. --> and the third is the device model. -->
<string name="default_device_name">%s on %s %s</string> <string name="default_device_name_2">%1$s on %2$s %3$s</string>
<!-- Send Tab --> <!-- Send Tab -->
<!-- Name of the "receive tabs" notification channel. Displayed in the "App notifications" system settings for the app --> <!-- Name of the "receive tabs" notification channel. Displayed in the "App notifications" system settings for the app -->
@ -952,6 +952,8 @@
<string name="sign_in_with_email">Use email instead</string> <string name="sign_in_with_email">Use email instead</string>
<!-- Text shown in confirmation dialog to sign out of account --> <!-- Text shown in confirmation dialog to sign out of account -->
<string name="sign_out_confirmation_message">Firefox will stop syncing with your account, but wont delete any of your browsing data on this device.</string> <string name="sign_out_confirmation_message">Firefox will stop syncing with your account, but wont delete any of your browsing data on this device.</string>
<!-- Text shown in confirmation dialog to sign out of account. The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="sign_out_confirmation_message_2">%s will stop syncing with your account, but wont delete any of your browsing data on this device.</string>
<!-- Option to continue signing out of account shown in confirmation dialog to sign out of account --> <!-- Option to continue signing out of account shown in confirmation dialog to sign out of account -->
<string name="sign_out_disconnect">Disconnect</string> <string name="sign_out_disconnect">Disconnect</string>
<!-- Option to cancel signing out shown in confirmation dialog to sign out of account --> <!-- Option to cancel signing out shown in confirmation dialog to sign out of account -->