aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-04-02 21:55:02 -0700
committerScott Jackson <daneren2005@gmail.com>2014-04-02 21:55:02 -0700
commit42b0c5efd3f03431acfbc1cca348bb1b7b0d2194 (patch)
tree0bcd37b9ce3604759aa255b5d8395cc7d22ca52d /src/github/daneren2005
parentd28822f34ce40785d24bcd1450f10aa99c851e28 (diff)
downloaddsub-42b0c5efd3f03431acfbc1cca348bb1b7b0d2194.tar.gz
dsub-42b0c5efd3f03431acfbc1cca348bb1b7b0d2194.tar.bz2
dsub-42b0c5efd3f03431acfbc1cca348bb1b7b0d2194.zip
#326 Add override to always use english
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java21
-rw-r--r--src/github/daneren2005/dsub/util/Constants.java1
2 files changed, 16 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 62349480..fe477df8 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
+import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.media.AudioManager;
import android.os.Build;
@@ -50,6 +51,13 @@ import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Spinner;
+import java.io.File;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.fragments.SubsonicFragment;
import github.daneren2005.dsub.service.DownloadService;
@@ -59,12 +67,6 @@ import github.daneren2005.dsub.util.Util;
import github.daneren2005.dsub.view.DrawerAdapter;
import github.daneren2005.dsub.view.UpdateView;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
public class SubsonicActivity extends ActionBarActivity implements OnItemSelectedListener {
private static final String TAG = SubsonicActivity.class.getSimpleName();
private static ImageLoader IMAGE_LOADER;
@@ -631,6 +633,13 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
} else {
setTheme(R.style.Theme_DSub_Holo);
}
+
+ SharedPreferences prefs = Util.getPreferences(this);
+ if(prefs.getBoolean(Constants.PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE, false)) {
+ Configuration config = new Configuration();
+ config.locale = Locale.ENGLISH;
+ getResources().updateConfiguration(config,getResources().getDisplayMetrics());
+ }
}
private void applyFullscreen() {
fullScreen = Util.getPreferences(this).getBoolean(Constants.PREFERENCES_KEY_FULL_SCREEN, false);
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java
index 20040f97..1b6ae833 100644
--- a/src/github/daneren2005/dsub/util/Constants.java
+++ b/src/github/daneren2005/dsub/util/Constants.java
@@ -139,6 +139,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_SHARED_ENABLED = "sharedEnabled";
public static final String PREFERENCES_KEY_BROWSE_TAGS = "browseTags";
public static final String PREFERENCES_KEY_OPEN_TO_LIBRARY = "openToLibrary";
+ public static final String PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE = "overrideSystemLanguage";
public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount";
public static final String OFFLINE_SCROBBLE_ID = "scrobbleID";