Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2016-05-13 19:53:08 +0300
committerMaxim Pimenov <m@maps.me>2016-05-13 19:53:21 +0300
commit89053af365d4beee928dd96b5cf142b6f20bea64 (patch)
treecef2feabe73fb1281a63142a63408d3643341990
parentcd2d12ca9b08ad0c8b45af7624edeb4eb50e412e (diff)
[indexer] Added the list of currently disabled languages to CategoriesHolder.
-rw-r--r--indexer/categories_holder.cpp4
-rw-r--r--indexer/categories_holder.hpp4
-rw-r--r--indexer/indexer_tests/categories_test.cpp4
3 files changed, 12 insertions, 0 deletions
diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp
index 01b54a3c4f..c723cbee17 100644
--- a/indexer/categories_holder.cpp
+++ b/indexer/categories_holder.cpp
@@ -54,6 +54,7 @@ vector<CategoriesHolder::Mapping> const CategoriesHolder::kLocaleMapping = {{"en
{"el", 28},
{"he", 29},
{"sw", 30}};
+vector<string> CategoriesHolder::kDisabledLanguages = {"el", "he", "sw"};
CategoriesHolder::CategoriesHolder(unique_ptr<Reader> && reader)
{
@@ -312,6 +313,9 @@ int8_t CategoriesHolder::MapLocaleToInteger(string const & locale)
ASSERT(!kLocaleMapping.empty(), ());
ASSERT_EQUAL(string(kLocaleMapping[0].m_name), "en", ());
ASSERT_EQUAL(kLocaleMapping[0].m_code, kEnglishCode, ());
+ ASSERT(
+ find(kDisabledLanguages.begin(), kDisabledLanguages.end(), "en") == kDisabledLanguages.end(),
+ ());
for (auto const & entry : kLocaleMapping)
{
diff --git a/indexer/categories_holder.hpp b/indexer/categories_holder.hpp
index 14e7f97053..b488e4ab5d 100644
--- a/indexer/categories_holder.hpp
+++ b/indexer/categories_holder.hpp
@@ -55,6 +55,10 @@ public:
static int8_t const kUnsupportedLocaleCode;
static vector<Mapping> const kLocaleMapping;
+ // List of languages that are currently disabled in the application
+ // because their translations are not yet complete.
+ static vector<string> kDisabledLanguages;
+
explicit CategoriesHolder(unique_ptr<Reader> && reader);
void LoadFromStream(istream & s);
diff --git a/indexer/indexer_tests/categories_test.cpp b/indexer/indexer_tests/categories_test.cpp
index 81c6753cbf..141a05a152 100644
--- a/indexer/indexer_tests/categories_test.cpp
+++ b/indexer/indexer_tests/categories_test.cpp
@@ -270,10 +270,14 @@ UNIT_TEST(CategoriesIndex_UniqueNames)
editor::EditorConfig config;
osm::NewFeatureCategories categories(config);
+ auto const & disabled = CategoriesHolder::kDisabledLanguages;
+
bool noDuplicates = true;
for (auto const & locale : CategoriesHolder::kLocaleMapping)
{
string const lang(locale.m_name);
+ if (find(disabled.begin(), disabled.end(), lang) != disabled.end())
+ continue;
categories.AddLanguage(lang);
auto const & names = categories.GetAllCategoryNames(lang);