From 937459ce58d3f34c2aba6a9d1cdb47bf5cfca58d Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 28 Aug 2011 17:17:05 +0000 Subject: [PATCH] Core: GetLngSet(const String& module) git-svn-id: svn://ultimatepp.org/upp/trunk@3794 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/i18n.h | 1 + uppsrc/Core/t.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) 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);