Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #7208 For #7212 - Update parameterized strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ekager authored and liuche committed Apr 13, 2020
1 parent bf538b7 commit e869eb2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BackgroundServices(

fun defaultDeviceName(context: Context): String =
context.getString(
R.string.default_device_name,
R.string.default_device_name_2,
context.getString(R.string.app_name),
Build.MANUFACTURER,
Build.MODEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@ object PrivateShortcutCreateManager {

val icon = IconCompat.createWithResource(context, R.mipmap.ic_launcher_private_round)
val shortcut = ShortcutInfoCompat.Builder(context, UUID.randomUUID().toString())
.setShortLabel(context.getString(R.string.app_name_private_2))
.setLongLabel(context.getString(R.string.app_name_private_2))
.setShortLabel(
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)
.setIntent(Intent(context, HomeActivity::class.java).apply {
action = Intent.ACTION_VIEW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SessionNotificationService : Service() {
return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setOngoing(true)
.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))
.setContentIntent(createNotificationIntent())
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ class SignOutFragment : BottomSheetDialogFragment() {
savedInstanceState: Bundle?
): View? {
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?) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_sign_out.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:drawableStartCompat="@drawable/ic_info"
android:text="@string/sign_out_confirmation_message"
android:text="@string/sign_out_confirmation_message_2"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
- 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/. -->
<resources>
<!-- App name for private browsing mode, only the "Private" portion should be localized. -->
<string name="app_name_private_2">Private Firefox Preview</string>
<!-- App name for private browsing mode, only the "Private" portion should be localized. -->
<string name="app_name_private_3">Firefox Preview (Private)</string>
<!-- 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_5">Private %s</string>
<!-- 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_4">%s (Private)</string>
<!-- Home Fragment -->
<!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. -->
<string name="content_description_menu">More options</string>
Expand Down Expand Up @@ -292,7 +292,7 @@
<!-- Text for displaying the default device name.
The first parameter is the application name, the second is the device manufacturer name
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 -->
<!-- Name of the "receive tabs" notification channel. Displayed in the "App notifications" system settings for the app -->
Expand Down Expand Up @@ -952,6 +952,8 @@
<string name="sign_in_with_email">Use email instead</string>
<!-- Text shown in confirmation dialog to sign out of account -->
<string name="sign_out_confirmation_message">Firefox will stop syncing with your account, but won’t 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 won’t 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 -->
<string name="sign_out_disconnect">Disconnect</string>
<!-- Option to cancel signing out shown in confirmation dialog to sign out of account -->
Expand Down

0 comments on commit e869eb2

Please sign in to comment.