[Android] res: pluralize search_found_results string

Sébastien Toque git at videolan.org
Wed Jul 25 23:01:06 CEST 2012


android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Jul 25 22:56:41 2012 +0200| [55e30cbd29b0ef9bfc0d5f0093632fbdeda6cd39] | committer: Sébastien Toque

res: pluralize search_found_results string

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=55e30cbd29b0ef9bfc0d5f0093632fbdeda6cd39
---

 vlc-android/res/values-fr/strings.xml                    |    5 ++++-
 vlc-android/res/values/strings.xml                       |    5 ++++-
 vlc-android/src/org/videolan/vlc/gui/SearchActivity.java |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/vlc-android/res/values-fr/strings.xml b/vlc-android/res/values-fr/strings.xml
index 9a2d1ce..12b5fd2 100644
--- a/vlc-android/res/values-fr/strings.xml
+++ b/vlc-android/res/values-fr/strings.xml
@@ -11,7 +11,10 @@
     <string name="sortby_length">Durée</string>
     <string name="searchable_hint">Recherche…</string>
     <string name="search_history">Historique</string>
-    <string name="search_found_results">%1$d résultats trouvés</string>
+    <plurals name="search_found_results_quantity">
+        <item quantity="one">%d résultat trouvé</item>
+        <item quantity="other">%d résultats trouvés</item>
+    </plurals>
     <string name="show_player">Afficher Lecteur</string>
     <string name="hide_mini_player">Cacher Mini-lecteur</string>
     <string name="play">Lire</string>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index e0818d1..6c19cb8 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -11,7 +11,10 @@
     <string name="sortby_length">Length</string>
     <string name="searchable_hint">Search…</string>
     <string name="search_history">History</string>
-    <string name="search_found_results">%1$d results found</string>
+    <plurals name="search_found_results_quantity">
+        <item quantity="one">%d result found</item>
+        <item quantity="other">%d results found</item>
+    </plurals>
     <string name="show_player">Show player</string>
     <string name="hide_mini_player">Hide mini-player</string>
     <string name="play">Play</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java b/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
index 45d286a..d596d1e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchActivity.java
@@ -135,7 +135,7 @@ public class SearchActivity extends ListActivity {
         }
         mResultAdapter.sort();
 
-        String headerText = getString(R.string.search_found_results, results);
+        String headerText = getResources().getQuantityString(R.plurals.search_found_results_quantity, results, results);
         showListHeader(headerText);
 
         setListAdapter(mResultAdapter);



More information about the Android mailing list