[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: i18n fix for tiling layout notification change
From: Chusslove Illich <caslav.ilic () gmx ! net>
Date: 2010-06-30 8:26:54
Message-ID: 201006301026.56872.caslav.ilic () gmx ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
The ADD_LAYOUT macro passes the layout name into i18n call by stringization.
This does not work because the layout name cannot be extracted as a
translatable message from ADD_LAYOUT calls. The attached patch adds
verbosity needed for proper extraction, with contexts same like in control
module are used.
I18N_NOOP2_NOSTRIP(x, y) expands into naked x, y, therefore ctxt_name as
parameter name in ADD_LAYOUT (instead of ctxtWithName or something) to
signify that these are actually two arguments.
(Not subscribed, please CC.)
--
Chusslove Illich (Часлав Илић)
["i18n-layout-change-01.diff" (text/x-patch)]
Index: tilinglayoutfactory.cpp
===================================================================
--- tilinglayoutfactory.cpp (revision 1143328)
+++ tilinglayoutfactory.cpp (working copy)
@@ -34,13 +34,13 @@
#include "tilinglayouts/floating/floating.h"
// w is the workspace pointer
-#define ADD_LAYOUT( lay ) \
+#define ADD_LAYOUT( lay, ctxt_name ) \
case lay##Layout:\
kDebug(1212) << #lay;\
layout = new lay( w );\
layout->setLayoutType( lay##Layout );\
- Notify::raise( Notify::TilingLayoutChanged, \
- i18n( "Layout changed to %1", i18n(#lay) ) ); \
+ Notify::raise( Notify::TilingLayoutChanged, \
+ i18n( "Layout changed to %1", i18nc( ctxt_name ) ) ); \
break
namespace KWin
@@ -58,9 +58,9 @@
layout = createLayout( indexToLayoutIndex( options->tilingLayout ), w );
break;
- ADD_LAYOUT( Spiral );
- ADD_LAYOUT( Columns );
- ADD_LAYOUT( Floating );
+ ADD_LAYOUT( Spiral, I18N_NOOP2_NOSTRIP( "Spiral tiling layout", "Spiral" ) \
); + ADD_LAYOUT( Columns, I18N_NOOP2_NOSTRIP( "Two-column horizontal tiling \
layout", "Columns" ) ); + ADD_LAYOUT( Floating, I18N_NOOP2_NOSTRIP( "Floating \
layout, windows aren't tiled at all", "Floating" ) );
default:
kDebug(1212) << "INVALID LAYOUT!";
["signature.asc" (application/pgp-signature)]
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic