Commit 811d7a4f authored by Jim Nelson's avatar Jim Nelson

Translation improvements: Closes #5911, Closes #5914

Better instructions for translates to receive credit in the About
dialog (#5911) and includes strings in the Preferences dialog in
the .pot file.  Also removes unneeded Translations.cmake file
(Gettext.cmake has all that we need) and fixes a problem in a late
release update for generating the POT file.
parent c9df4d46
......@@ -24,7 +24,8 @@ set(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}-${VERSION})
set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
set(ARCHIVE_DEBUILD_FULL_NAME ${CMAKE_PROJECT_NAME}_${VERSION}.orig.tar.xz)
set(GLADE_FILES ui/composer.glade ui/login.glade ui/message.glade ui/password-dialog.glade ui/toolbar.glade)
set(GLADE_FILES ui/composer.glade ui/login.glade ui/message.glade ui/password-dialog.glade
ui/preferences.glade ui/toolbar.glade)
option(DEBUG "Build for debugging." OFF)
option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
......
# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
macro(add_translations_directory NLS_PACKAGE)
add_custom_target (i18n ALL COMMENT “Building i18n messages.”)
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
share/locale/${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)
set(C_SOURCE "")
foreach(FILES_INPUT ${ARGN})
file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
foreach(C_FILE ${SOURCE_FILES})
set(C_SOURCE ${C_SOURCE} ${C_FILE})
endforeach()
file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala)
foreach(C_FILE ${SOURCE_FILES})
set(C_SOURCE ${C_SOURCE} ${C_FILE})
endforeach()
endforeach()
add_custom_command (TARGET pot COMMAND
${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8
)
endmacro()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -471,8 +471,8 @@ include(GSettings)
add_schemas(geary ${GSETTINGS_DIR})
IF (XGETTEXT_FOUND)
GETTEXT_CREATE_POT(${GETTEXT_PACKAGE}.pot OPTION ${XGETTEXT_OPTIONS} SRC ${CLIENT_SRC} ${ENGINE_SRC} ${COMMON_SRC} GLADE ${GLADE_FILES}
COMMENT "Creating POT.")
MESSAGE("Creating POT file")
GETTEXT_CREATE_POT(${GETTEXT_PACKAGE}.pot OPTION ${XGETTEXT_OPTIONS} SRC ${CLIENT_SRC} ${ENGINE_SRC} ${COMMON_SRC} GLADE ${GLADE_FILES})
ELSE ()
message(STATUS "xgettext not found")
ENDIF()
......
......@@ -777,7 +777,8 @@ public class GearyController {
"website", GearyApplication.WEBSITE,
"website-label", GearyApplication.WEBSITE_LABEL,
"title", _("About %s").printf(GearyApplication.NAME),
/// Translator credit for the About dialog
/// Translators: add your name and email address to receive credit in the About dialog
/// For example: Yamada Taro <yamada.taro@example.com>
"translator-credits", _("translator-credits")
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment