Skip to content

Commit 237b388

Browse files
committed
yet another attempt at fixing the phantom zulu locale bug!
1 parent a9efc3c commit 237b388

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

app/src/main/java/org/torproject/android/OrbotApp.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void onCreate() {
4242
//check for updates via github, since it is unlikely to be blocked; notify the user of places where upgrades can be found
4343
new AppUpdater(this)
4444
.setUpdateFrom(UpdateFrom.JSON)
45-
.setUpdateJSON("https://raw.githubusercontent.com/n8fr8/orbot/master/update.json")
45+
.setUpdateJSON("https://raw.githubusercontent.com/guardianproject/orbot/master/update.json")
4646
.setDisplay(Display.NOTIFICATION).start();
4747
}
4848

@@ -59,17 +59,7 @@ public void onConfigurationChanged(Configuration newConfig) {
5959
if (!Prefs.getDefaultLocale().equals(Locale.getDefault().getLanguage()))
6060
Languages.setLanguage(this, Prefs.getDefaultLocale(), true);
6161
}
62-
/**
63-
public static void forceChangeLanguage(Activity activity) {
64-
Intent intent = activity.getIntent();
65-
if (intent == null) // when launched as LAUNCHER
66-
intent = new Intent(activity, OrbotMainActivity.class);
67-
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
68-
activity.finish();
69-
activity.overridePendingTransition(0, 0);
70-
activity.startActivity(intent);
71-
activity.overridePendingTransition(0, 0);
72-
}**/
62+
7363

7464
public static Languages getLanguages(Activity activity) {
7565
return Languages.get(activity);

app/src/main/java/org/torproject/android/settings/Languages.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class Languages {
2222
public static final String TAG = "Languages";
2323

24-
public static final Locale defaultLocale;
24+
public static Locale defaultLocale;
2525
public static final Locale TIBETAN = new Locale("bo");
2626
static final Locale localesToTest[] = {
2727
Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN,
@@ -61,11 +61,10 @@ TIBETAN, new Locale("af"), new Locale("am"),
6161
private static Map<String, String> tmpMap = new TreeMap<String, String>();
6262
private static Map<String, String> nameMap;
6363

64-
static {
65-
defaultLocale = Locale.getDefault();
66-
}
6764

6865
private Languages(Activity activity) {
66+
67+
6968
AssetManager assets = activity.getAssets();
7069
Configuration config = activity.getResources().getConfiguration();
7170
// Resources() requires DisplayMetrics, but they are only needed for drawables
@@ -119,6 +118,8 @@ private Languages(Activity activity) {
119118
* @return
120119
*/
121120
public static void setup(Class<?> clazz, int resId) {
121+
defaultLocale = Locale.getDefault();
122+
122123
if (Languages.clazz == null) {
123124
Languages.clazz = clazz;
124125
Languages.resId = resId;

0 commit comments

Comments
 (0)