aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodney Dawes <rodney.dawes@canonical.com>2017-02-10 17:08:40 +0000
committerBileto Bot <ci-train-bot@canonical.com>2017-02-10 17:08:40 +0000
commit7a9c9e064e2f26a863a4474d0ae5d83e3c5b27ff (patch)
treec1a970183a5bac453ea3455307f9250fe45b55af
parent421b1f5c4e3118f47507077ca3cb65923f64d436 (diff)
parent907fc24ba24962c0f30a9efe955dd5cb916c5492 (diff)
downloadayatana-indicator-display-7a9c9e064e2f26a863a4474d0ae5d83e3c5b27ff.tar.gz
ayatana-indicator-display-7a9c9e064e2f26a863a4474d0ae5d83e3c5b27ff.tar.bz2
ayatana-indicator-display-7a9c9e064e2f26a863a4474d0ae5d83e3c5b27ff.zip
Use intltool support from cmake-extras.
Approved by: Charles Kerr, Pete Woods, unity-api-1-bot
-rw-r--r--.bzrignore3
-rw-r--r--cmake/Translations.cmake37
-rw-r--r--po/CMakeLists.txt15
-rw-r--r--po/POTFILES.in2
-rw-r--r--po/indicator-display.pot43
5 files changed, 58 insertions, 42 deletions
diff --git a/.bzrignore b/.bzrignore
new file mode 100644
index 0000000..4f05230
--- /dev/null
+++ b/.bzrignore
@@ -0,0 +1,3 @@
+build/
+po/Makefile.in.in
+po/POTFILES.in
diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake
deleted file mode 100644
index b51c39d..0000000
--- a/cmake/Translations.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
-
-macro(add_translations_directory NLS_PACKAGE)
- add_custom_target (i18n ALL)
- find_program (MSGFMT_EXECUTABLE msgfmt)
- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
- foreach (PO_INPUT ${PO_FILES})
- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
-
- install (FILES ${MO_OUTPUT} DESTINATION
- ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
- RENAME ${NLS_PACKAGE}.mo)
- endforeach (PO_INPUT ${PO_FILES})
-endmacro(add_translations_directory)
-
-
-macro(add_translations_catalog NLS_PACKAGE)
- add_custom_target (pot COMMENT “Building translation catalog.”)
- find_program (XGETTEXT_EXECUTABLE xgettext)
-
- # init this list, which will hold all the sources across all dirs
- set(SOURCES "")
-
- # add each directory's sources to the overall sources list
- foreach(FILES_INPUT ${ARGN})
- set (DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
- file (GLOB_RECURSE DIR_SOURCES ${DIR}/*.c ${DIR}/*.cc ${DIR}/*.cpp ${DIR}/*.cxx ${DIR}/*.vala)
- set (SOURCES ${SOURCES} ${DIR_SOURCES})
- endforeach()
-
- add_custom_command (TARGET pot COMMAND
- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
- ${SOURCES} --keyword="_" --keyword="N_" --from-code=UTF-8
- )
-endmacro()
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 786573b..e78a9df 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -1,3 +1,12 @@
-include (Translations)
-add_translations_directory("${GETTEXT_PACKAGE}")
-add_translations_catalog("${GETTEXT_PACKAGE}" ../src/)
+find_package(Intltool REQUIRED)
+
+intltool_update_potfile(
+ KEYWORDS "_" "_:1,2" "N_" "N_:1,2"
+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
+ COPYRIGHT_HOLDER "Canonical Ltd."
+)
+
+intltool_install_translations(
+ ALL
+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
+)
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644
index 339765f..0000000
--- a/po/POTFILES.in
+++ /dev/null
@@ -1,2 +0,0 @@
-src/rotation-lock.cpp
-src/usb-snap.cpp
diff --git a/po/indicator-display.pot b/po/indicator-display.pot
new file mode 100644
index 0000000..26488a3
--- /dev/null
+++ b/po/indicator-display.pot
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Canonical Ltd.
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-07 13:08-0500\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"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/rotation-lock.cpp:125
+msgid "Rotation Lock"
+msgstr ""
+
+#: ../src/rotation-lock.cpp:136
+msgid "Rotation"
+msgstr ""
+
+#: ../src/usb-snap.cpp:107
+#, c-format
+msgid "The computer's RSA key fingerprint is: %s"
+msgstr ""
+
+#: ../src/usb-snap.cpp:112
+msgid "Allow"
+msgstr ""
+
+#: ../src/usb-snap.cpp:114
+msgid "Don't Allow"
+msgstr ""
+
+#: ../src/usb-snap.cpp:126
+msgid "Allow USB Debugging?"
+msgstr ""