preference screen previews set values
This commit is contained in:
parent
0da1aef763
commit
a8830e2ede
5 changed files with 82 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue