Permalink
Browse files

Support for translated desktop file and translations with intltool.

  • Loading branch information...
1 parent 0ec11ec commit 19dfd455478aba3d69e7b094390ca4104de463cf @dnohales committed Jan 24, 2012
View
@@ -40,25 +40,22 @@ add_definitions(-include config.h)
#
file (GLOB _datafiles "${CMAKE_CURRENT_SOURCE_DIR}/data/gablabel/*")
install (FILES ${_datafiles} DESTINATION "share/gablabel")
-install(FILES ${CMAKE_SOURCE_DIR}/data/gablabel.desktop DESTINATION "share/applications")
#
# i18n
#
find_package (Gettext REQUIRED)
-add_custom_command (OUTPUT ${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot
- COMMAND xgettext -c --files-from ${CMAKE_SOURCE_DIR}/po/potfiles --keyword=_ -o ${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot --no-wrap --no-location
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- )
-
-if (${GETTEXT_FOUND} STREQUAL "TRUE")
- set (HAVE_GETTEXT true)
- file (GLOB _translations ${CMAKE_SOURCE_DIR}/po/*.po)
- GETTEXT_CREATE_TRANSLATIONS (${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot
- ALL ${_translations})
-endif (${GETTEXT_FOUND} STREQUAL "TRUE")
+file (GLOB _translations ${CMAKE_SOURCE_DIR}/po/*.po)
+GETTEXT_CREATE_TRANSLATIONS (${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot ALL ${_translations})
+
+#
+# Install internationalized desktop file
+#
+install(CODE "execute_process(COMMAND intltool-merge -d po \"${CMAKE_SOURCE_DIR}/data/gablabel.desktop.in\" \"${CMAKE_BINARY_DIR}/gablabel.desktop\" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_QUIET)")
+install(CODE "message (STATUS \"Generating translated gablabel.desktop\")")
+install(FILES ${CMAKE_BINARY_DIR}/gablabel.desktop DESTINATION "share/applications")
#
@@ -1,12 +1,9 @@
-
[Desktop Entry]
-Name=Gablabel text translator
-Comment=Translate text into many languages
+_Name=Gablabel text translator
+_Comment=Translate text into many languages
Exec=gablabel
Terminal=false
Type=Application
Icon=gablabel
StartupNotify=true
Categories=GNOME;GTK;Utility;Languages;
-X-GNOME-Gettext-Domain=gablabel
-
@@ -18,7 +18,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">Traducir texto del portapapeles</property>
+ <property name="label" translatable="yes">Translate clipboard text</property>
<property name="use_underline">True</property>
</object>
</child>
@@ -27,7 +27,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
- <property name="label" translatable="yes">Traducir texto seleccionado</property>
+ <property name="label" translatable="yes">Translate selected text</property>
<property name="use_underline">True</property>
</object>
</child>
View
No changes.
View
@@ -1,2 +1,13 @@
-[encoding: UTF-8]
-src/gablabel.vala
+[encoding: UTF-8]
+src/Application.vala
+src/KeyBindingManager.vala
+src/MainWindow.vala
+src/PreferencesDialogManager.vala
+src/StatusIconManager.vala
+src/TranslatorWebView.vala
+
+[type: gettext/ini]data/gablabel.desktop.in
+
+[type: gettext/glade]data/gablabel/mainwindow.ui
+[type: gettext/glade]data/gablabel/preferencesdialog.ui
+[type: gettext/glade]data/gablabel/statusmenu.ui
View
@@ -1 +0,0 @@
-src/gablabel.c

0 comments on commit 19dfd45

Please sign in to comment.