diff --git a/3party/3party.pro b/3party/3party.pro index 182eae7aea..b22ddded47 100644 --- a/3party/3party.pro +++ b/3party/3party.pro @@ -7,7 +7,8 @@ TEMPLATE = subdirs CONFIG *= desktop } -SUBDIRS = freetype fribidi minizip jansson protobuf osrm expat succinct pugixml liboauthcpp stb_image sdf_image +SUBDIRS = freetype fribidi minizip jansson protobuf osrm expat succinct pugixml liboauthcpp stb_image sdf_image \ + icu # TODO(mgsrergio): Move opening hours out of 3party to the main project tree. # See https://trello.com/c/tWYSnXSS/22-opening-hours-3party-boost-test-framework. diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 9345fafb62..125c24082a 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -26,7 +26,7 @@ define add_prebuild_static_lib endef prebuild_static_libs := map tracking routing traffic routing_common drape_frontend search storage indexer drape platform editor partners_api geometry coding base opening_hours -prebuild_static_libs += pugixml oauthcpp expat freetype fribidi minizip jansson protobuf osrm stats_client succinct stb_image sdf_image +prebuild_static_libs += pugixml oauthcpp expat freetype fribidi minizip jansson protobuf osrm stats_client succinct stb_image sdf_image icu $(foreach item,$(prebuild_static_libs),$(eval $(call add_prebuild_static_lib,$(item)))) diff --git a/drape_head/drape_head.pro b/drape_head/drape_head.pro index 0aad7f0849..a655054d3f 100644 --- a/drape_head/drape_head.pro +++ b/drape_head/drape_head.pro @@ -1,7 +1,7 @@ # Head project for drape develop and debuging ROOT_DIR = .. DEPENDENCIES = map traffic drape_frontend drape indexer storage platform geometry coding base \ - freetype expat protobuf jansson fribidi stats_client stb_image sdf_image + freetype expat protobuf jansson fribidi stats_client stb_image sdf_image icu include($$ROOT_DIR/common.pri) diff --git a/feature_list/feature_list.pro b/feature_list/feature_list.pro index 02ac37d719..1168cef9bc 100644 --- a/feature_list/feature_list.pro +++ b/feature_list/feature_list.pro @@ -2,7 +2,7 @@ ROOT_DIR = .. DEPENDENCIES = map traffic search_tests_support search search_quality storage indexer platform editor geometry \ - coding base jansson protobuf stats_client succinct opening_hours pugixml + coding base jansson protobuf stats_client succinct opening_hours pugixml icu include($$ROOT_DIR/common.pri) diff --git a/map/benchmark_tool/benchmark_tool.pro b/map/benchmark_tool/benchmark_tool.pro index 1f8e8d88ca..0c0346daed 100644 --- a/map/benchmark_tool/benchmark_tool.pro +++ b/map/benchmark_tool/benchmark_tool.pro @@ -7,7 +7,7 @@ TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = map indexer platform editor geometry coding base gflags protobuf succinct pugixml stats_client +DEPENDENCIES = map indexer platform editor geometry coding base gflags protobuf succinct pugixml stats_client icu include($$ROOT_DIR/common.pri) diff --git a/map/framework.cpp b/map/framework.cpp index 1e86acd3db..a2b6fe399e 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -98,6 +98,11 @@ #include "3party/Alohalytics/src/alohalytics.h" +#include "3party/icu/i18n/unicode/translit.h" +#include "3party/icu/i18n/unicode/utrans.h" +#include "3party/icu/common/unicode/utypes.h" +#include "3party/icu/common/unicode/unistr.h" + #define KMZ_EXTENSION ".kmz" #define DEFAULT_BOOKMARK_TYPE "placemark-red" @@ -141,6 +146,29 @@ vector kSearchMarks = "search-booking" }; +string Transliterate(string str) +{ + UnicodeString ustr(str.c_str()); + UErrorCode status = U_ZERO_ERROR; + + unique_ptr latin_tl(Transliterator::createInstance("Any-Latin", UTRANS_FORWARD, status)); + if (latin_tl == nullptr) + return ""; + + latin_tl->transliterate(ustr); + + int32_t bufLen = 1024; + vector outbuf(bufLen); + int32_t strLen = ustr.extract(outbuf.data(), bufLen, NULL, status); + if (status == U_BUFFER_OVERFLOW_ERROR) + { + outbuf.resize(strLen + 1); + ustr.extract(outbuf.data(), strLen + 1, NULL, status); + } + outbuf[strLen] = '\0'; + return string(outbuf.data()); +} + // TODO! // To adjust GpsTrackFilter was added secret command "?gpstrackaccuracy:xxx;" // where xxx is a new value for horizontal accuracy. @@ -2121,6 +2149,9 @@ void Framework::SetMapSelectionListeners(TActivateMapSelectionFn const & activat void Framework::ActivateMapSelection(bool needAnimation, df::SelectionShape::ESelectedObject selectionType, place_page::Info const & info) { + //string result = Transliterate("Москва"); + //LOG(LWARNING, ("!!!!!!!!!!!!!!!!!! ", result)); + ASSERT_NOT_EQUAL(selectionType, df::SelectionShape::OBJECT_EMPTY, ("Empty selections are impossible.")); m_selectedFeature = info.GetID(); CallDrapeFunction(bind(&df::DrapeEngine::SelectObject, _1, selectionType, info.GetMercator(), info.GetID(), diff --git a/map/map.pro b/map/map.pro index 0d6f9f60fb..a1fd727f4e 100644 --- a/map/map.pro +++ b/map/map.pro @@ -6,7 +6,7 @@ CONFIG += staticlib warn_on ROOT_DIR = .. -INCLUDEPATH *= $$ROOT_DIR/3party/protobuf/src $$ROOT_DIR/3party/freetype/include $$ROOT_DIR/3party/jansson/src +INCLUDEPATH *= $$ROOT_DIR/3party/protobuf/src $$ROOT_DIR/3party/freetype/include $$ROOT_DIR/3party/jansson/src $$ROOT_DIR/3party/icu/common $$ROOT_DIR/3party/icu/i18n include($$ROOT_DIR/common.pri) diff --git a/map/map_tests/map_tests.pro b/map/map_tests/map_tests.pro index 60b6b766d3..3ea036d7d5 100644 --- a/map/map_tests/map_tests.pro +++ b/map/map_tests/map_tests.pro @@ -8,7 +8,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map drape_frontend routing traffic routing_common search storage tracking drape \ indexer partners_api platform editor geometry coding base freetype fribidi expat \ - protobuf jansson osrm stats_client minizip succinct pugixml stats_client stb_image sdf_image + protobuf jansson osrm stats_client minizip succinct pugixml stats_client stb_image sdf_image icu DEPENDENCIES *= opening_hours diff --git a/map/mwm_tests/mwm_tests.pro b/map/mwm_tests/mwm_tests.pro index 473b5a70f3..2dbcb6138d 100644 --- a/map/mwm_tests/mwm_tests.pro +++ b/map/mwm_tests/mwm_tests.pro @@ -7,7 +7,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map traffic search storage indexer platform editor geometry coding base \ - freetype fribidi expat protobuf jansson succinct pugixml stats_client + freetype fribidi expat protobuf jansson succinct pugixml stats_client icu include($$ROOT_DIR/common.pri) diff --git a/map/style_tests/style_tests.pro b/map/style_tests/style_tests.pro index 7b4c356e77..a4426df56c 100644 --- a/map/style_tests/style_tests.pro +++ b/map/style_tests/style_tests.pro @@ -6,7 +6,7 @@ TEMPLATE = app INCLUDEPATH += ../../3party/protobuf/src ROOT_DIR = ../.. -DEPENDENCIES = map traffic indexer platform geometry coding base expat protobuf stats_client +DEPENDENCIES = map traffic indexer platform geometry coding base expat protobuf stats_client icu macx-*: LIBS *= "-framework IOKit" diff --git a/mapshot/mapshot.pro b/mapshot/mapshot.pro index 41bd7c936b..0a3e16d5a0 100644 --- a/mapshot/mapshot.pro +++ b/mapshot/mapshot.pro @@ -4,7 +4,7 @@ ROOT_DIR = .. DEPENDENCIES = map drape_frontend routing search storage tracking traffic routing_common indexer \ drape partners_api platform editor geometry coding base \ freetype expat fribidi gflags jansson protobuf osrm stats_client minizip succinct \ - pugixml opening_hours stb_image sdf_image + pugixml opening_hours stb_image sdf_image icu include($$ROOT_DIR/common.pri) diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index 31c27fd0bb..a808ad2556 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -72,6 +72,8 @@ omim_link_libraries( base freetype expat + icuuc + icui18n fribidi jansson protobuf diff --git a/qt/qt.pro b/qt/qt.pro index 8959cf5b07..95d46eea9e 100644 --- a/qt/qt.pro +++ b/qt/qt.pro @@ -4,7 +4,7 @@ ROOT_DIR = .. DEPENDENCIES = qt_common map drape_frontend openlr routing search storage tracking traffic routing_common \ indexer drape partners_api platform editor geometry \ coding base freetype expat fribidi jansson protobuf osrm stats_client \ - minizip succinct pugixml oauthcpp stb_image sdf_image + minizip succinct pugixml oauthcpp stb_image sdf_image icu DEPENDENCIES += opening_hours \ diff --git a/routing/routing_benchmarks/routing_benchmarks.pro b/routing/routing_benchmarks/routing_benchmarks.pro index 28570fc45c..018904f510 100644 --- a/routing/routing_benchmarks/routing_benchmarks.pro +++ b/routing/routing_benchmarks/routing_benchmarks.pro @@ -5,7 +5,7 @@ TEMPLATE = app ROOT_DIR = ../../ DEPENDENCIES = map routing traffic routing_common search storage indexer platform editor geometry coding base \ - osrm jansson protobuf stats_client succinct pugixml + osrm jansson protobuf stats_client succinct pugixml icu macx-*: LIBS *= "-framework IOKit" diff --git a/routing/routing_consistency_tests/routing_consistency_tests.pro b/routing/routing_consistency_tests/routing_consistency_tests.pro index fe39afc7b9..95513fe313 100644 --- a/routing/routing_consistency_tests/routing_consistency_tests.pro +++ b/routing/routing_consistency_tests/routing_consistency_tests.pro @@ -8,7 +8,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map routing traffic routing_common search storage indexer platform editor geometry coding base osrm \ - jansson protobuf succinct stats_client generator gflags pugixml + jansson protobuf succinct stats_client generator gflags pugixml icu include($$ROOT_DIR/common.pri) diff --git a/routing/routing_integration_tests/routing_integration_tests.pro b/routing/routing_integration_tests/routing_integration_tests.pro index aeaf06f212..1e1a653331 100644 --- a/routing/routing_integration_tests/routing_integration_tests.pro +++ b/routing/routing_integration_tests/routing_integration_tests.pro @@ -12,7 +12,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map routing traffic routing_common search storage indexer platform editor geometry coding base \ - osrm jansson protobuf succinct stats_client pugixml + osrm jansson protobuf succinct stats_client pugixml icu DEPENDENCIES += opening_hours diff --git a/search/search_quality/features_collector_tool/features_collector_tool.pro b/search/search_quality/features_collector_tool/features_collector_tool.pro index 347ffda7e8..7e510bd19d 100644 --- a/search/search_quality/features_collector_tool/features_collector_tool.pro +++ b/search/search_quality/features_collector_tool/features_collector_tool.pro @@ -9,7 +9,7 @@ ROOT_DIR = ../../.. # todo(@m) revise DEPENDENCIES = map drape_frontend routing traffic routing_common search_tests_support search search_quality \ storage indexer drape platform editor geometry coding base freetype expat fribidi gflags \ - jansson protobuf osrm stats_client minizip succinct opening_hours pugixml stb_image sdf_image + jansson protobuf osrm stats_client minizip succinct opening_hours pugixml stb_image sdf_image icu include($$ROOT_DIR/common.pri) diff --git a/search/search_quality/search_quality_tests/search_quality_tests.pro b/search/search_quality/search_quality_tests/search_quality_tests.pro index 2b1935c378..a00fe1b24b 100644 --- a/search/search_quality/search_quality_tests/search_quality_tests.pro +++ b/search/search_quality/search_quality_tests/search_quality_tests.pro @@ -9,7 +9,7 @@ ROOT_DIR = ../../.. # todo(@m) revise DEPENDENCIES = map drape_frontend routing traffic routing_common search_tests_support search search_quality storage indexer drape platform geometry coding base \ freetype expat fribidi gflags jansson protobuf osrm stats_client minizip succinct \ - opening_hours stb_image sdf_image + opening_hours stb_image sdf_image icu include($$ROOT_DIR/common.pri) diff --git a/search/search_quality/search_quality_tool/search_quality_tool.pro b/search/search_quality/search_quality_tool/search_quality_tool.pro index 42914e1ad5..5f3ae24241 100644 --- a/search/search_quality/search_quality_tool/search_quality_tool.pro +++ b/search/search_quality/search_quality_tool/search_quality_tool.pro @@ -10,7 +10,7 @@ ROOT_DIR = ../../.. DEPENDENCIES = map drape_frontend routing traffic routing_common search_tests_support search search_quality storage indexer drape \ platform editor geometry coding base freetype expat fribidi gflags \ jansson protobuf osrm stats_client minizip succinct \ - opening_hours pugixml stb_image sdf_image + opening_hours pugixml stb_image sdf_image icu include($$ROOT_DIR/common.pri) diff --git a/storage/storage_integration_tests/storage_integration_tests.pro b/storage/storage_integration_tests/storage_integration_tests.pro index 4188439612..d1c226b6cc 100644 --- a/storage/storage_integration_tests/storage_integration_tests.pro +++ b/storage/storage_integration_tests/storage_integration_tests.pro @@ -9,7 +9,7 @@ ROOT_DIR = ../.. DEPENDENCIES = map drape_frontend routing search storage tracking traffic routing_common indexer drape \ partners_api platform_tests_support platform editor opening_hours geometry \ coding base freetype expat fribidi jansson protobuf osrm stats_client \ - minizip succinct pugixml oauthcpp stb_image sdf_image + minizip succinct pugixml oauthcpp stb_image sdf_image icu include($$ROOT_DIR/common.pri)