From 99ddb86155eff1e7f5d90e63fd432cc6571317aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 7 Aug 2020 13:20:48 +0200 Subject: Allow extraction of strings for rotations in tderandr so that strings can be translated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This resolves issue #96. Signed-off-by: Slávek Banko --- CMakeL10n.txt | 12 +++++++++++- tderandr/libtderandr.h | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CMakeL10n.txt b/CMakeL10n.txt index 1606387a8..c7670275d 100644 --- a/CMakeL10n.txt +++ b/CMakeL10n.txt @@ -40,6 +40,14 @@ if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp ) endif( ) +##### prepare tderandr/libtderandr.h ############# + +# hide "#define" to allow strings to be extracted using xgettext +file( READ ${CMAKE_CURRENT_SOURCE_DIR}/tderandr/libtderandr.h _tderandr_h ) +string( REGEX REPLACE "\n(#define[^\n]*)(I18N_NOOP)" "\n/*\\1*/\\2" _tderandr_h ${_tderandr_h} ) +file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/tderandr/libtderandr.h.tde_l10n "${_tderandr_h}" ) + + ##### prepare tdeabc/addressee strings ########## # read file @@ -104,6 +112,7 @@ tde_l10n_create_template( "." "tdeabc/scripts/entrylist.tde_l10n" "tdecore/tde-config.cpp.cmake" + "tderandr/libtderandr.h.tde_l10n" "../dependencies/tqt3/src" "../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n" EXCLUDES @@ -121,8 +130,9 @@ tde_l10n_create_template( "^tdeio/" "^tdeioslave/" "^tdeprint/" - "^tdeui/colors/" + "^tderandr/libtderandr.h$" "^tdestyles/.*/config/" + "^tdeui/colors/" "/dependencies/tqt3/src/xml/qxml.cpp$" KEYWORDS tr tr:1,2 diff --git a/tderandr/libtderandr.h b/tderandr/libtderandr.h index 0e07ad96e..1bf38c0f5 100644 --- a/tderandr/libtderandr.h +++ b/tderandr/libtderandr.h @@ -35,10 +35,10 @@ #include #include -#define ROTATION_0_DEGREES_STRING "0 degrees" -#define ROTATION_90_DEGREES_STRING "90 degrees" -#define ROTATION_180_DEGREES_STRING "180 degrees" -#define ROTATION_270_DEGREES_STRING "270 degrees" +#define ROTATION_0_DEGREES_STRING I18N_NOOP("0 degrees") +#define ROTATION_90_DEGREES_STRING I18N_NOOP("90 degrees") +#define ROTATION_180_DEGREES_STRING I18N_NOOP("180 degrees") +#define ROTATION_270_DEGREES_STRING I18N_NOOP("270 degrees") /** * Simple API covering most of the uses of libtderandr. -- cgit v1.2.1