diff --git a/platform/get_text_by_id.cpp b/platform/get_text_by_id.cpp index 4a2ebafb95..f60be22468 100644 --- a/platform/get_text_by_id.cpp +++ b/platform/get_text_by_id.cpp @@ -15,23 +15,18 @@ string const kDefaultLanguage = "en"; string GetTextSourceString(platform::TextSource textSource) { -#if defined(OMIM_OS_ANDROID) || defined(OMIM_OS_IPHONE) switch (textSource) { case platform::TextSource::TtsSound: - return "sound-strings"; + return string("sound-strings"); } -#else - switch (textSource) - { - case platform::TextSource::TtsSound: - return "../data/sound-strings"; - } -#endif ASSERT(false, ()); return string(); } +} // namespace +namespace platform +{ bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, string & jsonBuffer) { string const pathToJson = my::JoinFoldersToPath( @@ -50,10 +45,7 @@ bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, s } return true; } -} // namespace -namespace platform -{ TGetTextByIdPtr MakeGetTextById(string const & jsonBuffer, string const & localeName) { TGetTextByIdPtr result(new GetTextById(jsonBuffer, localeName)); diff --git a/platform/get_text_by_id.hpp b/platform/get_text_by_id.hpp index 9a6fd38467..b153617820 100644 --- a/platform/get_text_by_id.hpp +++ b/platform/get_text_by_id.hpp @@ -50,4 +50,8 @@ private: /// * a factory returns nullptr TGetTextByIdPtr GetTextByIdFactory(TextSource textSource, string const & localeName); TGetTextByIdPtr ForTestingGetTextByIdFactory(string const & jsonBuffer, string const & localeName); + +/// \bried fills jsonBuffer with json file in twine format with strings in a language of localeName. +/// @return true if no error was happened and false otherwise. +bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, string & jsonBuffer); } // namespace platform