| Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » New/additional GetLngSet Goto Forum:
	| 
		
			| 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
 |  
	|  |  | 
 
 Current Time: Thu Oct 30 16:47:07 CET 2025 
 Total time taken to generate the page: 0.03646 seconds |