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 next 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
Re: New/additional GetLngSet [message #33455 is a reply to message #33451] Tue, 09 August 2011 09:52 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Wink

Best regards,
Honza
Re: New/additional GetLngSet [message #33457 is a reply to message #33455] Tue, 09 August 2011 11:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
dolik.rce wrote on 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 Wink

Best regards,
Honza

I agree.


Best regards
IƱaki
Re: New/additional GetLngSet [message #33595 is a reply to message #33457] Sun, 28 August 2011 19:17 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Patch applied, thanks.

Mirek
Previous Topic: A proposal: Adding a Translation & Localization GUI to TheIDE
Next Topic: TheIDE editor and accented words
Goto Forum:
  


Current Time: Fri Apr 19 16:38:32 CEST 2024

Total time taken to generate the page: 0.04999 seconds