MCPcopy Create free account
hub / github.com/Maplespe/DWMBlurGlass / LoadLanguageFileList

Function LoadLanguageFileList

DWMBlurGlassHost/UIManager.cpp:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 std::unordered_map<std::wstring, std::wstring> g_baselangList;
27
28 bool LoadLanguageFileList()
29 {
30 std::wstring path = Utils::GetCurrentDir() + L"\\data\\lang\\";
31
32 std::vector<std::wstring> fileList;
33 EnumFiles(path, L"*.xml", fileList);
34
35 if (fileList.empty())
36 return false;
37
38 for(auto& file : fileList)
39 {
40 pugi::xml_document xmldoc;
41
42 if (!xmldoc.load_file(file.c_str()))
43 continue;
44
45 auto root = xmldoc.child(L"lang");
46 if (root.empty())
47 continue;
48
49 auto local = root.attribute(L"local");
50 if (local.empty())
51 continue;
52
53 g_langfileList.insert({ static_cast<std::wstring>(local.as_string()), file });
54 }
55
56 return !g_langfileList.empty();
57 }
58
59 std::wstring GetLanguageString(std::wstring_view name)
60 {

Callers 1

wWinMainFunction · 0.85

Calls 7

GetCurrentDirFunction · 0.85
EnumFilesFunction · 0.85
load_fileMethod · 0.80
childMethod · 0.80
attributeMethod · 0.80
as_stringMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected