Rework numbered strings to avoid translation problems. https://redmine.stoutner...
authorSoren Stoutner <soren@stoutner.com>
Tue, 15 Jan 2019 18:46:33 +0000 (11:46 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 15 Jan 2019 18:46:33 +0000 (11:46 -0700)
.idea/gradle.xml
app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
app/src/main/res/values-de/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values-tr/strings.xml
app/src/main/res/values/strings.xml
build.gradle
gradle/wrapper/gradle-wrapper.properties

index 0e23f8e..39e8a67 100644 (file)
@@ -3,6 +3,9 @@
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <compositeConfiguration>
+          <compositeBuild compositeDefinitionSource="SCRIPT" />
+        </compositeConfiguration>
         <option name="distributionType" value="LOCAL" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1" />
index 4d752d1..e6c993a 100644 (file)
@@ -272,7 +272,7 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
                     mode.finish();
                 } else if (numberOfSelectedBookmarks == 1) {  // One bookmark is selected.
                     // List the number of selected bookmarks in the subtitle.
-                    mode.setSubtitle(getString(R.string.one_selected));
+                    mode.setSubtitle(getString(R.string.selected) + "  1");
 
                     // Show the `Move Up`, `Move Down`, and  `Edit` options.
                     moveBookmarkUpMenuItem.setVisible(true);
@@ -282,24 +282,8 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
                     // Update the enabled status of the move icons.
                     updateMoveIcons();
                 } else {  // More than one bookmark is selected.
-                    // List the number of selected bookmarks according to the language.
-                    if (getString(R.string.android_asset_path).equals("ru")) {  // The Russian translation is used.
-                        // Convert the number of selected bookmarks to a string.
-                        String numberOfSelectedBookmarksString = String.valueOf(numberOfSelectedBookmarks);
-
-                        // Russian follows rule #7 at <https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals>.
-                        if (numberOfSelectedBookmarksString.endsWith("1") && !numberOfSelectedBookmarksString.equals("11")) {  //  Ends in 1.
-                            mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_ends_in_1));
-                        } else if ((numberOfSelectedBookmarksString.endsWith("2") || numberOfSelectedBookmarksString.endsWith("3") || numberOfSelectedBookmarksString.endsWith("4")) &&
-                                !numberOfSelectedBookmarksString.equals("12") && !numberOfSelectedBookmarksString.equals("13") && !numberOfSelectedBookmarksString.equals("14")) {  // Ends in 2-4.
-                            mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_ends_in_2));
-                        } else {  // Everything else.
-                            mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_everything_else));
-                        }
-                    } else {  // Another language is used.
-                        // List the number of selected bookmarks in the subtitle.
-                        mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected));
-                    }
+                    // List the number of selected bookmarks in the subtitle.
+                    mode.setSubtitle(getString(R.string.selected) + "  " + numberOfSelectedBookmarks);
 
                     // Hide non-applicable `MenuItems`.
                     moveBookmarkUpMenuItem.setVisible(false);
@@ -472,35 +456,9 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
                         // Update the `ListView`.
                         bookmarksCursorAdapter.changeCursor(bookmarksCursor);
 
