From 9bc83539d124f9645dc92e9e39001cb0192dae61 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 7 Apr 2017 11:09:47 +0200 Subject: Gettext support --- main/CMakeLists.txt | 11 +- main/data/add_conversation/add_contact_dialog.ui | 10 +- main/data/add_conversation/add_groupchat_dialog.ui | 12 +- .../conference_details_fragment.ui | 6 +- main/data/manage_accounts/add_account_dialog.ui | 6 +- main/data/manage_accounts/dialog.ui | 8 +- main/data/menu_app.ui | 6 +- main/data/settings_dialog.ui | 6 +- main/po/LINGUAS | 2 + main/po/POTFILES.in | 20 ++ main/po/de.po | 196 ++++++++++++++++++++ main/po/dino.pot | 205 +++++++++++++++++++++ main/po/en.po | 9 + main/src/main.vala | 10 +- main/src/ui/add_conversation/chat/dialog.vala | 6 +- .../conference/add_groupchat_dialog.vala | 4 +- .../src/ui/add_conversation/conference/dialog.vala | 8 +- main/src/ui/conversation_summary/message_item.vala | 2 +- main/src/ui/conversation_summary/view.vala | 4 +- .../src/ui/manage_accounts/add_account_dialog.vala | 2 +- main/src/ui/manage_accounts/dialog.vala | 18 +- main/src/ui/notifications.vala | 6 +- main/src/ui/occupant_menu/view.vala | 2 +- main/src/ui/unified_window.vala | 10 +- 24 files changed, 507 insertions(+), 62 deletions(-) create mode 100644 main/po/LINGUAS create mode 100644 main/po/POTFILES.in create mode 100644 main/po/de.po create mode 100644 main/po/dino.pot create mode 100644 main/po/en.po (limited to 'main') diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 66362fbe..bada486c 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,3 +1,8 @@ +set(GETTEXT_PACKAGE "dino") +find_package(Gettext) +include(${GETTEXT_USE_FILE}) +gettext_compile(${GETTEXT_PACKAGE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/po TARGET_NAME ${GETTEXT_PACKAGE}-translations) + find_packages(MAIN_PACKAGES REQUIRED Gee GLib>=2.38 @@ -106,9 +111,9 @@ GRESOURCES ${MAIN_GRESOURCES_XML} ) -add_definitions(${VALA_CFLAGS}) +add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\") add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET}) -add_dependencies(dino dino-vapi dino-gsettings-schema-compiled) +add_dependencies(dino dino-vapi dino-gsettings-schema-compiled ${GETTEXT_PACKAGE}-translations) target_link_libraries(dino libdino ${MAIN_PACKAGES}) if(WIN32) @@ -129,4 +134,4 @@ install(FILES data/icons/dino-tick-symbolic.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/scalable/status -) +) \ No newline at end of file diff --git a/main/data/add_conversation/add_contact_dialog.ui b/main/data/add_conversation/add_contact_dialog.ui index 533591f5..3e99b2cc 100644 --- a/main/data/add_conversation/add_contact_dialog.ui +++ b/main/data/add_conversation/add_contact_dialog.ui @@ -8,7 +8,7 @@ True - Cancel + Cancel True True @@ -20,7 +20,7 @@ True True - Add + Add False True