show separate available and installed wordlist counts

This commit is contained in:
Eric House 2021-12-01 10:56:03 -08:00
parent ff767f6711
commit 3d89e18d8b
12 changed files with 35 additions and 55 deletions

View file

@ -63,6 +63,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -134,12 +135,21 @@ public class DictsDelegate extends ListDelegateBase
} }
} }
private static class LangInfo { private static class LangInfo {
int m_numDicts; int m_numDictsInst;
int m_numDictsAvail;
int m_posn; int m_posn;
public LangInfo( int posn, int numDicts ) public LangInfo( int posn, Collection<Object> objs )
{ {
m_posn = posn; m_posn = posn;
m_numDicts = numDicts; for ( Object obj : objs ) {
if ( obj instanceof DictInfo ) {
++m_numDictsAvail;
} else if ( obj instanceof DictAndLoc ) {
++m_numDictsInst;
} else {
Assert.failDbg();
}
}
} }
} }
private HashMap<String, DictInfo[]> m_remoteInfo; private HashMap<String, DictInfo[]> m_remoteInfo;
@ -173,7 +183,7 @@ public class DictsDelegate extends ListDelegateBase
ArrayList<Object> items = makeLangItems( langName ); ArrayList<Object> items = makeLangItems( langName );
Assert.assertTrueNR( 0 < items.size() ); Assert.assertTrueNR( 0 < items.size() );
alist.add( new LangInfo( ii, items.size() ) ); alist.add( new LangInfo( ii, items ) );
if ( ! m_closedLangs.contains( langName ) ) { if ( ! m_closedLangs.contains( langName ) ) {
alist.addAll( items ); alist.addAll( items );
} }
@ -194,12 +204,21 @@ public class DictsDelegate extends ListDelegateBase
langName ); langName );
boolean expanded = ! m_closedLangs.contains( langName ); boolean expanded = ! m_closedLangs.contains( langName );
String locLangName = xlateLang( langName ); String locLangName = xlateLang( langName );
String name = getQuantityString( R.plurals.lang_name_fmt, String details = null;
info.m_numDicts, if ( 0 < info.m_numDictsInst && 0 < info.m_numDictsAvail ) {
locLangName, info.m_numDicts ); details = getString( R.string.dict_lang_inst_and_avail,
name = Utils.capitalize( name ); info.m_numDictsInst, info.m_numDictsAvail );
} else if ( 0 < info.m_numDictsAvail ) {
details = getString( R.string.dict_lang_avail,
info.m_numDictsAvail );
} else if ( 0 < info.m_numDictsInst ) {
details = getString( R.string.dict_lang_inst, info.m_numDictsInst );
} else {
Assert.failDbg();
}
String title = Utils.capitalize( locLangName ) + " " + details;
result = ListGroup.make( m_context, convertView, result = ListGroup.make( m_context, convertView,
DictsDelegate.this, groupPos, name, DictsDelegate.this, groupPos, title,
expanded ); expanded );
} else { } else {
XWListItem item; XWListItem item;

View file

@ -2188,10 +2188,13 @@
<string name="dict_info_note_fmt">Note: %1$s</string> <string name="dict_info_note_fmt">Note: %1$s</string>
<string name="note_none">(None)</string> <string name="note_none">(None)</string>
<string name="dict_on_server">Tap for details</string> <string name="dict_on_server">Tap for details</string>
<plurals name="lang_name_fmt"> <!-- One of these three is shown in Wordlists list beside name of
<item quantity="one">%1$s (one wordlist)</item> each language, depending on whether wordlists in that
<item quantity="other">%1$s (%2$d wordlists)</item> language are only Installed, only available for installation,
</plurals> or both. e.g. "English (Installed: 4; Available:2)"-->
<string name="dict_lang_avail">(Available: %1$d)</string>
<string name="dict_lang_inst">(Installed: %1$d)</string>
<string name="dict_lang_inst_and_avail">(Installed: %1$d; Available: %2$d)</string>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d words)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d words)</string>
<string name="lang_unknown">Unknown</string> <string name="lang_unknown">Unknown</string>
<string name="not_again_dicts">This screen lets you install new <string name="not_again_dicts">This screen lets you install new

View file

@ -563,10 +563,6 @@ Introduïu el vostre nom aquí. S\'usarà en crear partides noves. (Podreu
<string name="pref_item_update_summary">Obtén construccions intermèdies</string> <string name="pref_item_update_summary">Obtén construccions intermèdies</string>
<string name="checking_title">S\'està comprovant</string> <string name="checking_title">S\'està comprovant</string>
<string name="checking_for_fmt">S\'estan comprovant els diccionaris a %1$s…</string> <string name="checking_for_fmt">S\'estan comprovant els diccionaris a %1$s…</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (%2$d diccionari)</item>
<item quantity="other">%1$s (%2$d diccionaris)</item>
</plurals>
<plurals name="nag_hours_fmt"> <plurals name="nag_hours_fmt">
<item quantity="one">%1$d hora</item> <item quantity="one">%1$d hora</item>
<item quantity="other">%1$d hores</item> <item quantity="other">%1$d hores</item>

