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

List:       kde-i18n-doc
Subject:    Re: Best way to mark placeholder strings in Designer files
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2006-08-13 16:50:30
Message-ID: 200608131850.31138.nicolasg () snafu ! de
[Download RAW message or body]

On Thursday 10 August 2006 12:11, mvillarino wrote:
> O Xoves, 10 de Agosto de 2006 10:02, Aurelien Gateau escribiu:
> > Do you mean I should edit the .ui file?
>
> At all.
> I don't remember exactly the words used in the designer, but I think that
> ther is a "Properties box", into which there are several lots of options
> (geometry, position, name, etc). I think that one of this is the "comment".
> Can't remember if it's called "comment" nor if it does appear on every
> widget. That comment translates to the xml tags previously mentioned. For
> instance (taken from some part of kmymoney):
> <widget class="QLabel" row="1" column="0">
>     <property name="name">
>          <cstring>TextLabel5</cstring>
>     </property>
>      <property name="text">
>          <string>From</string>
>         <comment>From (Date)</comment>
>      </property>
> </widget>
>
> When compiling the tool uic converts this to a .h file using the function
> tr2i18n() instead of i18n(), the sintax of tr2i18n is the same as the one
> of tr() used by Qt, that is: just the oposite to i18n():
> tr2i18n("string", "context") cfr. i18n("context","string")
> The definition of tr2i18n is (on debian, see /usr/include/kde/klocale.h):
> /**
>  * \relates KLocale
>  * Qt3's uic generates i18n( "msg", "comment" ) calls which conflict
>  * with our i18n method. We use uic -tr tr2i18n to redirect
>  * to the right i18n() function
> **/
> inline QString tr2i18n(const char* message, const char* =0) {
>  return i18n(message);
> }
> that is, the context info for translators goes directly to the trash bin.
>
> On the other hand, when building up the pot file, you already have not
> compiled the ui file. To extract strings from this, it is used by kde a
> perl script called "extractrc", which simply does not extract the
> <comment></comment> of the elements.
> So, if I'm not wrong (and not being a developer, it is
> very very possible), ui files context info not being usable is a feature of
> KDE.
> Nevertheless, the people from kmymoney have a modified version of extractrc
> that does the job.

The problem of extractrc is that it is supposed to extract RC, UI, KCFG and 
general XML files. 

I had planned to use more specific programs (or at least settings) for each 
kind in KDE4, however that is still part of future plans, where I have not 
any idea if I would have the time to implement. Sorry!

>
> --
> Best Regards
> MV

Have a nice day!

>
> Public key available at www.keyserver.net
> GPG Fingerprint: 8116 899E 61FD D983 AF80 FEDE 1CD8 1C9A 4B81 73AE
[prev in list] [next in list] [prev in thread] [next in thread] 

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