add language localization tools

This commit is contained in:
Chris Danford
2005-12-28 19:21:08 +00:00
parent 76e78a1bc4
commit b42d28af34
14 changed files with 312 additions and 34 deletions
+17 -2
View File
@@ -446,7 +446,7 @@ static const LanguageInfo g_langs[] =
{"ZU", "Zulu", "isiZulu"},
};
void GetLanguageInfos( vector<LanguageInfo> &vAddTo )
void GetLanguageInfos( vector<const LanguageInfo*> &vAddTo )
{
for( int i=0; i<ARRAYSIZE(g_langs); i++ )
{
@@ -456,10 +456,25 @@ void GetLanguageInfos( vector<LanguageInfo> &vAddTo )
// smtools UI.
if( g_langs[i].szNativeName == RString() )
continue;
vAddTo.push_back( g_langs[i] );
vAddTo.push_back( &g_langs[i] );
}
}
const LanguageInfo *GetLanguageInfo( const RString &sIsoCode )
{
for( int i=0; i<ARRAYSIZE(g_langs); i++ )
{
// Only use languages in the intersection of Windows languages
// and languages that had native forms on the site listed above.
// Obscure languages are dropped so that they don't clutter up the
// smtools UI.
if( sIsoCode.CompareNoCase(g_langs[i].szIsoCode) == 0 )
return &g_langs[i];
}
return NULL;
}
RString join( const RString &sDeliminator, const vector<RString> &sSource)
{
if( sSource.empty() )