summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-10 19:33:14 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-10 19:33:14 +0100
commitfdd508d2999441099da89dddedd98bde036e82a7 (patch)
tree86fb18a93595105031db37257d4be97cd23bf7e4
parent5fc3ae36c8e07ed7157b04ce25b7339a119be471 (diff)
downloadkpicosim-fdd508d2999441099da89dddedd98bde036e82a7.tar.gz
kpicosim-fdd508d2999441099da89dddedd98bde036e82a7.zip
Add CMakeL10n rules.
Create translation template. Add CMake rules to build translations. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeL10n.txt23
-rw-r--r--CMakeLists.txt2
-rw-r--r--ConfigureChecks.cmake15
-rw-r--r--po/CMakeLists.txt1
-rw-r--r--po/kpicosim.pot39
-rw-r--r--src/CMakeL10n.txt3
6 files changed, 83 insertions, 0 deletions
diff --git a/CMakeL10n.txt b/CMakeL10n.txt
new file mode 100644
index 0000000..a525b71
--- /dev/null
+++ b/CMakeL10n.txt
@@ -0,0 +1,23 @@
+#################################################
+#
+# (C) 2018 Slávek Banko
+# slavek.banko (AT) axis.cz
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+##### include our cmake modules #################
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEL10n )
+
+
+##### create translation templates ##############
+
+tde_l10n_auto_add_subdirectories( )
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee3b515..5cb9866 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,7 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden"
option( BUILD_ALL "Build all" ON )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
##### configure checks
@@ -68,6 +69,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
add_subdirectory( src )
tde_conditional_add_subdirectory( BUILD_DOC doc )
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index fbc879f..f53c7a0 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -27,3 +27,18 @@ if( WITH_GCC_VISIBILITY )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif( WITH_GCC_VISIBILITY )
+
+
+##### gettext
+
+if( BUILD_TRANSLATIONS )
+ include( FindGettext )
+ if( GETTEXT_FOUND )
+ set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE}
+ CACHE FILEPATH "path to msgfmt executable" )
+ endif( GETTEXT_FOUND )
+
+ if( NOT MSGFMT_EXECUTABLE )
+ tde_message_fatal( "msgfmt is required but was not found on your system." )
+ endif( NOT MSGFMT_EXECUTABLE )
+endif( BUILD_TRANSLATIONS )
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 0000000..f5a2e1b
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1 @@
+tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )
diff --git a/po/kpicosim.pot b/po/kpicosim.pot
new file mode 100644
index 0000000..6e75912
--- /dev/null
+++ b/po/kpicosim.pot
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2018-12-10 19:19+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: _translatorinfo:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr ""
+
+#: _translatorinfo:2
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+msgstr ""
+
+#: main.cpp:29
+msgid "A TDE KPart Application"
+msgstr ""
+
+#: main.cpp:41
+msgid "KPicoSim"
+msgstr ""
+
+#: kpicosimui.rc:4
+#, no-c-format
+msgid "C&ustom"
+msgstr ""
diff --git a/src/CMakeL10n.txt b/src/CMakeL10n.txt
new file mode 100644
index 0000000..8115e48
--- /dev/null
+++ b/src/CMakeL10n.txt
@@ -0,0 +1,3 @@
+##### create translation templates ##############
+
+tde_l10n_create_template( "kpicosim" )