View file

@ -605,10 +605,6 @@
<string name="delete_dicts">Wortliste(n) löschen</string> <string name="delete_dicts">Wortliste(n) löschen</string>
<string name="show_remote">Herunterladbare anzeigen</string> <string name="show_remote">Herunterladbare anzeigen</string>
<string name="dict_on_server">Für Details antippen</string> <string name="dict_on_server">Für Details antippen</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (%2$d Wortliste)</item>
<item quantity="other">%1$s (%2$d Wortlisten)</item>
</plurals>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d Wörter)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d Wörter)</string>
<string name="lang_unknown">Unbekannt</string> <string name="lang_unknown">Unbekannt</string>
<string name="not_again_dicts">Auf dieser Bildschirmseite können Sie neue Wortlisten installieren und die bereits installierten anzeigen. <string name="not_again_dicts">Auf dieser Bildschirmseite können Sie neue Wortlisten installieren und die bereits installierten anzeigen.

View file

@ -2454,12 +2454,6 @@ versions de %1$s maintenant ?</string>
<string name="note_none">(aucune)</string> <string name="note_none">(aucune)</string>
<!--<string name="dict_on_server">Tap to download</string>--> <!--<string name="dict_on_server">Tap to download</string>-->
<string name="dict_on_server">Appuyer pour les détails</string> <string name="dict_on_server">Appuyer pour les détails</string>
<!--<string name="lang_name_fmt">%1$s (%2$d wordlists)</string> -->
<!--<string name="lang_name_fmt">%1$s (%2$d listes de mots)</string> -->
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (une liste de mots)</item>
<item quantity="other">%1$s (%2$d listes de mots)</item>
</plurals>
<!--<string name="dict_desc_fmt">%1$s (%2$s/%3$d words)</string>--> <!--<string name="dict_desc_fmt">%1$s (%2$s/%3$d words)</string>-->
<string name="dict_desc_fmt">%1$s (%2$s/%3$d mots)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d mots)</string>
<!--<string name="lang_unknown">Unknown</string>--> <!--<string name="lang_unknown">Unknown</string>-->

View file

@ -235,10 +235,6 @@
<string name="button_edit">Modifica</string> <string name="button_edit">Modifica</string>
<string name="config_no_connvia">Questa partita non ha modo di collegarsi e non può essere salvata. Vuoi abbandonare le modifiche o modificarla per avere delle opzioni di connessione\?</string> <string name="config_no_connvia">Questa partita non ha modo di collegarsi e non può essere salvata. Vuoi abbandonare le modifiche o modificarla per avere delle opzioni di connessione\?</string>
<string name="warn_no_comms">Ogni partita in linea deve avere almeno un modo per collegarsi. Se non hai un opzione di base impostata,ogni nuova partita dovrà essere configurata manualmente.</string> <string name="warn_no_comms">Ogni partita in linea deve avere almeno un modo per collegarsi. Se non hai un opzione di base impostata,ogni nuova partita dovrà essere configurata manualmente.</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (una lista parole)</item>
<item quantity="other">%1$s (%2$d liste parole)</item>
</plurals>
<string name="dict_on_server">Tocca per dettagli</string> <string name="dict_on_server">Tocca per dettagli</string>
<string name="note_none">(Nessuna)</string> <string name="note_none">(Nessuna)</string>
<string name="dict_info_note_fmt">Note: %1$s</string> <string name="dict_info_note_fmt">Note: %1$s</string>

View file

@ -571,9 +571,6 @@
<string name="dict_info_note_fmt">注: %1$s</string> <string name="dict_info_note_fmt">注: %1$s</string>
<string name="note_none">(なし)</string> <string name="note_none">(なし)</string>
<string name="dict_on_server">詳細はタップしてください</string> <string name="dict_on_server">詳細はタップしてください</string>
<plurals name="lang_name_fmt">
<item quantity="other">%1$s (%2$d 単語リスト)</item>
</plurals>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d 語)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d 語)</string>
<string name="lang_unknown">不明</string> <string name="lang_unknown">不明</string>
<string name="not_again_dicts">この画面では、新しい単語リストをインストールしたり、既に持っているものを表示できます。 <string name="not_again_dicts">この画面では、新しい単語リストをインストールしたり、既に持っているものを表示できます。

View file

@ -354,10 +354,6 @@
<string name="show_remote">Vis nedlastbare</string> <string name="show_remote">Vis nedlastbare</string>
<string name="progress_title">Laster ned</string> <string name="progress_title">Laster ned</string>
<string name="dict_on_server">Trykk for detaljer</string> <string name="dict_on_server">Trykk for detaljer</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (%2$d ordliste)</item>
<item quantity="other">%1$s (%2$d ordlister)</item>
</plurals>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d ord)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d ord)</string>
<string name="lang_unknown">Ukjent</string> <string name="lang_unknown">Ukjent</string>
<string name="force_tablet_title">Bruk brett- (side-ved-side) -oppsett?</string> <string name="force_tablet_title">Bruk brett- (side-ved-side) -oppsett?</string>

