From e12fbcce8e227c7a6b118d0dbb8fb47527ac181e Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 15 Apr 2014 07:34:14 -0700 Subject: [PATCH] more use of LocUtils.getString() --- .../XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java | 3 ++- .../XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java | 5 +++-- .../src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java index 625c70c2e..d1bdf364b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java @@ -33,6 +33,7 @@ import org.eehouse.android.xw4.XWPrefs; import org.eehouse.android.xw4.R; import org.eehouse.android.xw4.DictUtils; import org.eehouse.android.xw4.DbgUtils; +import org.eehouse.android.xw4.loc.LocUtils; public class CommonPrefs extends XWPrefs { public static final int COLOR_TILE_BACK = 0; @@ -185,7 +186,7 @@ public class CommonPrefs extends XWPrefs { result = null; // be consistent } if ( force && null == result ) { - String fmt = context.getString( R.string.player_fmt ); + String fmt = LocUtils.getString( context, R.string.player_fmt ); result = String.format( fmt, num + 1 ); } return result; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java index c527eed31..6702ca968 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java @@ -30,6 +30,7 @@ import org.eehouse.android.xw4.DbgUtils; import org.eehouse.android.xw4.DictUtils; import org.eehouse.android.xw4.R; import org.eehouse.android.xw4.DictLangCache; +import org.eehouse.android.xw4.loc.LocUtils; public class CurGameInfo { @@ -257,14 +258,14 @@ public class CurGameInfo { if ( lp.isLocal || serverRole == DeviceRole.SERVER_STANDALONE ) { String name; if ( lp.isRobot() ) { - String format = m_context.getString( R.string.robot_name_fmt ); + String format = LocUtils.getString( m_context, R.string.robot_name_fmt ); name = String.format( format, lp.name ); } else { name = lp.name; } names[ii] = String.format( nameFmt, name, dictName(lp) ); } else { - names[ii] = m_context.getString( R.string.guest_name ); + names[ii] = LocUtils.getString( m_context, R.string.guest_name ); } } return names; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java index de6db9432..793741caa 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java @@ -28,6 +28,7 @@ import org.eehouse.android.xw4.DbgUtils; import org.eehouse.android.xw4.XWApp; import org.eehouse.android.xw4.XWPrefs; import org.eehouse.android.xw4.R; +import org.eehouse.android.xw4.loc.LocUtils; public class UtilCtxtImpl implements UtilCtxt { private Context m_context; @@ -230,7 +231,7 @@ public class UtilCtxtImpl implements UtilCtxt { if ( 0 == id ) { result = ""; } else { - result = m_context.getString( id ); + result = LocUtils.getString( m_context, id ); } return result; }