Added enforced language capability for custom App

This commit is contained in:
renaud gaudin 2015-06-05 13:29:32 +02:00
parent 9f1174d209
commit ac79042caa
4 changed files with 15 additions and 1 deletions

View File

@ -49,7 +49,9 @@ DEFAULT_JSDATA = {
'email': "kelson@kiwix.org",
# help page content
'support_email': "kelson@kiwix.org"
'support_email': "kelson@kiwix.org",
'enforced_lang': None
}
SIZE_MATRIX = {

View File

@ -1113,6 +1113,15 @@ public class KiwixMobileActivity extends AppCompatActivity
Log.d(TAG_KIWIX,
"Kiwix Custom App starting for the first time. Check Companion ZIM.");
if (Constants.CUSTOM_APP_ENFORCED_LANG.length() > 0) {
// Custom App recommends to start off a specific language
LanguageUtils.handleLocaleChange(this, Constants.CUSTOM_APP_ENFORCED_LANG);
this.setResult(1236);
this.finish();
this.startActivity(new Intent(this, this.getClass()));
}
//Context context = this.getApplicationContext();
String fileName = FileUtils.getExpansionAPKFileName(true);
Log.d(TAG_KIWIX, "Looking for: " + fileName + " -- filesize: "

View File

@ -19,4 +19,6 @@ public class Constants {
public static final String CUSTOM_APP_EMAIL = "~support_email~";
public static final String CUSTOM_APP_SUPPORT_EMAIL = "~support_email~";
public static final String CUSTOM_APP_ENFORCED_LANG = "";
}

View File

@ -10,4 +10,5 @@ public class Constants {
public static final String CUSTOM_APP_WEBSITE = "~website~";
public static final String CUSTOM_APP_EMAIL = "~support_email~";
public static final String CUSTOM_APP_SUPPORT_EMAIL = "~support_email~";
public static final String CUSTOM_APP_ENFORCED_LANG = "~enforced_lang~";
}