mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
send language code (since name is getting localized)
Allows server to check for wordlist upgrades correctly.
This commit is contained in:
parent
2b7ffb3030
commit
563db2f089
2 changed files with 13 additions and 0 deletions
|
@ -290,6 +290,16 @@ public class DictLangCache {
|
|||
return getInfo( context, dal ).langCode;
|
||||
}
|
||||
|
||||
private static String[] s_langCodeStrs;
|
||||
static String getLangCodeStr( Context context, int code )
|
||||
{
|
||||
if ( null == s_langCodeStrs ) {
|
||||
s_langCodeStrs = context.getResources()
|
||||
.getStringArray( R.array.language_codes );
|
||||
}
|
||||
return s_langCodeStrs[code];
|
||||
}
|
||||
|
||||
public static String getDictMD5Sum( Context context, String dict )
|
||||
{
|
||||
String result = null;
|
||||
|
|
|
@ -63,6 +63,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
|
|||
private static final String k_APP = "app";
|
||||
private static final String k_DICTS = "dicts";
|
||||
private static final String k_LANG = "lang";
|
||||
private static final String k_LANGCODE = "lc";
|
||||
private static final String k_MD5SUM = "md5sum";
|
||||
private static final String k_INDEX = "index";
|
||||
private static final String k_LEN = "len";
|
||||
|
@ -229,12 +230,14 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
|
|||
{
|
||||
JSONObject params = new JSONObject();
|
||||
int lang = DictLangCache.getDictLangCode( context, dal );
|
||||
String langCode = DictLangCache.getLangCodeStr( context, lang );
|
||||
String langStr = DictLangCache.getLangName( context, lang );
|
||||
String sum = DictLangCache.getDictMD5Sum( context, dal.name );
|
||||
long len = DictLangCache.getFileLen( context, dal );
|
||||
try {
|
||||
params.put( k_NAME, dal.name );
|
||||
params.put( k_LANG, langStr );
|
||||
params.put( k_LANGCODE, langCode );
|
||||
params.put( k_MD5SUM, sum );
|
||||
params.put( k_INDEX, index );
|
||||
params.put( k_LEN, len );
|
||||
|
|
Loading…
Add table
Reference in a new issue