-                        // Instantiate `snackbarMessage`.
-                        String snackbarMessage;
-
-                        // Determine how many items are in the array and prepare an appropriate snackbar message.
-                        if (selectedBookmarksIdsLongArray.length == 1) {
-                            snackbarMessage = getString(R.string.one_bookmark_deleted);
-                        } else {
-                            // Prepare a snackbar according to the language.
-                            if (getString(R.string.android_asset_path).equals("ru")) {  // The Russian translation is used.
-                                // Convert the number of selected bookmarks to a string.
-                                String numberOfBookmarksString = String.valueOf(selectedBookmarksIdsLongArray.length);
-
-                                // Russian follows rule #7 at <https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals>.
-                                if (numberOfBookmarksString.endsWith("1") && !numberOfBookmarksString.equals("11")) {  //  Ends in 1.
-                                    snackbarMessage = numberOfBookmarksString + " " + getString(R.string.bookmarks_deleted_russian_ends_in_1);
-                                } else if ((numberOfBookmarksString.endsWith("2") || numberOfBookmarksString.endsWith("3") || numberOfBookmarksString.endsWith("4")) &&
-                                        !numberOfBookmarksString.equals("12") && !numberOfBookmarksString.equals("13") && !numberOfBookmarksString.equals("14")) {  // Ends in 2-4.
-                                    snackbarMessage = numberOfBookmarksString + " " + getString(R.string.bookmarks_deleted_russian_ends_in_2);
-                                } else {  // Everything else.
-                                    snackbarMessage = numberOfBookmarksString + " " + getString(R.string.bookmarks_deleted_russian_everything_else);
-                                }
-                            } else {  // Another language is used.
-                                snackbarMessage = selectedBookmarksIdsLongArray.length + " " + getString(R.string.bookmarks_deleted);
-                            }
-                        }
-
-                        // Show a SnackBar.
-                        bookmarksDeletedSnackbar = Snackbar.make(findViewById(R.id.bookmarks_coordinatorlayout), snackbarMessage, Snackbar.LENGTH_LONG)
-                                .setAction(R.string.undo, view -> {
+                        // Show a Snackbar with the number of deleted bookmarks.
+                        bookmarksDeletedSnackbar = Snackbar.make(findViewById(R.id.bookmarks_coordinatorlayout), getString(R.string.bookmarks_deleted) + "  " + selectedBookmarksIdsLongArray.length,
+                                Snackbar.LENGTH_LONG).setAction(R.string.undo, view -> {
                                     // Do nothing because everything will be handled by `onDismissed()` below.
                                 })
                                 .addCallback(new Snackbar.Callback() {
index fa14fc3..174ef2f 100644 (file)
     <string name="save">Speichern</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 Ausgewählt</string>
-    <string name="selected">Ausgewählt</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">Ausgewählt:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Nach oben verschieben</string>
     <string name="move_down">Nach unten verschieben</string>
     <string name="edit">Bearbeiten</string>
     <string name="delete">Löschen</string>
     <string name="select_all">Alle auswählen</string>
-    <string name="one_bookmark_deleted">1 Lesezeichen gelöscht</string>
-    <string name="bookmarks_deleted">Lesezeichen gelöscht</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Lesezeichen gelöscht:</string>
     <string name="undo">Rückgängig</string>
 
     <!-- Bookmarks Database View. -->
index ea84777..6ab409a 100644 (file)
     <string name="save">Guardar</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 seleccionado</string>
-    <string name="selected">seleccionados</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">Seleccionados:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Subir</string>
     <string name="move_down">Bajar</string>
     <string name="edit">Editar</string>
     <string name="delete">Borrar</string>
     <string name="select_all">Selectionar todo</string>
-    <string name="one_bookmark_deleted">1 favorito borrado</string>
-    <string name="bookmarks_deleted">favoritos borrados</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Favoritos borrados:</string>
     <string name="undo">Deshacer</string>
 
     <!-- Bookmarks Database View. -->
     <string name="bookmarks_database_view">Vista de base de datos de favoritos</string>
     <string name="all_folders">Todas las carpetas</string>
     <string name="home_folder">Carpeta inicio</string>
+    <string name="sort">Ordenar</string>
+        <string name="sorted_by_database_id">Ordenados por ID de base de datos.</string>
+        <string name="sorted_by_display_order">Ordenados por orden de visualización.</string>
     <string name="database_id">ID de base de datos:</string>
     <string name="folder">Carpeta:</string>
     <string name="parent_folder">Carpeta superior:</string>
index 47313d2..79deaeb 100644 (file)
     <string name="save">Salva</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 Selezionato</string>
-    <string name="selected">Selezionato</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">Selezionato:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Sposta sopra</string>
     <string name="move_down">Sposta sotto</string>
     <string name="edit">Modifica</string>
     <string name="delete">Elimina</string>
     <string name="select_all">Seleziona tutto</string>
-    <string name="one_bookmark_deleted">1 Segnalibro eliminato</string>
-    <string name="bookmarks_deleted">Segnalibri eliminati</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Segnalibri eliminati:</string>
     <string name="undo">Annulla</string>
 
     <!-- Bookmarks Database View. -->
     <string name="bookmarks_database_view">Database dei Segnalibri</string>
     <string name="all_folders">Tutte le cartelle</string>
     <string name="home_folder">Cartella principale</string>
+    <string name="sort">Ordina</string>
+        <string name="sorted_by_database_id">Ordina per database ID.</string>
+        <string name="sorted_by_display_order">Ordina come visualizzato.</string>
     <string name="database_id">ID Database:</string>
     <string name="folder">Cartella:</string>
     <string name="parent_folder">Cartella superiore:</string>
index f7aa94d..ce45335 100644 (file)
     <string name="save">Сохранить</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 выбрана</string>
-    <string name="selected">выбраны</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">выбраны:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Вверх</string>
     <string name="move_down">Вниз</string>
     <string name="edit">Изменить</string>
     <string name="delete">Удалить</string>
     <string name="select_all">Выбрать все</string>
-    <string name="one_bookmark_deleted">1 закладка удалена</string>
-    <string name="bookmarks_deleted">закладок удалены</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Закладок удалены:</string>
     <string name="undo">Вернуть</string>
 
     <!-- Bookmarks Database View. -->
index 8075ce6..ff7d056 100644 (file)
     <string name="save">Kaydet</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 seçili</string>
-    <string name="selected">Seçili</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">Seçili:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Yukarı Taşı</string>
     <string name="move_down">Aşağı Taşı</string>
     <string name="edit">Düzenle</string>
     <string name="delete">Sil</string>
     <string name="select_all">Hepsini Seç</string>
-    <string name="one_bookmark_deleted">1 Yer İmi Silindi</string>
-    <string name="bookmarks_deleted">Yer İmleri Silindi</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Yer İmleri Silindi:</string>
     <string name="undo">Geri Al</string>
 
     <!-- Bookmarks Database View. -->
index cfe0caa..19e2bc8 100644 (file)
     <string name="save">Save</string>
 
     <!-- Bookmarks Contextual App Bar. -->
-    <string name="one_selected">1 Selected</string>
-    <string name="selected">Selected</string>  <!--This is a plural adjective.-->
-    <string name="selected_russian_ends_in_1">выбрана</string>
-    <string name="selected_russian_ends_in_2">выбраны</string>
-    <string name="selected_russian_everything_else">выбрано</string>
+    <string name="selected">Selected:</string>  <!--This is a plural adjective.-->
     <string name="move_up">Move Up</string>
     <string name="move_down">Move Down</string>
     <string name="edit">Edit</string>
     <string name="delete">Delete</string>
     <string name="select_all">Select All</string>
-    <string name="one_bookmark_deleted">1 Bookmark Deleted</string>
-    <string name="bookmarks_deleted">Bookmarks Deleted</string>
-    <string name="bookmarks_deleted_russian_ends_in_1">закладка удалена</string>
-    <string name="bookmarks_deleted_russian_ends_in_2">закладки удалены</string>
-    <string name="bookmarks_deleted_russian_everything_else">акладок удалено</string>
+    <string name="bookmarks_deleted">Bookmarks Deleted:</string>
     <string name="undo">Undo</string>
 
     <!-- Bookmarks Database View. -->
         <string name="ultraprivacy">UltraPrivacy</string>
         <string name="ultraprivacy_summary">UltraPrivacy blocks trackers that EasyPrivacy doesn’t because doing so can break websites.</string>
         <string name="block_all_third_party_requests">Block all third-party requests</string>
-        <string name="block_all_third_party_requests_summary">Blocking all third-party requests increases privacy, but it breaks many websites.</string>
+        <string name="block_all_third_party_requests_summary" translatable="false">Blocking all third-party requests increases privacy, but it breaks many websites.</string>
     <string name="tor">Tor</string>
         <string name="proxy_through_orbot">Proxy through Orbot</string>
         <string name="proxy_through_orbot_summary">Proxy all web traffic through Orbot on localhost:8118.</string>
index 1ba5b9d..8e8aefb 100644 (file)
@@ -25,7 +25,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.2.1'
+        classpath 'com.android.tools.build:gradle:3.3.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
index bc26198..fd0f4af 100644 (file)
@@ -1,6 +1,6 @@
-#Tue Sep 25 14:33:14 MST 2018
+#Tue Jan 15 11:00:04 MST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip