1
0
Fork 0

No issue: Remove plurals strings (#2234)

master
Emily Kager 2019-05-02 12:32:49 -07:00 committed by Colin Lee
parent 34bd6513b6
commit 7dda013ad1
6 changed files with 20 additions and 15 deletions

View File

@ -129,9 +129,10 @@ class CollectionCreationUIView(
val selectTabsText = if (it.selectedTabs.isEmpty()) {
view.context.getString(R.string.create_collection_save_to_collection_empty)
} else {
view.context.resources.getQuantityString(
R.plurals.create_collection_save_to_collection_full_plural,
it.selectedTabs.size,
view.context.getString(
if (it.selectedTabs.size == 1)
R.string.create_collection_save_to_collection_tab_selected else
R.string.create_collection_save_to_collection_tabs_selected,
it.selectedTabs.size
)
}

View File

@ -100,7 +100,9 @@ class CreateCollectionFragment : DialogFragment() {
context?.let { context: Context ->
val rootView = context.getRootView()
rootView?.let { view: View ->
val string = context.resources.getQuantityString(R.plurals.create_collection_tabs_saved, tabSize)
val string =
if (tabSize > 1) context.getString(R.string.create_collection_tabs_saved) else
context.getString(R.string.create_collection_tab_saved)
FenixSnackbar.make(view, Snackbar.LENGTH_LONG).setText(string)
.show()
}

View File

@ -157,6 +157,7 @@
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/save_button"
app:layout_constraintStart_toEndOf="@id/close_icon"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -164,6 +164,7 @@
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/save_button"
app:layout_constraintStart_toEndOf="@id/close_icon"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -165,6 +165,7 @@
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/save_button"
app:layout_constraintStart_toEndOf="@id/close_icon"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -434,18 +434,17 @@
<!-- Text to prompt users to select the tabs to save in the "select tabs" stepof the collection creator -->
<string name="create_collection_save_to_collection_empty">Select tabs to save</string>
<!-- Text to prompt users to select how many tabs they have
selected in the "select tabs" stepof the collection creator -->
<plurals name="create_collection_save_to_collection_full_plural">
<item quantity="one">%d tab selected</item>
<item quantity="other">%d tabs selected</item>
</plurals>
<!-- Text to show users how many tabs they have selected in the "select tabs" step of the collection creator -->
<string name="create_collection_save_to_collection_tabs_selected">%d tabs selected</string>
<!-- Text shown in snackbar when tab(s) have been saved in a collection -->
<plurals name="create_collection_tabs_saved">
<item quantity="one">Tab saved!</item>
<item quantity="other">Tabs saved!</item>
</plurals>
<!-- Text to show users they have one tab selected in the "select tabs" step of the collection creator -->
<string name="create_collection_save_to_collection_tab_selected">%d tab selected</string>
<!-- Text shown in snackbar when multiple tabs have been saved in a collection -->
<string name="create_collection_tabs_saved">Tabs saved!</string>
<!-- Text shown in snackbar when one tab has been saved in a collection -->
<string name="create_collection_tab_saved">Tab saved!</string>
<!-- Content description (not visible, for screen readers etc.): button to close the collection creator -->
<string name="create_collection_close">Close</string>