Use integer format strings

Use %d in certain format strings instead of %s
This commit is contained in:
OxygenCobalt 2021-01-25 19:11:04 -07:00
parent 28a59dc6f7
commit c9d7193bd7
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
6 changed files with 31 additions and 26 deletions

View file

@ -37,7 +37,7 @@ class AboutDialog : BottomSheetDialogFragment() {
binding.aboutFaq.setOnClickListener { openLinkInBrowser(LINK_FAQ) } binding.aboutFaq.setOnClickListener { openLinkInBrowser(LINK_FAQ) }
binding.aboutLicenses.setOnClickListener { openLinkInBrowser(LINK_LICENSES) } binding.aboutLicenses.setOnClickListener { openLinkInBrowser(LINK_LICENSES) }
binding.aboutSongCount.text = getString( binding.aboutSongCount.text = getString(
R.string.format_songs_loaded, musicStore.songs.size.toString() R.string.format_songs_loaded, musicStore.songs.size
) )
logD("Dialog created.") logD("Dialog created.")

View file

@ -112,8 +112,9 @@
android:focusable="true" android:focusable="true"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:text="@string/label_code" android:text="@string/label_code"
android:textAlignment="viewStart"
app:drawableStartCompat="@drawable/ic_code"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:drawableLeftCompat="@drawable/ic_code"
app:layout_constraintBottom_toTopOf="@+id/about_faq" app:layout_constraintBottom_toTopOf="@+id/about_faq"
app:layout_constraintTop_toBottomOf="@+id/version_container" /> app:layout_constraintTop_toBottomOf="@+id/version_container" />
@ -127,8 +128,9 @@
android:focusable="true" android:focusable="true"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:text="@string/label_licenses" android:text="@string/label_licenses"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:drawableLeftCompat="@drawable/ic_license" app:drawableStartCompat="@drawable/ic_license"
app:layout_constraintBottom_toTopOf="@+id/about_song_count" app:layout_constraintBottom_toTopOf="@+id/about_song_count"
app:layout_constraintTop_toBottomOf="@+id/about_faq" /> app:layout_constraintTop_toBottomOf="@+id/about_faq" />
@ -142,8 +144,9 @@
android:focusable="true" android:focusable="true"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:text="@string/label_faq" android:text="@string/label_faq"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:drawableLeftCompat="@drawable/ic_about" app:drawableStartCompat="@drawable/ic_about"
app:layout_constraintBottom_toTopOf="@+id/about_licenses" app:layout_constraintBottom_toTopOf="@+id/about_licenses"
app:layout_constraintTop_toBottomOf="@+id/about_code" app:layout_constraintTop_toBottomOf="@+id/about_code"
tools:layout_editor_absoluteX="0dp" /> tools:layout_editor_absoluteX="0dp" />
@ -154,8 +157,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="@dimen/padding_medium" android:drawablePadding="@dimen/padding_medium"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:drawableLeftCompat="@drawable/ic_song" app:drawableStartCompat="@drawable/ic_song"
app:layout_constraintBottom_toTopOf="@+id/about_author" app:layout_constraintBottom_toTopOf="@+id/about_author"
app:layout_constraintTop_toBottomOf="@+id/about_licenses" app:layout_constraintTop_toBottomOf="@+id/about_licenses"
tools:text="Songs Loaded: 1616" /> tools:text="Songs Loaded: 1616" />
@ -166,8 +170,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="@dimen/padding_medium" android:drawablePadding="@dimen/padding_medium"
android:padding="@dimen/padding_medium" android:padding="@dimen/padding_medium"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
app:drawableLeftCompat="@drawable/ic_author" app:drawableStartCompat="@drawable/ic_author"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/about_song_count" app:layout_constraintTop_toBottomOf="@+id/about_song_count"
android:text="@string/label_author" /> android:text="@string/label_author" />

View file

@ -59,7 +59,7 @@
<string name="description_album_cover">Albumcover für %s</string> <string name="description_album_cover">Albumcover für %s</string>
<string name="description_artist_image">Künstlerbild für %s</string> <string name="description_artist_image">Künstlerbild für %s</string>
<string name="description_genre_image">Genrebild für %s</string> <string name="description_genre_image">Genrebild für %s</string>
<string name="description_track_number">Titel %s</string> <string name="description_track_number">Titel %d</string>
<string name="description_error">Fehler</string> <string name="description_error">Fehler</string>
<string name="placeholder_no_date">Kein Datum</string> <string name="placeholder_no_date">Kein Datum</string>
<string name="color_label_red">Rot</string> <string name="color_label_red">Rot</string>
@ -88,7 +88,7 @@
<string name="placeholder_genre">Unbekanntes Genre</string> <string name="placeholder_genre">Unbekanntes Genre</string>
<string name="placeholder_artist">Unbekannter Künstler</string> <string name="placeholder_artist">Unbekannter Künstler</string>
<string name="placeholder_album">Unbekanntes Album</string> <string name="placeholder_album">Unbekanntes Album</string>
<string name="format_songs_loaded">Lieden geladen: %s</string> <string name="format_songs_loaded">Lieden geladen: %d</string>
<string name="label_author">Entwickelt von OxygenCobalt</string> <string name="label_author">Entwickelt von OxygenCobalt</string>
<string name="description_play">Abspielen</string> <string name="description_play">Abspielen</string>
<string name="description_pause">Pausieren</string> <string name="description_pause">Pausieren</string>
@ -122,12 +122,12 @@
<string name="setting_behavior_rewind_prev">Zurückspulen, bevor zurück springen</string> <string name="setting_behavior_rewind_prev">Zurückspulen, bevor zurück springen</string>
<string name="info_app_desc">Ein einfacher und flexibeler Musik-Player für Android</string> <string name="info_app_desc">Ein einfacher und flexibeler Musik-Player für Android</string>
<plurals name="format_song_count"> <plurals name="format_song_count">
<item quantity="one">%s Lied</item> <item quantity="one">%d Lied</item>
<item quantity="other">%s Lieder</item> <item quantity="other">%d Lieder</item>
</plurals> </plurals>
<plurals name="format_album_count"> <plurals name="format_album_count">
<item quantity="one">%s Album</item> <item quantity="one">%d Album</item>
<item quantity="other">%s Alben</item> <item quantity="other">%d Alben</item>
</plurals> </plurals>
</resources> </resources>

View file

@ -63,18 +63,18 @@
<string name="color_label_grey">Gris</string> <string name="color_label_grey">Gris</string>
<string name="color_label_blue_grey">Azul Gris</string> <string name="color_label_blue_grey">Azul Gris</string>
<string name="color_label_neutral">Neutro</string> <string name="color_label_neutral">Neutro</string>
<string name="format_songs_loaded">Canciones cargado: %s</string> <string name="format_songs_loaded">Canciones encontradas: %d</string>
<string name="description_error">Error</string> <string name="description_error">Error</string>
<string name="description_track_number">Pista %s</string> <string name="description_track_number">Pista %d</string>
<string name="error_no_music">No se encontró música</string> <string name="error_no_music">No se encontró música</string>
<plurals name="format_song_count"> <plurals name="format_song_count">
<item quantity="one">%s Canción</item> <item quantity="one">%d Canción</item>
<item quantity="other">%s Canciones</item> <item quantity="other">%d Canciones</item>
</plurals> </plurals>
<plurals name="format_album_count"> <plurals name="format_album_count">
<item quantity="one">%s Álbum</item> <item quantity="one">%d Álbum</item>
<item quantity="other">%s Álbumes</item> <item quantity="other">%d Álbumes</item>
</plurals> </plurals>
</resources> </resources>

View file

@ -60,12 +60,12 @@
<string name="color_label_grey">Gris</string> <string name="color_label_grey">Gris</string>
<string name="color_label_blue_grey">Bleu Gris</string> <string name="color_label_blue_grey">Bleu Gris</string>
<string name="color_label_neutral">Neutre</string> <string name="color_label_neutral">Neutre</string>
<string name="format_songs_loaded">Titres chargés: %s</string> <string name="format_songs_loaded">Titres chargés: %d</string>
<string name="label_all_songs">Tous Titres</string> <string name="label_all_songs">Tous Titres</string>
<string name="label_queue_add">Ajouter à la file d\'attente</string> <string name="label_queue_add">Ajouter à la file d\'attente</string>
<string name="setting_lib_display">Bibliothèque Objets</string> <string name="setting_lib_display">Bibliothèque Objets</string>
<string name="color_label_red">Rouge</string> <string name="color_label_red">Rouge</string>
<string name="description_track_number">Morceau %s</string> <string name="description_track_number">Morceau %d</string>
<plurals name="format_song_count"> <plurals name="format_song_count">
<item quantity="one">%s Titre</item> <item quantity="one">%s Titre</item>
<item quantity="other">%s Titres</item> <item quantity="other">%s Titres</item>

View file

@ -111,7 +111,7 @@
<string name="description_album_cover">Album Cover for %s</string> <string name="description_album_cover">Album Cover for %s</string>
<string name="description_artist_image">Artist Image for %s</string> <string name="description_artist_image">Artist Image for %s</string>
<string name="description_genre_image">Genre Image for %s</string> <string name="description_genre_image">Genre Image for %s</string>
<string name="description_track_number">Track %s</string> <string name="description_track_number">Track %d</string>
<string name="description_error">Error</string> <string name="description_error">Error</string>
<string name="description_sort_button">Change Sort Order</string> <string name="description_sort_button">Change Sort Order</string>
<string name="description_sort_none">Default Sort Order</string> <string name="description_sort_none">Default Sort Order</string>
@ -158,15 +158,15 @@
<!-- Format Namespace | Value formatting/plurals --> <!-- Format Namespace | Value formatting/plurals -->
<string name="format_next_from">Next From: %s</string> <string name="format_next_from">Next From: %s</string>
<string name="format_songs_loaded">Songs Loaded: %s</string> <string name="format_songs_loaded">Songs Loaded: %d</string>
<plurals name="format_song_count"> <plurals name="format_song_count">
<item quantity="one">%s Song</item> <item quantity="one">%d Song</item>
<item quantity="other">%s Songs</item> <item quantity="other">%d Songs</item>
</plurals> </plurals>
<plurals name="format_album_count"> <plurals name="format_album_count">
<item quantity="one">%s Album</item> <item quantity="one">%d Album</item>
<item quantity="other">%s Albums</item> <item quantity="other">%d Albums</item>
</plurals> </plurals>
</resources> </resources>