Finalized proposal for i18n in KF5, second iteration

Andreas Hartmetz ahartmetz at gmail.com
Tue Apr 2 23:59:02 BST 2013


On Tuesday 02 April 2013 15:46:52 Chusslove Illich wrote:
> After considering comments from the previous iteration:
> 
>  
> http://mail.kde.org/pipermail/kde-frameworks-devel/2012-December/001358.htm
> l
> 
> here is the updated version:
> 
>   http://nedohodnik.net/misc/ki18n-kf5-02/html/prg_guide.html
>   http://nedohodnik.net/misc/ki18n-kf5-02/klocalizedstring.h
>   http://nedohodnik.net/misc/ki18n-kf5-02/kuitmarkup.h
> 
> and the diffs:
> 
>   http://nedohodnik.net/misc/ki18n-kf5-02/ki18n_doc-01-to-02.diff
>   http://nedohodnik.net/misc/ki18n-kf5-02/klocalizedstring-01-to-02.diff
> 
> The non-trivial changes and additions are these:
> 
> * New section "Connecting to Catalogs in Non-Code Files", that is in .ui,
>   .rc and .kcfg files.
> 
> * Macros I18N_NOOP2 and I18N_NOOP2_NOSTRIP are now deprecated, replaced with
> I18NC_NOOP.
> 
> * Renamed the TRANSLATION_CATALOG define to TRANSLATION_DOMAIN, to be more
>   in line with Gettext terminology.
> 
> * Reduced capitalization in markup-related identifiers from KUIT* to Kuit*,
>   similar to other acronym-containing identifiers in KDE.
> 
> One important questions is still open, namely whether the variable-argument
> macro expansion is supported for all target compilers. I understood that
> there is no C++03 standard for this, while in C99 and C++0x it is:
> 
>   #define i18n(...) i18nd(TRANSLATION_DOMAIN, __VA_ARGS__)

It's supported in GCC and reasonably recent MSVC, around 2004 IIRC. It is used 
in the kDebug() macro, if available. You can find the details in kdebug.h.
What else do we support: Solaris, embedded toolchains? Most embedded 
toolchains are based on GCC (Android, QNX/Blackberry) or Clang (iOS). While I 
haven't found something official about support in Clang, __VA_ARGS__ occurs over 
a hundred times in Clang's source code and Clang is self-hosting. So it seems 
to be supported.
That only leaves Solaris and possibly "exotic" embedded compilers where we 
don't know yet.




More information about the kde-core-devel mailing list