[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    Re: [Kde-edu-devel] format of ktopo mapfiles
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2001-12-28 15:17:17
[Download RAW message or body]

Hello,

In KStars, we are addressing this problem by constructing a "dummy" class 
that contains all of the translatable strings found in the input data files.  
Specifically, the class contains a dummy function that is simply a list of 
QString declarations using i18n().  This function is never actually called by 
the program, but from what we have learned, the only way to guarantee 
that the translators see your strings is to include them in the source code.

So, for example, KTopo might have a KTopo_i18n class, with a function:

void KTopo_i18n::dummyFunction( void ) {
	QString s;
	s = i18n( "Paris" );
	s = i18n( "London" );
	s = i18n( "Berlin" );
	...
}

Then, just remember to wrap your references to the city name variable in 
i18n().  For example (I haven't looked at your code, I'm just guessing at 
class structure here):

QLabel *CityName = new QLabel;
CityName->setText( i18n( SelectedCity->name() ) );

This is very kludgy, but it does get the strings into the POT file.  Does 
anyone know a better way?

cheers,
Jason
 
-- 
KStars: A K Desktop Planetarium
http://kstars.sourceforge.net
_______________________________________________
kde-edu-devel mailing list
kde-edu-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-edu-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic