[GTK][CMake] Translations must be built
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Dec 2013 18:51:26 +0000 (18:51 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Dec 2013 18:51:26 +0000 (18:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125513

Reviewed by Gustavo Noronha Silva.

.:

* Source/PlatformGTK.cmake: Add the po subdirectory.

Source/WebCore/platform/gtk/po:

* CMakeLists.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/PlatformGTK.cmake
Source/WebCore/platform/gtk/po/CMakeLists.txt [new file with mode: 0644]
Source/WebCore/platform/gtk/po/ChangeLog

index a9959e8..3da8df6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-12-29  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][CMake] Translations must be built
+        https://bugs.webkit.org/show_bug.cgi?id=125513
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * Source/PlatformGTK.cmake: Add the po subdirectory.
+
 2013-12-28  Giovanni Campagna  <gcampagna@src.gnome.org>
 
         [GTK] Fix release builds with NetworkProcess enabled
index faaac7c..3e3c182 100644 (file)
@@ -1,3 +1,5 @@
+add_subdirectory(${WEBCORE_DIR}/platform/gtk/po)
+
 if (ENABLE_API_TESTS)
     if (ENABLE_WEBKIT)
         add_subdirectory(${WEBKIT_DIR}/gtk/tests)
diff --git a/Source/WebCore/platform/gtk/po/CMakeLists.txt b/Source/WebCore/platform/gtk/po/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ae19111
--- /dev/null
@@ -0,0 +1,47 @@
+set(domain WebKitGTK-3.0)
+set(build_directory ${CMAKE_BINARY_DIR}/po)
+set(pot_file ${build_directory}/${domain}.pot)
+set(potfiles_file ${build_directory}/POTFILES)
+
+file(MAKE_DIRECTORY ${build_directory})
+configure_file(POTFILES.in ${potfiles_file})
+
+add_custom_command(
+    OUTPUT ${pot_file}
+    DEPENDS ${potfiles_file}
+    COMMAND xgettext
+            --default-domain=${domain}
+            --add-comments=TRANSLATORS:
+            --msgid-bugs-address="http://bugs.webkit.org"
+            --files-from=${potfiles_file}
+            --package-version=${PROJECT_VERSION}
+            --package-name="webkitgtk"
+            --keyword=_
+            --keyword=N_
+            -o ${pot_file}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..
+)
+
+file(GLOB po_files *.po)
+foreach (file ${po_files})
+    get_filename_component(language ${file} NAME_WE)
+    set(mo_file ${build_directory}/${language}.mo)
+    list(APPEND mo_files ${mo_file})
+
+    add_custom_command(
+        OUTPUT ${mo_file}
+        DEPENDS ${file}
+        DEPENDS ${pot_file}
+        COMMAND msgfmt -c -o ${mo_file} ${file}
+    )
+endforeach ()
+
+add_custom_target(update-mo-files ALL
+                  DEPENDS ${mo_files}
+)
+
+add_custom_target(update-po ALL
+                  DEPENDS update-mo-files
+                  DEPENDS ${pot_file}
+)
+
index ba92e46..2eeaebe 100644 (file)
@@ -1,3 +1,12 @@
+2013-12-29  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][CMake] Translations must be built
+        https://bugs.webkit.org/show_bug.cgi?id=125513
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt: Added.
+
 2013-11-26  Enrico Nicoletto  <liverig@gmail.com>
 
         Updated Brazilian Portuguese translation of WebKitGTK+ - November 02, 2013