add xlateLang() to delegate base class

This commit is contained in:
Eric House 2015-04-02 06:22:34 -07:00
parent 6d39a0fdca
commit 27dde57660
4 changed files with 10 additions and 5 deletions

View file

@ -209,6 +209,11 @@ public class DelegateBase implements DlgClickNotify,
return LocUtils.getString( m_activity, resID, params );
}
protected String xlateLang( String langCode )
{
return LocUtils.xlateLang( m_activity, langCode );
}
protected String getQuantityString( int resID, int quantity,
Object... params )
{

View file

@ -187,8 +187,9 @@ public class DictsDelegate extends ListDelegateBase
int langCode = DictLangCache.getLangLangCode( m_context,
langName );
boolean expanded = ! m_closedLangs.contains( langName );
String locLangName = LocUtils.xlateLang( m_context, langName );
String name = getQuantityString( R.plurals.lang_name_fmt, info.m_numDicts,
String locLangName = xlateLang( langName );
String name = getQuantityString( R.plurals.lang_name_fmt,
info.m_numDicts,
locLangName, info.m_numDicts );
result = ListGroup.make( m_context, convertView,
DictsDelegate.this, groupPos, name,

View file

@ -1920,8 +1920,7 @@ public class GamesListDelegate extends ListDelegateBase
public void gotDictInfo( boolean success, String lang,
String name ) {
if ( success ) {
String locLang =
LocUtils.xlateLang( m_activity, lang );
String locLang = xlateLang( lang );
String msg =
getString( R.string.confirm_get_locdict_fmt,
locLang );

View file

@ -251,7 +251,7 @@ public class PrefsDelegate extends DelegateBase
String[] langs = DictLangCache.listLangs( m_activity );
String[] langsLoc = new String[langs.length];
for ( int ii = 0; ii < langs.length; ++ii ) {
langsLoc[ii] = LocUtils.xlateLang( m_activity, langs[ii] );
langsLoc[ii] = xlateLang( langs[ii] );
}
lp.setEntries( langsLoc );
lp.setDefaultValue( langsLoc[0] );