name lang 0 "unknown", and display dicts with langs outside the known range there.

This commit is contained in:
Eric House 2014-06-24 21:33:44 -07:00
parent d062508929
commit f2eea61a76
6 changed files with 11 additions and 2 deletions

View file

@ -1420,6 +1420,7 @@ public final class R {
*/
public static final int lang_label=0x7f0600c6;
public static final int lang_name_fmt=0x7f0602c1;
public static final int lang_unknown=0x7f0602c2;
public static final int langdict_label=0x7f0600c7;
public static final int list_group_default=0x7f06026c;
public static final int list_group_delete=0x7f06026a;

View file

@ -214,7 +214,7 @@
</string-array>
<string-array name="language_names">
<item></item> <!-- Unknown -->
<item>@string/lang_unknown</item> <!-- Unknown -->
<item>English</item> <!-- 1 -->
<item>French</item> <!-- 2 -->
<item>German</item> <!-- 3 -->

View file

@ -2268,4 +2268,6 @@
<string name="note_none">(None)</string>
<string name="dict_on_server">Downloadable</string>
<string name="lang_name_fmt">%1$s (%2$d wordlists)</string>
<string name="lang_unknown">Unknown</string>
</resources>

View file

@ -1941,4 +1941,5 @@
<string name="note_none">)Enon(</string>
<string name="dict_on_server">Elbadaolnwod</string>
<string name="lang_name_fmt">%1$s (%2$d )stsildrow</string>
<string name="lang_unknown">Nwonknu</string>
</resources>

View file

@ -1941,4 +1941,5 @@
<string name="note_none">(NONE)</string>
<string name="dict_on_server">DOWNLOADABLE</string>
<string name="lang_name_fmt">%1$s (%2$d WORDLISTS)</string>
<string name="lang_unknown">UNKNOWN</string>
</resources>

View file

@ -184,7 +184,11 @@ public class DictLangCache {
DictAndLoc[] dals = DictUtils.dictList( context );
for ( DictAndLoc dal : dals ) {
DictInfo info = getInfo( context, dal );
if ( null != info && code == info.langCode ) {
int langCode = info.langCode;
if ( langCode >= s_langNames.length ) {
langCode = 0;
}
if ( null != info && code == langCode ) {
al.add( dal );
}
}