| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -364,15 +364,8 @@ public boolean importData(TransferHandler.TransferSupport support) { | |||
| 364 | 364 | return false; | |
| 365 | 365 | } | |
| 366 | 366 | ||
| 367 | - if (successful == 0) { | ||
| 368 | - statusError(Language.text("editor.status.drag_and_drop.no_files_added")); | ||
| 367 | + statusNotice(Language.pluralize("editor.status.drag_and_drop.files_added", successful)); | ||
| 369 | 368 | ||
| 370 | - } else if (successful == 1) { | ||
| 371 | - statusNotice(Language.text("editor.status.drag_and_drop.one_file_added")); | ||
| 372 | - | ||
| 373 | - } else { | ||
| 374 | - statusNotice(String.format(Language.text("editor.status.drag_and_drop.n_files_added"), successful)); | ||
| 375 | - } | ||
| 376 | 369 | return true; | |
| 377 | 370 | } | |
| 378 | 371 | } | |
@@ -2111,7 +2104,7 @@ protected void handleFindReference() { | |||
| 2111 | 2104 | if (text.length() == 0) { | |
| 2112 | 2105 | statusNotice(Language.text("editor.status.find_reference.select_word_first")); | |
| 2113 | 2106 | } else { | |
| 2114 | - statusNotice(String.format(Language.text("editor.status.find_reference.not_available"), text)); | ||
| 2107 | + statusNotice(Language.interpolate("editor.status.find_reference.not_available", text)); | ||
| 2115 | 2108 | } | |
| 2116 | 2109 | } | |
| 2117 | 2110 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,6 +161,20 @@ static public String text(String text) { | |||
| 161 | 161 | return init().bundle.getString(text); | |
| 162 | 162 | } | |
| 163 | 163 | ||
| 164 | + static public String interpolate(String text, Object... arguments) { | ||
| 165 | + return String.format(init().bundle.getString(text), arguments); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + static public String pluralize(String text, int count) { | ||
| 169 | + ResourceBundle bundle = init().bundle; | ||
| 170 | + | ||
| 171 | + String fmt = text + ".%s"; | ||
| 172 | + | ||
| 173 | + if (bundle.containsKey(String.format(fmt, count))) { | ||
| 174 | + return interpolate(String.format(fmt, count), count); | ||
| 175 | + } | ||
| 176 | + return interpolate(String.format(fmt, "n"), count); | ||
| 177 | + } | ||
| 164 | 178 | ||
| 165 | 179 | /** Get all available languages */ | |
| 166 | 180 | static public Map<String, String> getLanguages() { | |
@@ -221,4 +235,4 @@ public ResourceBundle newBundle(String baseName, Locale locale, String format, C | |||
| 221 | 235 | return bundle; | |
| 222 | 236 | } | |
| 223 | 237 | } | |
| 224 | - } | ||
| 238 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -675,7 +675,7 @@ else if (version.toLowerCase().startsWith("v")) // For ketai library | |||
| 675 | 675 | ||
| 676 | 676 | private void installContribution(AvailableContribution info) { | |
| 677 | 677 | if (info.link == null) { | |
| 678 | - listPanel.contribManager.status.setErrorMessage(String.format(Language.text("contributions.unsupported_operating_system"), info.getType())); | ||
| 678 | + listPanel.contribManager.status.setErrorMessage(Language.interpolate("contributions.unsupported_operating_system", info.getType())); | ||
| 679 | 679 | } else { | |
| 680 | 680 | installContribution(info, info.link); | |
| 681 | 681 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -222,9 +222,9 @@ editor.status.autoformat.no_changes = No changes necessary for Auto Format. | |||
| 222 | 222 | editor.status.autoformat.finished = Auto Format finished. | |
| 223 | 223 | editor.status.find_reference.select_word_first = First select a word to find in the reference. | |
| 224 | 224 | editor.status.find_reference.not_available = No reference available for "%s". | |
| 225 | - editor.status.drag_and_drop.no_files_added = No files were added to the sketch. | ||
| 226 | - editor.status.drag_and_drop.one_file_added = One file added to the sketch. | ||
| 227 | - editor.status.drag_and_drop.n_files_added = %d files added to the sketch. | ||
| 225 | + editor.status.drag_and_drop.files_added.0 = No files were added to the sketch. | ||
| 226 | + editor.status.drag_and_drop.files_added.1 = One file added to the sketch. | ||
| 227 | + editor.status.drag_and_drop.files_added.n = %d files added to the sketch. | ||
| 228 | 228 | editor.status.saving = Saving... | |
| 229 | 229 | editor.status.saving.done = Done saving. | |
| 230 | 230 | editor.status.saving.canceled = Save canceled. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,9 +217,9 @@ editor.status.autoformat.no_changes = Δεν χρειάζονται αλλαγέ | |||
| 217 | 217 | editor.status.autoformat.finished = Ολοκληρώθηκε η Αυτόματη μορφοποίηση. | |
| 218 | 218 | editor.status.find_reference.select_word_first = Επιλέξτε πρώτα μια λέξη προς αναζήτηση στην Processing Reference. | |
| 219 | 219 | editor.status.find_reference.not_available = Δεν υπάρχει καταχώρηση για το "%s" στην Processing Reference. | |
| 220 | - editor.status.drag_and_drop.no_files_added = Δεν προστέθηκαν αρχεία στο Σχέδιο. | ||
| 221 | - editor.status.drag_and_drop.one_file_added = Ένα αρχείο προστέθηκε στο Σχέδιο. | ||
| 222 | - editor.status.drag_and_drop.n_files_added = %d files αρχεία προστέθηκαν στο Σχέδιο. | ||
| 220 | + editor.status.drag_and_drop.files_added.0 = Δεν προστέθηκαν αρχεία στο Σχέδιο. | ||
| 221 | + editor.status.drag_and_drop.files_added.1 = Ένα αρχείο προστέθηκε στο Σχέδιο. | ||
| 222 | + editor.status.drag_and_drop.files_added.n = %d files αρχεία προστέθηκαν στο Σχέδιο. | ||
| 223 | 223 | editor.status.saving = Αποθήκευση... | |
| 224 | 224 | editor.status.saving.done = Ολοκλήρωση αποθήκευσης. | |
| 225 | 225 | editor.status.saving.canceled = Ακύρωση αποθήκευσης. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,9 +217,9 @@ editor.status.autoformat.no_changes = Não foram necessárias alterações para | |||
| 217 | 217 | editor.status.autoformat.finished = Auto Formatação completa. | |
| 218 | 218 | editor.status.find_reference.select_word_first = Primeiro escolha uma palavra para procurar na referência. | |
| 219 | 219 | editor.status.find_reference.not_available = Não existe refrência disponivel para "%s". | |
| 220 | - editor.status.drag_and_drop.no_files_added = Nenhuns ficheiros foram adicionados ao sketch. | ||
| 221 | - editor.status.drag_and_drop.one_file_added = Um ficheiro adicionado ao sketch. | ||
| 222 | - editor.status.drag_and_drop.n_files_added = %d ficheiros adicionados ao sketch. | ||
| 220 | + editor.status.drag_and_drop.files_added.0 = Nenhuns ficheiros foram adicionados ao sketch. | ||
| 221 | + editor.status.drag_and_drop.files_added.1 = Um ficheiro adicionado ao sketch. | ||
| 222 | + editor.status.drag_and_drop.files_added.n = %d ficheiros adicionados ao sketch. | ||
| 223 | 223 | editor.status.saving = A Guardar... | |
| 224 | 224 | editor.status.saving.done = Guardado com sucesso. | |
| 225 | 225 | editor.status.saving.canceled = Guardar cancelado. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments