changed: removed Languages::Land enum
now we set the languages in the config file: option locale_files, sample: locale_files = ( en, pl ) it represents the name of locale files (those from locale_dir directory) renamed config option: locale to locale_default git-svn-id: svn://ttmath.org/publicrep/winix/trunk@722 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -23,27 +23,27 @@ void IndexPatterns::SetConfig(Config * pconfig)
|
||||
config = pconfig;
|
||||
}
|
||||
|
||||
|
||||
void IndexPatterns::SetEzcFunctions(TemplatesFunctions::EzcFun * fun)
|
||||
{
|
||||
ezc_fun = fun;
|
||||
}
|
||||
|
||||
Ezc::Pattern * IndexPatterns::GetPattern(const std::wstring & file, Locale::Lang lang)
|
||||
|
||||
Ezc::Pattern * IndexPatterns::GetPattern(const std::wstring & file, size_t lang)
|
||||
{
|
||||
Tab::iterator i = tab.find(file);
|
||||
|
||||
if( i == tab.end() )
|
||||
return 0;
|
||||
|
||||
size_t index = static_cast<size_t>(lang);
|
||||
|
||||
if( index >= i->second.patterns.size() )
|
||||
if( lang >= i->second.patterns.size() )
|
||||
{
|
||||
log << log1 << "IndexPatterns: there is no a pattern: " << file << ", for lang: " << index << logend;
|
||||
log << log1 << "IndexPatterns: there is no a pattern: " << file << ", for lang: " << lang << logend;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return &i->second.patterns[index];
|
||||
return &i->second.patterns[lang];
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void IndexPatterns::AddFileName(const std::wstring & file)
|
||||
void IndexPatterns::ReadPattern(Tab::iterator & iter, Locale & locale, LocaleFilter & locale_filter, bool delete_white)
|
||||
{
|
||||
size_t i;
|
||||
size_t len = Locale::lang_unknown;
|
||||
size_t len = locale.Size();
|
||||
Template & templ = iter->second;
|
||||
|
||||
templ.patterns.resize(len);
|
||||
@@ -96,7 +96,7 @@ void IndexPatterns::ReadPattern(Tab::iterator & iter, Locale & locale, LocaleFil
|
||||
if( ezc_fun )
|
||||
templ.patterns[i].CacheFunctions(*ezc_fun);
|
||||
|
||||
locale_filter.Filter(templ.patterns[i], locale, static_cast<Locale::Lang>(i));
|
||||
locale_filter.Filter(templ.patterns[i], locale, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user