[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: i18n / I18N_NOOP
From: Stephan Kulow <coolo () kde ! org>
Date: 2001-02-28 21:58:54
[Download RAW message or body]
David Faure wrote:
>
> I'm looking for a way to make KWord style names translatable.
> They are currently read from the templates, where their name is obviously
> in English.
>
> My idea is to translate them after reading them from the template,
> using the I18N_NOOP solution - since the list of internal style names
> is well-defined. Styles added by the user will be saved under a name
> that the user chooses, so no problem there.
>
> The two issues are:
> * I need to have I18N_NOOP("Head 1") somewhere in KWord's code,
> but I actually never need to execute that code at any point.
> i18n( styleName ) is all that KWord needs to do.
> Is there a cleaner solution than this one ?
> #if 0
> I18N_NOOP("Head 1")
> ...
> #endif
Yes, create a source file in the messages target without the #if 0 hack
and with i18n instead of I18N_NOOP. We do that very often within KDE.
>
> * I'd prefer to add a context string, because "Standard" could be used
> somewhere else, etc. But although i18n( context, string ) exists,
> I18N_NOOP( context, string) doesn't. How does i18n(a,b) work ?
it calls KLocale::translate(a, b) ;-)
> xgettext automatically concats if it sees two arguments ?
Yes, the patched version does.
> So would it work to define I18N_NOOP_CONTEXT (or something shorter!)
Hmm, yes you should. I18N_NOOP2 should do :)
Greetings, Stephan
--
Teigwaren heissen Teigwaren, weil sie Teig waren * J. v. d. Lippe
MFCH
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic