Skip to content

Commit

Permalink
[res] improve plurals strings
Browse files Browse the repository at this point in the history
  • Loading branch information
chr56 committed Apr 28, 2023
1 parent 6b23206 commit 6780d72
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 165 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/player/phonograph/model/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fun Song.infoString(): String =
buildInfoString(artistName, albumName)

fun songCountString(context: Context, songCount: Int): String =
context.resources.getQuantityString(R.plurals.x_songs, songCount, songCount)
context.resources.getQuantityString(R.plurals.item_songs, songCount, songCount)

fun Artist.infoString(context: Context): String =
buildInfoString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class StarterActivity : AppCompatActivity() {
append("${getString(R.string.action_play)}\n")
val songs = playRequest.songs
val count = songs.size
append("${context.resources.getQuantityString(R.plurals.x_songs, count, count)}\n")
append("${context.resources.getQuantityString(R.plurals.item_songs, count, count)}\n")
songs.take(10).forEach {
append("${it.title}\n")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ class FilesPageAdapter(
text.text = when (item) {
is FileEntity.File -> Formatter.formatFileSize(context, item.size)
is FileEntity.Folder -> context.resources.getQuantityString(
R.plurals.x_songs,
item.songCount,
item.songCount
R.plurals.item_songs, item.songCount, item.songCount
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class AlbumPage : AbsDisplayPage<Album, DisplayAdapter<Album>, GridLayoutManager

override fun getHeaderText(): CharSequence {
val n = getDataSet().size
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.x_albums, n, n)
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.item_albums, n, n)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ArtistPage : AbsDisplayPage<Artist, DisplayAdapter<Artist>, GridLayoutMana

override fun getHeaderText(): CharSequence {
val n = getDataSet().size
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.x_artists, n, n)
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.item_artists, n, n)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class FlattenFolderPage : AbsPage() {
R.plurals.item_files, size, size
) else
requireContext().resources.getQuantityString(
R.plurals.x_songs, size, size
R.plurals.item_songs, size, size
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class GenrePage : AbsDisplayPage<Genre, DisplayAdapter<Genre>, GridLayoutManager

override fun getHeaderText(): CharSequence {
val n = getDataSet().size
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.x_genres, n, n)
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.item_genres, n, n)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SongPage : AbsDisplayPage<Song, DisplayAdapter<Song>, GridLayoutManager>()

override fun getHeaderText(): CharSequence {
val n = getDataSet().size
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.x_songs, n, n)
return hostFragment.mainActivity.resources.getQuantityString(R.plurals.item_songs, n, n)
}

override fun configAppBar(panelToolbar: Toolbar) {
Expand Down
32 changes: 14 additions & 18 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,50 +318,46 @@
<string name="load_images_for_files">Bilder für Dateien laden</string>
<string name="app_language">Anwendungssprache</string>
<string name="_default">Standard</string>
<plurals name="x_songs">
<plurals name="item_songs">
<item quantity="one">%1$d Song</item>
<item quantity="other">%1$d Songs</item>
</plurals>
<plurals name="x_albums">
<plurals name="item_albums">
<item quantity="one">%1$d Album</item>
<item quantity="other">%1$d Alben</item>
</plurals>
<plurals name="x_artists">
<plurals name="item_artists">
<item quantity="one">%1$d Interpret</item>
<item quantity="other">%1$d Interpreten</item>
</plurals>
<plurals name="x_genres">
<plurals name="item_genres">
<item quantity="one">%1$d Genre</item>
<item quantity="other">%1$d Genres</item>
</plurals>
<plurals name="msg_header_delete_items">
<item quantity="one">Ein Element wird gelöscht.</item>
<item quantity="other">Die Elemente werden gelöscht.</item>
<item quantity="one">%1$d Element wird gelöscht.</item>
<item quantity="other">%1$d Elemente werden gelöscht.</item>
</plurals>
<plurals name="msg_header_remove_items">
<!-- %1$s: where -->
<item quantity="one">Dieses Element würde aus %1$s entfernt:</item>
<item quantity="other">Diese Elemente würde aus %1$s entfernt:</item>
<item quantity="one">%1$d Element würde aus %1$s entfernt:</item>
<item quantity="other">%1$d Elemente würde aus %1$s entfernt:</item>
</plurals>
<plurals name="msg_deletion_result">
<item quantity="one">%1$d / %2$d Elementen wurde erfolgreich gelöscht.</item>
<item quantity="other">%1$d / %2$d Elementen wurde erfolgreich gelöscht.</item>
</plurals>
<plurals name="item_songs">
<item quantity="one">Song</item>
<item quantity="other">Songs</item>
</plurals>
<plurals name="item_playlists">
<item quantity="one">Wiedergabeliste</item>
<item quantity="other">Wiedergabelisten</item>
<item quantity="one">%1$d Wiedergabeliste</item>
<item quantity="other">%1$d Wiedergabelisten</item>
</plurals>
<plurals name="item_files">
<item quantity="one">Datei</item>
<item quantity="other">Dateien</item>
<item quantity="one">%1$d Datei</item>
<item quantity="other">%1$d Dateien</item>
</plurals>
<plurals name="item_playlists_generated">
<item quantity="one">Generierte Wiedergabeliste</item>
<item quantity="other">Generierte Wiedergabelisten</item>
<item quantity="one">%1$d Generierte Wiedergabeliste</item>
<item quantity="other">%1$d Generierte Wiedergabelisten</item>
</plurals>
<string name="warning_can_not_retract">Diese Aktion kann nicht rückgängig gemacht werden!</string>
<string name="delete_with_lyrics">Mit Songtext löschen</string>
Expand Down
35 changes: 15 additions & 20 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<string name="action_set_as_ringtone">Définir comme sonnerie</string>
<string name="action_share">Partager</string>
<string name="action_settings">Paramètres</string>
Expand Down Expand Up @@ -292,20 +292,20 @@
<string name="load_images_for_files">Charger les images pour les fichiers</string>
<string name="app_language">Langue de l\'application</string>
<string name="_default">Par défaut</string>
<plurals name="x_songs">
<plurals name="item_songs">
<item quantity="one">%1$d morceau</item>
<item quantity="many">%1$d morceaux</item>
<item quantity="other">%1$d morceaux</item>
</plurals>
<plurals name="x_artists">
<plurals name="item_artists">
<item quantity="one">%1$d artiste</item>
<item quantity="many">%1$d artistes</item>
<item quantity="other">%1$d artistes</item>
</plurals>
<plurals name="msg_header_delete_items">
<item quantity="one" tools:ignore="ImpliedQuantity">Cet élément sera supprimé :</item>
<item quantity="many">Ces éléments seront supprimés :</item>
<item quantity="other">Ces éléments seront supprimés :</item>
<item quantity="one">%1$d Cet élément sera supprimé :</item>
<item quantity="many">%1$d Ces éléments seront supprimés :</item>
<item quantity="other">%1$d Ces éléments seront supprimés :</item>
</plurals>
<plurals name="msg_header_remove_items">
<!-- %1$s: where -->
Expand All @@ -318,25 +318,20 @@
<item quantity="many">%1$d / %2$d éléments ont été supprimés avec succès.</item>
<item quantity="other">%1$d / %2$d éléments ont été supprimés avec succès.</item>
</plurals>
<plurals name="item_songs">
<item quantity="one" tools:ignore="ImpliedQuantity">Morceau</item>
<item quantity="many">Morceaux</item>
<item quantity="other">Morceaux</item>
</plurals>
<plurals name="item_playlists">
<item quantity="one" tools:ignore="ImpliedQuantity">Liste de lecture</item>
<item quantity="many">Listes de lecture</item>
<item quantity="other">Listes de lecture</item>
<item quantity="one">%1$d Liste de lecture</item>
<item quantity="many">%1$d Listes de lecture</item>
<item quantity="other">%1$d Listes de lecture</item>
</plurals>
<plurals name="item_files">
<item quantity="one" tools:ignore="ImpliedQuantity">fichier</item>
<item quantity="many">fichiers</item>
<item quantity="other">fichiers</item>
<item quantity="one">%1$d fichier</item>
<item quantity="many">%1$d fichiers</item>
<item quantity="other">%1$d fichiers</item>
</plurals>
<plurals name="item_playlists_generated">
<item quantity="one" tools:ignore="ImpliedQuantity">Liste de lecture générée</item>
<item quantity="many">Listes de lecture générées</item>
<item quantity="other">Listes de lecture générées</item>
<item quantity="one">%1$d Liste de lecture générée</item>
<item quantity="many">%1$d Listes de lecture générées</item>
<item quantity="other">%1$d Listes de lecture générées</item>
</plurals>
<string name="warning_can_not_retract">Cette action ne peut pas être annulée !</string>
</resources>
24 changes: 10 additions & 14 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,19 @@
<string name="load_images_for_files">Carica immagini per i file</string>
<string name="app_language">Lingua Applicazione</string>
<string name="_default">Predefinito</string>
<plurals name="x_songs">
<plurals name="item_songs">
<item quantity="one">%1$d brano</item>
<item quantity="other">%1$d brani</item>
</plurals>
<plurals name="x_albums">
<plurals name="item_albums">
<item quantity="one">%1$d album</item>
<item quantity="other">%1$d albums</item>
</plurals>
<plurals name="x_artists">
<plurals name="item_artists">
<item quantity="one">%1$d artista</item>
<item quantity="other">%1$d artisti</item>
</plurals>
<plurals name="x_genres">
<plurals name="item_genres">
<item quantity="one">%1$d genere</item>
<item quantity="other">%1$d generi</item>
</plurals>
Expand All @@ -346,21 +346,17 @@
<item quantity="one">%1$d / %2$d elemento è stato eliminato con successo.</item>
<item quantity="other">%1$d / %2$d elementi sono stati eliminati con successo.</item>
</plurals>
<plurals name="item_songs">
<item quantity="one">Brano</item>
<item quantity="other">Brani</item>
</plurals>
<plurals name="item_playlists">
<item quantity="one">Scaletta</item>
<item quantity="other">Scalette</item>
<item quantity="one">%1$d Scaletta</item>
<item quantity="other">%1$d Scalette</item>
</plurals>
<plurals name="item_files">
<item quantity="one">file</item>
<item quantity="other">files</item>
<item quantity="one">%1$d file</item>
<item quantity="other">%1$d files</item>
</plurals>
<plurals name="item_playlists_generated">
<item quantity="one">Scaletta Generata</item>
<item quantity="other">Scalette Generate</item>
<item quantity="one">%1$d Scaletta Generata</item>
<item quantity="other">%1$d Scalette Generate</item>
</plurals>
<string name="warning_can_not_retract">Questa azione non può essere ritrattata!</string>
<string name="delete_with_lyrics">Elimina con i testi</string>
Expand Down
17 changes: 7 additions & 10 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,13 @@
<string name="load_images_for_files">ファイルのカバーアートを読み込む</string>
<string name="app_language">アプリケーションの言語</string>
<string name="_default">デフォルト</string>
<plurals name="x_songs">
<item quantity="other">%1$d 曲</item>
</plurals>
<plurals name="x_albums">
<plurals name="item_albums">
<item quantity="other">%1$d アルバム</item>
</plurals>
<plurals name="x_artists">
<plurals name="item_artists">
<item quantity="other">%1$d アーティスト</item>
</plurals>
<plurals name="x_genres">
<plurals name="item_genres">
<item quantity="other">%1$d ジャンル</item>
</plurals>
<plurals name="msg_header_delete_items">
Expand All @@ -336,16 +333,16 @@
<item quantity="other">%1$d / %2$d アイテムが正常に削除されました。</item>
</plurals>
<plurals name="item_songs">
<item quantity="other">曲</item>
<item quantity="other">%1$d 曲</item>
</plurals>
<plurals name="item_playlists">
<item quantity="other">プレイリスト</item>
<item quantity="other">%1$d プレイリスト</item>
</plurals>
<plurals name="item_files">
<item quantity="other">ファイル</item>
<item quantity="other">%1$d ファイル</item>
</plurals>
<plurals name="item_playlists_generated">
<item quantity="other">作成済みプレイリスト</item>
<item quantity="other">%1$d 作成済みプレイリスト</item>
</plurals>
<string name="warning_can_not_retract">この操作は元に戻せません!</string>
<string name="delete_with_lyrics">歌詞と一緒に削除</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
<string name="behaviour_force_saf">Forceer het gebruik van Opslag Access Framework</string>
<string name="behaviour_force_legacy">Forceer het gebruik van oude methodes</string>
<string name="reached_to_root">Je hebt de hoofdmap van dit opslagvolume bereikt</string>
<plurals name="x_songs">
<plurals name="item_songs">
<item quantity="one">%1$d nummer</item>
<item quantity="other">%1$d nummers</item>
</plurals>
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@
<string name="app_language">Język Aplikacji</string>
<string name="_default">Domyślne</string>
<plurals name="item_files">
<item quantity="one">plik</item>
<item quantity="few">Plików</item>
<item quantity="many">Plików</item>
<item quantity="other">pliki</item>
<item quantity="one">%1$d plik</item>
<item quantity="few">%1$d Plików</item>
<item quantity="many">%1$d Plików</item>
<item quantity="other">%1$d pliki</item>
</plurals>
<string name="warning_can_not_retract">Tej czynności nie można cofnąć</string>
<string name="delete_with_lyrics">Usuń z tekstem</string>
Expand Down
Loading

0 comments on commit 6780d72

Please sign in to comment.