i18n: Remove some redundant/legacy wxWidgets language codes, in particular regarding Traditional/Taiwan Chinese.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4079 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-12-08 03:56:08 +00:00
parent fa76cfdeca
commit d9fdecd176
3 changed files with 21 additions and 10 deletions

View File

@ -237,14 +237,18 @@ void Pcsx2App::OpenProgramLog()
if( m_current_focus ) m_current_focus->SetFocus();
/*
// This is test code for printing out all supported languages and their canonical names in wiki-fied
// format. I might use it again soon, so I'm leaving it in for now... --air
/*
for( int li=wxLANGUAGE_UNKNOWN+1; li<wxLANGUAGE_USER_DEFINED; ++li )
{
if (const wxLanguageInfo* info = wxLocale::GetLanguageInfo( li ))
Console.WriteLn( L"|| %-30s || %s ||", info->Description.c_str(), info->CanonicalName.c_str() );
}*/
{
if (i18n_IsLegacyLanguageId((wxLanguage)info->Language)) continue;
Console.WriteLn( L"|| %-30s || %-8s ||", info->Description.c_str(), info->CanonicalName.c_str() );
}
}
*/
}
void Pcsx2App::AllocateCoreStuffs()
@ -374,7 +378,7 @@ void Pcsx2App::OnInitCmdLine( wxCmdLineParser& parser )
const PluginInfo* pi = tbl_PluginInfo; do {
parser.AddOption( wxEmptyString, pi->GetShortname().Lower(),
wxsFormat( _("specify the file to use as the %s plugin"), pi->GetShortname().c_str() )
pxsFmt( _("specify the file to use as the %s plugin"), pi->GetShortname().c_str() )
);
} while( ++pi, pi->shortname != NULL );

View File

@ -45,15 +45,21 @@ LangPackEnumeration::LangPackEnumeration()
englishName += L" [" + info->Description + L"]";
}
// Some of the codes provided by wxWidgets are 'obsolete' -- effectively replaced by more specific
// region-qualified language codes. This function can be used to filter them out.
bool i18n_IsLegacyLanguageId( wxLanguage lang )
{
return
(lang == wxLANGUAGE_ENGLISH) ||
(lang == wxLANGUAGE_CHINESE) ||
(lang == wxLANGUAGE_CHINESE_TAIWAN) ||
(lang == wxLANGUAGE_SERBIAN) ||
(lang == wxLANGUAGE_SPANISH);
}
static void i18n_DoPackageCheck( wxLanguage wxLangId, LangPackList& langs )
{
// Plain english is a special case that's built in, and we only want it added to the list
// once, so we check for wxLANGUAGE_ENGLISH and then ignore other IsEnglish ids below.
if( wxLangId == wxLANGUAGE_ENGLISH )
langs.push_back( LangPackEnumeration( wxLangId ) );
if( pxIsEnglish( wxLangId ) ) return;
if( i18n_IsLegacyLanguageId( wxLangId ) ) return;
// Note: wx auto-preserves the current locale for us
if( !wxLocale::IsAvailable( wxLangId ) ) return;

View File

@ -38,4 +38,5 @@ typedef std::vector<LangPackEnumeration> LangPackList;
extern bool i18n_SetLanguage( const wxString& langCode );
extern bool i18n_SetLanguage( int wxLangId );
extern void i18n_EnumeratePackages( LangPackList& langs );
extern bool i18n_IsLegacyLanguageId( wxLanguage lang );