Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
galious is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: A proposal: Adding a Translation & Localization GUI to TheIDE
Next Topic: TheIDE editor and accented words
Goto Forum:
  


Current Time: Sat Apr 20 08:28:39 CEST 2024

Total time taken to generate the page: 0.03793 seconds