Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » New/additional GetLngSet
New/additional GetLngSet [message #33451] |
Mon, 08 August 2011 22:23 |
galious
Messages: 28 Registered: March 2008
|
Promising Member |
|
|
Hi,
any chance the following snippet could be included in base? IT would allow someone to retrieve all translations for a specific module. I use this to list the languages supported by my application (and excluding all languages shipped with Upp by default).
In t.cpp:
Index<int> GetLngSet(String& module)
{
CriticalSection::Lock __(slng);
Index<int> ndx;
Array<LngModule>& 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<LngRec>& lr = m.map[j];
for(int k = 0; k < lr.GetCount(); k++)
ndx.FindAdd(lr[k].lang);
}
}
return ndx;
}
and in i18n.h:
Index<int> GetLngSet(String& module);
Best regards,
Martin
|
|
|
Re: New/additional GetLngSet [message #33455 is a reply to message #33451] |
Tue, 09 August 2011 09:52 |
|
Hi Martin,
I was using a similar function in past. Unfortunately, I don't have access to the code right now, so I can't post it. It is definitely handy to have an utility functions that tells you what languages are available, since the translations of U++ usually don't cover all the texts in ones app and vice versa.
I vote for inclusion of something like that, it would make my life easier too
Best regards,
Honza
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 23 23:25:06 CEST 2024
Total time taken to generate the page: 0.02018 seconds
|