1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-24 07:41:23 +00:00

preference screen previews set values

This commit is contained in:
Christian Schabesberger
2016-01-03 19:55:04 +01:00
parent 0da1aef763
commit a8830e2ede
5 changed files with 82 additions and 12 deletions

View File

@@ -1,6 +1,5 @@
package org.schabi.newpipe;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
@@ -22,7 +21,8 @@ public class Localization {
public static Locale getPreferredLocale(Context context) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
String languageCode = sp.getString(String.valueOf(R.string.searchLanguage), "en");
String languageCode = sp.getString(String.valueOf(R.string.searchLanguagePreference),
context.getString(R.string.defaultLanguageItem));
if(languageCode.length() == 2) {
return new Locale(languageCode);