diff --git a/uppsrc/Core/i18n.h b/uppsrc/Core/i18n.h index 70a496d48..30d2a5332 100644 --- a/uppsrc/Core/i18n.h +++ b/uppsrc/Core/i18n.h @@ -47,6 +47,7 @@ String GetLngString(const char *id); String GetLngString(int lang, const char *id); Index GetLngSet(); +Index GetLngSet(const String& module); void SaveLngFile(FileOut& out, int lang); bool LoadLngFile(const char *file); diff --git a/uppsrc/Core/t.cpp b/uppsrc/Core/t.cpp index 0f9a2dbc3..e1eb629f9 100644 --- a/uppsrc/Core/t.cpp +++ b/uppsrc/Core/t.cpp @@ -299,6 +299,26 @@ Index GetLngSet() return ndx; } +Index GetLngSet(const String& module) +{ + CriticalSection::Lock __(slng); + Index ndx; + Array& ma = sMod(); + for(int i = 0; i < ma.GetCount(); i++) { + LngModule& m = ma[i]; + if (m.name != module) + continue; + + for (int j = 0; j < m.map.GetCount(); ++j) { + Vector& lr = m.map[j]; + for(int k = 0; k < lr.GetCount(); k++) + ndx.FindAdd(lr[k].lang); + } + } + + return ndx; +} + void SaveLngFile(FileOut& out, int lang) { CriticalSection::Lock __(slng);