| 16 | shared_str CStringTable::GetLanguage() { return pData->m_sLanguage; } |
| 17 | |
| 18 | void CStringTable::Init() |
| 19 | { |
| 20 | if (pData) |
| 21 | return; |
| 22 | |
| 23 | pData = xr_new<STRING_TABLE_DATA>(); |
| 24 | |
| 25 | //имя языка, если не задано (NULL), то первый <text> в <string> в XML |
| 26 | SetLanguage(); |
| 27 | |
| 28 | LPCSTR S = pSettings->r_string("string_table", "files"); |
| 29 | if (S && S[0]) |
| 30 | { |
| 31 | string128 xml_file; |
| 32 | int count = _GetItemCount(S); |
| 33 | for (int it = 0; it < count; ++it) |
| 34 | { |
| 35 | _GetItem(S, it, xml_file); |
| 36 | Load(xml_file); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | if (pSettings->section_exist("string_table_files")) |
| 41 | { |
| 42 | CInifile::Sect& files = pSettings->r_section("string_table_files"); |
| 43 | for (const auto& i : files.Ordered_Data) |
| 44 | Load(i.first.c_str()); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void CStringTable::Load(LPCSTR xml_file) |
| 49 | { |
no test coverage detected