View file

@ -559,10 +559,6 @@
<string name="dict_info_note_fmt">Notitie: %1$s</string> <string name="dict_info_note_fmt">Notitie: %1$s</string>
<string name="note_none">(Geen)</string> <string name="note_none">(Geen)</string>
<string name="dict_on_server">Druk om te downloaden</string> <string name="dict_on_server">Druk om te downloaden</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (%2$d woordenlijst)</item>
<item quantity="other">%1$s (%2$d woordenlijsten)</item>
</plurals>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d woorden)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d woorden)</string>
<string name="lang_unknown">Onbekend</string> <string name="lang_unknown">Onbekend</string>
<string name="not_again_dicts">Op dit scherm kun je nieuwe woordenlijsten installeren of woordenlijsten die je al hebt bekijken.\n\nWelke woordenlijsten je geïnstalleerd hebt bepaalt:\n• Welke talen je in kan spelen\n• Hoe slim de robotspeler is\n• Welke woorden je mag gebruiken.\n\nSchakel de \"Toon downloadbaar\" optie bovenaan in om te zien welke woordenlijsten beschikbaar zijn.</string> <string name="not_again_dicts">Op dit scherm kun je nieuwe woordenlijsten installeren of woordenlijsten die je al hebt bekijken.\n\nWelke woordenlijsten je geïnstalleerd hebt bepaalt:\n• Welke talen je in kan spelen\n• Hoe slim de robotspeler is\n• Welke woorden je mag gebruiken.\n\nSchakel de \"Toon downloadbaar\" optie bovenaan in om te zien welke woordenlijsten beschikbaar zijn.</string>

View file

@ -637,11 +637,6 @@
<string name="dict_info_note_fmt">Uwaga: %1$s</string> <string name="dict_info_note_fmt">Uwaga: %1$s</string>
<string name="note_none">(Brak)</string> <string name="note_none">(Brak)</string>
<string name="dict_on_server">Dotknij, aby poznać szczegóły</string> <string name="dict_on_server">Dotknij, aby poznać szczegóły</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (%2$d lista słów)</item>
<item quantity="few">%1$s (%2$d listy słów)</item>
<item quantity="many">%1$s (%2$d list słów)</item>
</plurals>
<string name="dict_desc_fmt">%1$s (%2$s/%3$d słów)</string> <string name="dict_desc_fmt">%1$s (%2$s/%3$d słów)</string>
<string name="lang_unknown">Nieznane</string> <string name="lang_unknown">Nieznane</string>
<string name="not_again_dicts">Ten ekran pozwala zainstalować nowe listy słów i wyświetlić już zainstalowane. <string name="not_again_dicts">Ten ekran pozwala zainstalować nowe listy słów i wyświetlić już zainstalowane.

View file

@ -538,10 +538,6 @@
\n \n
\nCheque a caixa “Mostrar baixáveis” no topo para ver quais estão disponíveis.</string> \nCheque a caixa “Mostrar baixáveis” no topo para ver quais estão disponíveis.</string>
<string name="lang_unknown">Desconhecido</string> <string name="lang_unknown">Desconhecido</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (uma lista de palavras)</item>
<item quantity="other">%1$s (%2$d listas de palavras)</item>
</plurals>
<string name="dict_on_server">Toque para detalhes</string> <string name="dict_on_server">Toque para detalhes</string>
<string name="note_none">(Nenhum)</string> <string name="note_none">(Nenhum)</string>
<string name="dict_info_fmt">Número de palavras: %1$d <string name="dict_info_fmt">Número de palavras: %1$d

View file

@ -1950,10 +1950,6 @@
\nCheque a caixa “Mostrar baixáveis” no topo para ver quais estão disponíveis.</string> \nCheque a caixa “Mostrar baixáveis” no topo para ver quais estão disponíveis.</string>
<string name="lang_unknown">Desconhecido</string> <string name="lang_unknown">Desconhecido</string>
<string name="dict_desc_fmt">%1$s (%2$s de %3$d palavras)</string> <string name="dict_desc_fmt">%1$s (%2$s de %3$d palavras)</string>
<plurals name="lang_name_fmt">
<item quantity="one">%1$s (uma lista de palavras)</item>
<item quantity="other">%1$s (%2$d listas de palavras)</item>
</plurals>
<string name="dict_on_server">Toque para detalhes</string> <string name="dict_on_server">Toque para detalhes</string>
<string name="note_none">(Nenhum)</string> <string name="note_none">(Nenhum)</string>
<string name="dict_info_note_fmt">Nota: %1$s</string> <string name="dict_info_note_fmt">Nota: %1$s</string>