mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Fixed a bug with the language changer.
This commit is contained in:
parent
9958ad4dc9
commit
cef231059d
@ -29,6 +29,7 @@ USAGE = '''Usage: %s [--option]
|
||||
--kiwix Compile libkiwix
|
||||
--strip Strip libkiwix.so
|
||||
--apk Create an APK file
|
||||
--locales Create the locales.txt file
|
||||
|
||||
Note that the '--' prefix is optionnal.
|
||||
|
||||
@ -518,8 +519,7 @@ for arch in ARCHS:
|
||||
change_env(ORIGINAL_ENVIRON)
|
||||
|
||||
if COMPILE_APK:
|
||||
# create locales.txt
|
||||
# create_locales.write_locales(create_locales.get_all_language_codes())
|
||||
|
||||
syscall('rm -f bin/*.apk', shell=True)
|
||||
syscall('ant debug')
|
||||
syscall('ls -lh bin/*.apk', shell=True)
|
||||
@ -540,7 +540,7 @@ if LOCALES_TXT:
|
||||
with open(os.path.join(curdir, 'assets', 'locales.txt'), 'w') as f:
|
||||
f.write(',\n'.join(files))
|
||||
|
||||
|
||||
print 'Created locales.txt file.'
|
||||
|
||||
# check that the step went well
|
||||
if COMPILE_APK:
|
||||
|
@ -1,9 +1,11 @@
|
||||
package org.kiwix.kiwixmobile;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.InflateException;
|
||||
@ -83,6 +85,14 @@ public class LanguageUtils {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't change the language, if the options hasn't been set
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||
String language = prefs.getString("pref_language_chooser", "");
|
||||
|
||||
if (language.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user