From ce24f7e8bee0d70bdebe4e979eaefdb56c1b3ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 13 Dec 2018 03:29:22 +0100 Subject: [PATCH] Add CMakeL10n rules. Create translation template. Add CMake rules to build translations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeL10n.txt | 23 +++++++++++++++++++ CMakeLists.txt | 2 ++ ConfigureChecks.cmake | 15 +++++++++++++ po/CMakeLists.txt | 6 +++++ po/tdeio-umountwrapper.pot | 46 ++++++++++++++++++++++++++++++++++++++ src/CMakeL10n.txt | 3 +++ 6 files changed, 95 insertions(+) create mode 100644 CMakeL10n.txt create mode 100644 po/CMakeLists.txt create mode 100644 po/tdeio-umountwrapper.pot create mode 100644 src/CMakeL10n.txt 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 6ce2680..d7b4f12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ##### user requested modules option( BUILD_ALL "Build all" ON ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) ##### configure checks @@ -65,6 +66,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) ##### directories tde_conditional_add_subdirectory( BUILD_ALL src ) +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..1007122 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,6 @@ +# build translations if some are already available + +file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po ) +if( _srcs ) + tde_create_translation( LANG auto OUTPUT_NAME tdeio_umountwrapper ) +endif( ) diff --git a/po/tdeio-umountwrapper.pot b/po/tdeio-umountwrapper.pot new file mode 100644 index 0000000..f221780 --- /dev/null +++ b/po/tdeio-umountwrapper.pot @@ -0,0 +1,46 @@ +# SOME DESCRIPTIVE TITLE. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2018-12-13 03:23+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \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:30 +msgid "Safely remove wrapper. Provides progress dialog." +msgstr "" + +#: main.cpp:36 +msgid "URL to Safely Remove" +msgstr "" + +#: main.cpp:42 +msgid "tdeio_umountwrapper" +msgstr "" + +#: main.cpp:54 +msgid "No URL specified!" +msgstr "" + +#: tdeio_umountwrapper.cpp:39 +msgid "Synchronising data to disk, please wait" +msgstr "" diff --git a/src/CMakeL10n.txt b/src/CMakeL10n.txt new file mode 100644 index 0000000..c9193d2 --- /dev/null +++ b/src/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeio-umountwrapper" )