mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
capitalize language names in stand-alone context, which I think French
wants. I hope other languages do too.
This commit is contained in:
parent
3dc555d719
commit
52269e6675
5 changed files with 17 additions and 4 deletions
|
@ -214,6 +214,11 @@ public class DelegateBase implements DlgClickNotify,
|
|||
return LocUtils.xlateLang( m_activity, langCode );
|
||||
}
|
||||
|
||||
protected String xlateLang( String langCode, boolean caps )
|
||||
{
|
||||
return LocUtils.xlateLang( m_activity, langCode, caps );
|
||||
}
|
||||
|
||||
protected String getQuantityString( int resID, int quantity,
|
||||
Object... params )
|
||||
{
|
||||
|
|
|
@ -243,7 +243,7 @@ public class GameListItem extends LinearLayout
|
|||
value =
|
||||
DictLangCache.getLangName( m_context,
|
||||
m_summary.dictLang );
|
||||
value = LocUtils.xlateLang( m_context, value );
|
||||
value = LocUtils.xlateLang( m_context, value, true );
|
||||
break;
|
||||
case R.string.game_summary_field_opponents:
|
||||
value = m_summary.playerNames();
|
||||
|
|
|
@ -38,7 +38,7 @@ public class LangListPreference extends XWListPreference {
|
|||
@Override
|
||||
public void setSummary( CharSequence summary )
|
||||
{
|
||||
super.setSummary( LocUtils.xlateLang( m_context, summary.toString() ) );
|
||||
super.setSummary( LocUtils.xlateLang( m_context, summary.toString(), true ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ public class PrefsDelegate extends DelegateBase
|
|||
String lang = langs[ii];
|
||||
haveDictForLang = haveDictForLang
|
||||
|| lang.equals( curLang );
|
||||
langsLoc[ii] = xlateLang( lang );
|
||||
langsLoc[ii] = xlateLang( lang, true );
|
||||
}
|
||||
|
||||
if ( !haveDictForLang ) {
|
||||
|
@ -265,7 +265,7 @@ public class PrefsDelegate extends DelegateBase
|
|||
forceDictsMatch( curLang );
|
||||
|
||||
lp.setEntries( langsLoc );
|
||||
lp.setDefaultValue( xlateLang( curLang ) );
|
||||
lp.setDefaultValue( xlateLang( curLang, true ) );
|
||||
lp.setEntryValues( langs );
|
||||
}
|
||||
|
||||
|
|
|
@ -114,6 +114,11 @@ public class LocUtils {
|
|||
}
|
||||
|
||||
public static String xlateLang( Context context, String lang )
|
||||
{
|
||||
return xlateLang( context, lang, false );
|
||||
}
|
||||
|
||||
public static String xlateLang( Context context, String lang, boolean caps )
|
||||
{
|
||||
if ( null == s_langMap ) {
|
||||
s_langMap = new HashMap<String, String>();
|
||||
|
@ -140,6 +145,9 @@ public class LocUtils {
|
|||
if ( null == xlated ) {
|
||||
xlated = lang;
|
||||
}
|
||||
if ( caps ) {
|
||||
xlated = Utils.capitalize( xlated );
|
||||
}
|
||||
return xlated;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue