[L10n] Processing of traditional Chinese.

This commit is contained in:
Dmitry Kunin 2013-04-16 10:30:56 +03:00 committed by Alex Zolotarev
parent 4a301e1640
commit 11a514d8fb

View file

@ -43,6 +43,15 @@ static const MSLocale gLocales[] = {{0x1,"ar"},{0x2,"bg"},{0x3,"ca"},{0x4,"zh-Ha
namespace languages
{
class ChineseSimplifiedFilter
{
public:
bool operator()(string const & t)
{
return ("zh-Hans" == t) || ("zh-rCN" == t);
}
};
class LangFilter
{
set<string> & m_known;
@ -71,6 +80,9 @@ public:
void FilterLanguages(vector<string> & langs)
{
//we do not support simplified chinese by the momenty, so remove it from collection
langs.erase(remove_if(langs.begin(), langs.end(), ChineseSimplifiedFilter()), langs.end());
// normalize languages: en-US -> en, ru_RU -> ru etc.
for_each(langs.begin(), langs.end(), NormalizeFilter());
{ // tmp storage