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

List:       kde-devel
Subject:    Re: i18n: translation of file content loaded at rumtime
From:       Aron =?iso-8859-1?q?Bostr=F6m?= <aron () linux ! se>
Date:       2005-09-23 13:48:27
Message-ID: 200509241550.30920 () aron
[Download RAW message or body]

Freda' 23. september 2005 01:42 skrew Gary Cramblitt:
> On Friday 23 September 2005 06:06 pm, Aron Boström wrote:
> > Hello, master programmers. A noob is asking here.
> >
> > I intend to use KAboutApplication dialogs to show information that is
> > dynamically parsed from some README files. However, I believe a polite
> > app should make an attempt at presenting a translated interface for
> > non-english users.
>
> AFAIK, README files are not translated.  Lauri Watts has done a substantial
> amount of work on man files for many/most of the KDE applications, and I
> believe these are translated.  The Handbooks are, of course, also
> translated. Perhaps there is a way to extract the Introduction alone from
> those.
>
> You can often contact lauri in IRC on freenode.net, channel #kde-docs.
>
> As for translating untranslated text dynamically..  that's another matter.

The README files are not READMEs from an entire app, but only for a small 
script that is plugged into the app. They mostly contain AUTHOR, LICENSE and 
"this script do that thing"-information. As of now, the README files are 
displayed in a fixed-width read-only KTextEdit (when one click an "about 
button" in a script manager dialog).

Freda' 23. september 2005 01:26 skrew Thiago Macieira:
> Aron Boström wrote:
> >I intend to use KAboutApplication dialogs to show information that is
> >dynamically parsed from some README files. However, I believe a polite
> > app should make an attempt at presenting a translated interface for
> > non-english users.
>
> Right, you need one file translated wholly for each target language. Do
> not try to translate sentences out of a file.

But, that would mean my parsing would break, as I (my code) cannot know what 
is an author, what is the license and what is the information of what the 
script do. Really, there is only a need to translate two or three sentences 
out of every file. ("This script do this and that...")

[...]

> >Now I wonder what the-right-way-to-do-it(tm) is. Should I look for
> > README.da, README.de or README.fr depending on the locale? (My gut
> > feeling tells me that is a _bad_ solution.) Or should I drop the README
> > files and demand that every third party switches to .desktop-files?
>
> If you include your whole text into a translated section of the program,
> inside an I18N_NOOP for instance, it'll be extracted into the .po file,
> which will be translated. Therefore, you can use i18n() on the contents
> to show a translated version.

But is it possible to do that, when the program itself has no clue what text 
to actually use? (It is loaded from an almost "random" README file at 
runtime.) 

To do such a thing, I think I'll have to do something like:
    QFile file(scripts[i].url.directory(false) + "README");
    if ( file.open(IO_ReadOnly)) 
    {
	QTextStream stream(&file);
    	I18N_NOOP(stream.read());
    }
Which I doubt would even compile.


Aron
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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