| 67 | } |
| 68 | |
| 69 | TGetTextByIdPtr GetTextByIdFactoryForRegion(TextSource textSource, string const regionId) |
| 70 | { |
| 71 | string jsonBuffer; |
| 72 | for (LanguageIndex const languageIndex : PrioritizedMapLanguageIndexes(CountryLanguage::Instance().GetLocalLanguageIndexes(regionId))) |
| 73 | { |
| 74 | LanguageCode const languageCode = ConvertLanguageIndexToLanguageCode(languageIndex); |
| 75 | if (languageIndex == kDefaultNameIndex) |
| 76 | { |
| 77 | for (auto const & localLanguageCode : CountryLanguage::Instance().GetLocalLanguageCodes(regionId)) |
| 78 | if (GetJsonBuffer(textSource, localLanguageCode, jsonBuffer)) |
| 79 | return GetTextById::Create(jsonBuffer, localLanguageCode); |
| 80 | } |
| 81 | else if (GetJsonBuffer(textSource, languageCode, jsonBuffer)) |
| 82 | { |
| 83 | return GetTextById::Create(jsonBuffer, languageCode); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | ASSERT(false, ("Can't find translation for region. (Region ID:", regionId, ")")); |
| 88 | return nullptr; |
| 89 | } |
| 90 | |
| 91 | TGetTextByIdPtr GetTextByIdFactory(TextSource textSource, string const & localeName) |
| 92 | { |
no test coverage detected