- // List the number of selected bookmarks in the subtitle.
- mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.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));
+ }