From 3a7111c098fdac69942c9a1b0dfcef22af5d02c1 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 5 May 2014 06:03:33 -0700 Subject: [PATCH] translate ListPreference lists --- .../src/org/eehouse/android/xw4/loc/LocUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocUtils.java index 9e51e0498..0cdacdc42 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocUtils.java @@ -28,6 +28,7 @@ import android.content.res.Resources; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceGroup; +import android.preference.ListPreference; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.Menu; @@ -469,6 +470,15 @@ public class LocUtils { pref.setTitle( str ); } + if ( pref instanceof ListPreference ) { + ListPreference lp = (ListPreference) pref; + CharSequence[] entries = lp.getEntries(); + if ( null != entries ) { + CharSequence[] newEntries = xlateStrings( context, entries ); + lp.setEntries( newEntries ); + } + } + if ( pref instanceof PreferenceGroup ) { PreferenceGroup group = (PreferenceGroup)pref; int count = group.getPreferenceCount();