[latexila] Translations: use intltool-update instead of custom script



commit c24511bba7b74b0c1c14dcc28ac27d1dd19645a2
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Tue Jul 19 22:58:46 2011 +0200

    Translations: use intltool-update instead of custom script

 CMakeLists.txt      |    3 +-
 cmake/gettext.cmake |   25 +
 po/CMakeLists.txt   |    2 +
 po/POTFILES.in      |   41 ++
 po/latexila.pot     | 1911 ---------------------------------------------------
 update_pot.sh       |    7 -
 6 files changed, 69 insertions(+), 1920 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa994a1..86f3d09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,8 +15,6 @@ set (BUILD_VALA ON CACHE BOOL "Generate the C code from Vala files")
 set (GETTEXT_PACKAGE "latexila")
 set (LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale")
 find_package (Gettext REQUIRED)
-file (GLOB latexila_PO_FILES ${latexila_SOURCE_DIR}/po/*.po)
-gettext_create_translations (po/latexila.pot ALL ${latexila_PO_FILES})
 
 set (SCHEMA_DIR "${CMAKE_INSTALL_PREFIX}/share")
 set (ICONS_DIR "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor")
@@ -73,6 +71,7 @@ include ("${latexila_SOURCE_DIR}/cmake/itstool.cmake")
 add_subdirectory (data)
 add_subdirectory (help)
 add_subdirectory (man)
+add_subdirectory (po)
 add_subdirectory (src/ui)
 
 include_directories (vapi src/C ${latexila_BINARY_DIR}/src)
diff --git a/cmake/gettext.cmake b/cmake/gettext.cmake
new file mode 100644
index 0000000..69fdfa9
--- /dev/null
+++ b/cmake/gettext.cmake
@@ -0,0 +1,25 @@
+function (gettext po_dir package_name)
+	set (mo_files)
+
+	file (GLOB po_files ${po_dir}/*.po)
+	foreach (po_file ${po_files})
+		get_filename_component (lang ${po_file} NAME_WE)
+		set (mo_file ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+
+		add_custom_command (
+			OUTPUT ${mo_file}
+			COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo_file} ${po_file}
+			DEPENDS ${po_file}
+		)
+
+		install (
+			FILES ${mo_file}
+			DESTINATION share/locale/${lang}/LC_MESSAGES
+			RENAME ${package_name}.mo
+		)
+
+		set (mo_files ${mo_files} ${mo_file})
+	endforeach ()
+
+	add_custom_target (translations ALL DEPENDS ${mo_files})
+endfunction ()
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 0000000..53d103e
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,2 @@
+include ("${latexila_SOURCE_DIR}/cmake/gettext.cmake")
+gettext ("${latexila_SOURCE_DIR}/po" "latexila")
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..353c994
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,41 @@
+# List of source files containing translatable strings.
+# Please keep this file sorted alphabetically.
+[encoding: UTF-8]
+src/application.vala
+src/app_settings.vala
+src/build_tool_dialog.vala
+src/build_tool_runner.vala
+src/build_tools.vala
+src/build_view.vala
+src/clean_build_files.vala
+src/completion.vala
+src/custom_statusbar.vala
+src/dialogs.vala
+src/documents_panel.vala
+src/document_structure.vala
+src/document_tab.vala
+src/document.vala
+src/document_view.vala
+src/encodings.vala
+src/file_browser.vala
+src/latex_menu.vala
+src/latex_post_processor.vala
+src/main.vala
+src/main_window.vala
+src/menu_in_toolbar.vala
+src/most_used_symbols.vala
+src/post_processors.vala
+src/preferences_dialog.vala
+src/project_dialogs.vala
+src/projects.vala
+src/search.vala
+src/side_panel.vala
+src/structure_model.vala
+src/structure.vala
+src/symbols.vala
+src/tab_info_bar.vala
+src/templates.vala
+[type: gettext/glade]src/ui/build_tool.ui
+[type: gettext/glade]src/ui/preferences_dialog.ui
+[type: gettext/glade]src/ui/search_and_replace.ui
+src/utils.vala



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]