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

List:       kde-commits
Subject:    [kdevplatform/5.0] plugins/welcomepage: i18n: make welcomepage plugin translatable
From:       Pino Toscano <pino () kde ! org>
Date:       2016-07-31 17:59:59
Message-ID: E1bTv1r-00035t-FA () code ! kde ! org
[Download RAW message or body]

Git commit 38d6cd17fd37c0504c6df2c048edf0ea024851b6 by Pino Toscano.
Committed on 31/07/2016 at 17:54.
Pushed by pino into branch '5.0'.

i18n: make welcomepage plugin translatable

- extract the messages from qml and cpp files to kdevwelcomepage.pot
- set TRANSLATION_DOMAIN for C++ sources, even if currently there are
  no i18n strings there
- set the translation domain for the declarative view

M  +1    -0    plugins/welcomepage/CMakeLists.txt
A  +3    -0    plugins/welcomepage/Messages.sh
M  +1    -0    plugins/welcomepage/welcomepageview.cpp

http://commits.kde.org/kdevplatform/38d6cd17fd37c0504c6df2c048edf0ea024851b6

diff --git a/plugins/welcomepage/CMakeLists.txt b/plugins/welcomepage/CMakeLists.txt
index caa4185..2b3083f 100644
--- a/plugins/welcomepage/CMakeLists.txt
+++ b/plugins/welcomepage/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_definitions(-DTRANSLATION_DOMAIN=\"kdevwelcomepage\")
 add_subdirectory(declarative)
 
 set(welcomepage_SRCS
diff --git a/plugins/welcomepage/Messages.sh b/plugins/welcomepage/Messages.sh
new file mode 100644
index 0000000..a5e1774
--- /dev/null
+++ b/plugins/welcomepage/Messages.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+$XGETTEXT `find . -name \*.qml -o -name \*.cpp` -o $podir/kdevwelcomepage.pot
+rm -f rc.cpp
diff --git a/plugins/welcomepage/welcomepageview.cpp b/plugins/welcomepage/welcomepageview.cpp
index 1948e46..79d0605 100644
--- a/plugins/welcomepage/welcomepageview.cpp
+++ b/plugins/welcomepage/welcomepageview.cpp
@@ -50,6 +50,7 @@ WelcomePageWidget::WelcomePageWidget(const QList<IProject*> & /*projects*/, QWid
     //setup kdeclarative library
     KDeclarative::KDeclarative kdeclarative;
     kdeclarative.setDeclarativeEngine(engine());
+    kdeclarative.setTranslationDomain("kdevwelcomepage");
     kdeclarative.setupBindings();
 
     setResizeMode(QQuickWidget::SizeRootObjectToView);
[prev in list] [next in list] [prev in thread] [next in thread] 

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