Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, February 2007
Question on Linguist


Message 1 in thread

hai,

I have a text file that has translations for strings used in my application.

Now, I need to create a .ts file from this text file.

I do not want to copy and paste strings from the text file to Qt Linguist application instead is there any method to append the text and corresponding translations to the Qt Linguist application?

Please help me.

Regards
Deepa
DISCLAIMER

âThe information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you"

Message 2 in thread

If you use tr() functions in your application you need just put to 
application.pro file a line:
TRANSLATIONS = application_language_LANGUAGE.ts
where is language and LANGUAGE your translated language ( forexample: 
application_hu_HU.ts ), than write in console:
$ lupdate application.pro

run linguist, call your new ts file and make the translation. If you are 
ready than in console:

$ lrelease application_language_LANGUAGE.ts

Because this new qm file to use your application you must write in main 
program some command, forexample these:
    QString locale = QLocale::system().name();
    QTranslator translator;
    translator.load( "application_" + locale );
    app.installTranslator(&translator);

Find more infos: Internationalization with Qt

Bye,
dj

> hai,
>  
> I have a text file that has translations for strings used in my 
> application.
>  
> Now, I need to create a .ts file from this text file.
>  
> I do not want to copy and paste strings from the text file to Qt 
> Linguist application instead is there any method to append the text 
> and corresponding translations to the Qt Linguist application?
>  
> Please help me.
>  
> Regards
> Deepa
>  
>
>
> DISCLAIMER âThe information contained in this e-mail message and/or 
> attachments to it may contain confidential or privileged information. 
> If you are not the intended recipient, any dissemination, use, review, 
> distribution, printing or copying of the information contained in this 
> e-mail message and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, please notify us by 
> reply e-mail or telephone and immediately and permanently delete the 
> message and any attachments. Thank you" 
> ----------------------------------------------
>

--
 [ signature omitted ] 

Message 3 in thread

Hi Deepa,

as it is impossible to know how you aligned your strings and 
translations in your own txt file,
there is most probably no generic program out there to do this job.
But what you can do is create the .ts files from your source code using 
lupdate from the
linguist. This .ts file is an xml file containing a skeleton with all 
strings you wrapped with the
tr() makro.
Now you write a short program using your own old method where you 
created probably something
similar to a map out of your translations and enter the translations in 
the xml tree the .ts files.
Then save this xml. compile it with lrelease into the .qm files and 
proceed as described
in the linguist manual
http://doc.trolltech.com/4.2/linguist-manual.html

Good Luck,
Daniel

deepa schrieb:
> hai,
>  
> I have a text file that has translations for strings used in my 
> application.
>  
> Now, I need to create a .ts file from this text file.
>  
> I do not want to copy and paste strings from the text file to Qt 
> Linguist application instead is there any method to append the text 
> and corresponding translations to the Qt Linguist application?
>  
> Please help me.
>  
> Regards
> Deepa
>  
>
>
> DISCLAIMER âThe information contained in this e-mail message and/or 
> attachments to it may contain confidential or privileged information. 
> If you are not the intended recipient, any dissemination, use, review, 
> distribution, printing or copying of the information contained in this 
> e-mail message and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, please notify us by 
> reply e-mail or telephone and immediately and permanently delete the 
> message and any attachments. Thank you" 
> ----------------------------------------------
>


-- 
 [ signature omitted ] 

Message 4 in thread

Hi,

> I have a text file that has translations for strings used in my application.

How are these strings used? Are they actually inside a tr() function?

--
 [ signature omitted ]