Commit 920f7a5c authored by Jim Nelson's avatar Jim Nelson

Generate .pot file: Closes #5462

./configure will autodetect xgettext, and if available, "make pot_file"
will generate the po/geary.pot.

This does *not* include intltool support, so the .pot file only
contains strings from the source files.
parent 2b09d67a
......@@ -35,6 +35,13 @@ if (DESKTOP_UPDATE)
message(STATUS "Desktop database will be updated")
endif ()
# intl
include(Gettext)
if (XGETTEXT_FOUND)
message(STATUS "xgettext found")
else ()
message(STATUS "xgettext not found")
endif ()
add_subdirectory(src)
add_subdirectory(icons)
......
......@@ -16,6 +16,11 @@ all:
install uninstall:
@$(MAKE) -C $(BUILD_DIR) $@
.PHONY: pot_file
pot_file:
@$(MAKE) -C $(BUILD_DIR) $@
@cp build/src/geary.pot po
.PHONY: clean
clean:
@-$(MAKE) -C $(BUILD_DIR) clean
......
# Gettext support: Create/Update pot file and
#
# To use: INCLUDE(Gettext)
#
# Most of the gettext support code is from FindGettext.cmake of cmake,
# but it is included here because:
#
# 1. Some system like RHEL5 does not have FindGettext.cmake
# 2. Bug of GETTEXT_CREATE_TRANSLATIONS make it unable to be include in 'All'
# 3. It does not support xgettext
#
#===================================================================
# Constants:
# XGETTEXT_OPTIONS_DEFAULT: Default xgettext option:
#===================================================================
# Variables:
# XGETTEXT_OPTIONS: Options pass to xgettext
# Default: XGETTEXT_OPTIONS_DEFAULT
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
# GETTEXT_FOUND: True if gettext has been found.
# XGETTEXT_EXECUTABLE: the full path to the xgettext.
# XGETTEXT_FOUND: True if xgettext has been found.
#
#===================================================================
# Macros:
# GETTEXT_CREATE_POT(potFile
# [OPTION xgettext_options]
# SRC list_of_source_file_that_contains_msgid
# )
#
# Generate .pot file.
# OPTION xgettext_options: Override XGETTEXT_OPTIONS
#
# * Produced targets: pot_file
#
#-------------------------------------------------------------------
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] locale1 ... localeN
# [COMMENT comment] )
#
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# ALL option is used, the translations will also be created when
# building the default target.
#
# * Produced targets: translations
#-------------------------------------------------------------------
FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
SET(XGETTEXT_OPTIONS_DEFAULT
--language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 -s
--escape --add-comments="/" --package-name=${PROJECT_NAME} --package-version=${VERSION})
IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
SET(GETTEXT_FOUND TRUE)
ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
SET(GETTEXT_FOUND FALSE)
IF (GetText_REQUIRED)
MESSAGE(FATAL_ERROR "GetText not found")
ENDIF (GetText_REQUIRED)
ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
IF(XGETTEXT_EXECUTABLE)
SET(XGETTEXT_FOUND TRUE)
ELSE(XGETTEXT_EXECUTABLE)
MESSAGE(STATUS "xgettext not found.")
SET(XGETTTEXT_FOUND FALSE)
ENDIF(XGETTEXT_EXECUTABLE)
IF(NOT DEFINED XGETTEXT_OPTIONS)
SET(XGETTEXT_OPTIONS ${XGETTEXT_OPTIONS_DEFAULT})
ENDIF(NOT DEFINED XGETTEXT_OPTIONS)
IF(XGETTEXT_FOUND)
MACRO(GETTEXT_CREATE_POT _potFile _pot_options )
SET(_xgettext_options_list)
SET(_src_list)
SET(_src_list_abs)
SET(_stage "SRC")
FOREACH(_pot_option ${_pot_options} ${ARGN})
IF(_pot_option STREQUAL "OPTION")
SET(_stage "OPTION")
ELSEIF(_pot_option STREQUAL "SRC")
SET(_stage "SRC")
ELSE(_pot_option STREQUAL "OPTION")
IF(_stage STREQUAL "OPTION")
SET(_xgettext_options_list ${_xgettext_options_list} ${_pot_option})
ELSE(_stage STREQUAL "OPTION")
FILE(RELATIVE_PATH _relFile ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_pot_option})
GET_FILENAME_COMPONENT(_absFile ${_pot_option} ABSOLUTE)
SET(_src_list ${_src_list} ${_relFile})
SET(_src_list_abs ${_src_list_abs} ${_absFile})
ENDIF(_stage STREQUAL "OPTION")
ENDIF(_pot_option STREQUAL "OPTION")
ENDFOREACH(_pot_option ${_pot_options} ${ARGN})
IF (_xgettext_options_list)
SET(_xgettext_options ${_xgettext_options_list})
ELSE(_xgettext_options_list)
SET(_xgettext_options ${XGETTEXT_OPTIONS})
ENDIF(_xgettext_options_list)
#MESSAGE("${XGETTEXT_EXECUTABLE} ${_xgettext_options_list} -o ${_potFile} ${_src_list}")
ADD_CUSTOM_COMMAND(OUTPUT pot_file
COMMAND ${XGETTEXT_EXECUTABLE} ${_xgettext_options} -o ${_potFile} ${_src_list}
DEPENDS ${_src_list_abs}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ADD_CUSTOM_TARGET(pot_file
COMMAND ${XGETTEXT_EXECUTABLE} ${_xgettext_options_list} -o ${_potFile} ${_src_list}
DEPENDS ${_src_list_abs}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Extract translatable messages to ${_potFile}"
)
ENDMACRO(GETTEXT_CREATE_POT _potFile _pot_options)
MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstLang)
SET(_gmoFiles)
GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
SET(_addToAll)
SET(_is_comment FALSE)
FOREACH (_currentLang ${_firstLang} ${ARGN})
IF(_currentLang STREQUAL "ALL")
SET(_addToAll "ALL")
ELSEIF(_currentLang STREQUAL "COMMENT")
SET(_is_comment TRUE)
ELSEIF(_is_comment)
SET(_is_comment FALSE)
SET(_comment ${_currentLang})
ELSE()
SET(_lang ${_currentLang})
GET_FILENAME_COMPONENT(_absFile ${_currentLang}.po ABSOLUTE)
GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
#MESSAGE("_absFile=${_absFile} _abs_PATH=${_abs_PATH} _lang=${_lang} curr_bin=${CMAKE_CURRENT_BINARY_DIR}")
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDIF()
ENDFOREACH (_currentLang )
IF(DEFINED _comment)
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles} COMMENT ${_comment})
ELSE(DEFINED _comment)
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles})
ENDIF(DEFINED _comment)
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
ENDIF(XGETTEXT_FOUND)
# po/geary.pot
# PO message string template file for Geary email client
# Copyright 2012 Yorba Foundation
# This file is distributed under the GNU LGPL, version 2.1.
# Jim Nelson <jim@yorba.org>
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: geary-0.1.0+trunk\n"
"Report-Msgid-Bugs-To: Jim Nelson <jim@yorba.org>\n"
"POT-Creation-Date: 2012-08-29 15:22-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#. / Verbose datetime format for 24-hour time, i.e. November 8, 2010 16:35
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:64
msgid "%B %-e, %Y %-H:%M"
msgstr ""
#. / Verbose datetime format for 12-hour time, i.e. November 8, 2010 8:42 am
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:60
msgid "%B %-e, %Y %-l:%M %P"
msgstr ""
#. / Verbose datetime format for the locale default (full month, day and time)
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:68
msgctxt "Default full date"
msgid "%B %-e, %Y %-l:%M %P"
msgstr ""
#. / Datetime format for 24-hour time, i.e. 16:35
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:36
msgid "%H:%M"
msgstr ""
#. / Format for the datetime that a message being replied to was received
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/engine/rfc822/rfc822-utils.vala:39
msgid "%a, %b %-e, %Y at %-l:%M %p"
msgstr ""
#. / Date format for dates within the current year, i.e. Nov 8
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:45
msgid "%b %-e"
msgstr ""
#: ../../src/client/notification/notification-bubble.vala:81
#, c-format
msgid "%d new message"
msgid_plural "%d new messages"
msgstr[0] ""
msgstr[1] ""
#. / Datetime format for 12-hour time, i.e. 8:31 am
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:32
msgid "%l:%M %P"
msgstr ""
#. / Datetime format for the locale default, i.e. 8:31 am or 16:35,
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:40
msgctxt "Default clock format"
msgid "%l:%M %P"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:44
#, c-format
msgid "%s wrote:"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:411
#, c-format
msgid "%u conversations selected."
msgstr ""
#. / Date format for dates within a different year, i.e. 02/04/10
#. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
#: ../../src/common/common-date.vala:50
#, no-c-format
msgid "%x"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:70
msgid "---------- Forwarded message ----------"
msgstr ""
#: ../../src/client/geary-controller.vala:914
#, c-format
msgid "A file named \"%s\" already exists. Do you want to replace it?"
msgstr ""
#: ../../src/client/geary-controller.vala:730
#, c-format
msgid "About %s"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:33
msgid "All Mail"
msgstr ""
#: ../../src/client/geary-controller.vala:65
msgid "Archive the selected conversation"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:498
msgid "Bcc:"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:494
msgid "Cc:"
msgstr ""
#: ../../src/client/ui/composer-window.vala:502
msgid "Choose a file"
msgstr ""
#: ../../src/client/notification/libindicate.vala:34
msgid "Compose Message"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:715
msgid "Copy _Email Address"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:709
msgid "Copy _Link"
msgstr ""
#: ../../src/client/geary-application.vala:17
msgid "Copyright 2011-2012 Yorba Foundation"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:505
msgid "Date:"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:74
#, c-format
msgid "Date: %s\n"
msgstr ""
#: ../../src/client/geary-application.vala:101
msgid "Display program version"
msgstr ""
#: ../../src/client/ui/composer-window.vala:478
msgid "Do you want to discard the unsaved message?"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:24
msgid "Drafts"
msgstr ""
#: ../../src/client/geary-application.vala:16
msgid "Email Client"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:1470
msgid "Failed to open default text editor."
msgstr ""
#: ../../src/client/geary-application.vala:114
#, c-format
msgid "Failed to parse command line options: %s\n"
msgstr ""
#: ../../src/client/ui/composer-window.vala:285
msgid "Fixed width"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:483
msgid "From:"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:72
#, c-format
msgid "From: %s\n"
msgstr ""
#: ../../src/common/common-files.vala:22
msgctxt "Abbreviation for gigabyte"
msgid "GB"
msgstr ""
#: ../../src/engine/api/geary-service-provider.vala:35
msgid "Gmail"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:21
msgid "Inbox"
msgstr ""
#: ../../src/common/common-files.vala:28
msgctxt "Abbreviation for kilobyte"
msgid "KB"
msgstr ""
#: ../../src/client/ui/main-toolbar.vala:29
msgid "Label as"
msgstr ""
#: ../../src/client/geary-controller.vala:301
msgid "Labels"
msgstr ""
#: ../../src/client/ui/composer-window.vala:299
msgid "Large"
msgstr ""
#: ../../src/client/geary-application.vala:96
msgid "Log IMAP replay queue"
msgstr ""
#: ../../src/client/geary-application.vala:94
msgid "Log conversation monitoring"
msgstr ""
#: ../../src/client/geary-application.vala:99
msgid "Log database queries (generates lots of messages)"
msgstr ""
#: ../../src/client/geary-application.vala:100
msgid "Log folder normalization"
msgstr ""
#: ../../src/client/geary-application.vala:95
msgid "Log network activity"
msgstr ""
#: ../../src/client/geary-application.vala:97
msgid "Log network serialization"
msgstr ""
#: ../../src/client/geary-application.vala:98
msgid "Log periodic activity"
msgstr ""
#: ../../src/common/common-files.vala:25
msgctxt "Abbreviation for megabyte"
msgid "MB"
msgstr ""
#: ../../src/client/ui/main-toolbar.vala:42
msgid "Mark"
msgstr ""
#: ../../src/client/geary-controller.vala:175
msgid "Mark as _read"
msgstr ""
#: ../../src/client/geary-controller.vala:180
msgid "Mark as _unread"
msgstr ""
#: ../../src/client/ui/message-list-cell-renderer.vala:77
msgid "Me"
msgstr ""
#: ../../src/client/ui/composer-window.vala:296
msgid "Medium"
msgstr ""
#: ../../src/client/ui/main-toolbar.vala:33
msgid "Move to"
msgstr ""
#: ../../src/client/ui/composer-window.vala:9
msgid "New Message"
msgstr ""
#: ../../src/client/notification/libindicate.vala:40
msgid "New Messages"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:409
msgid "No conversations selected."
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:46
msgid "None"
msgstr ""
#. / The datetime that a message being replied to was received
#: ../../src/engine/rfc822/rfc822-utils.vala:36
#, c-format
msgid "On %s, "
msgstr ""
#: ../../src/client/notification/notification-bubble.vala:41
msgid "Open"
msgstr ""
#: ../../src/engine/api/geary-service-provider.vala:41
msgid "Other"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:42
msgid "Outbox"
msgstr ""
#: ../../src/client/geary-application.vala:93
msgid "Output debugging information"
msgstr ""
#: ../../src/client/ui/password-dialog.vala:16
msgid "Please enter your email password"
msgstr ""
#: ../../src/client/geary-application.vala:122
msgid "Please report comments, suggestions and bugs to:"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:944
msgid "Reply to _All"
msgstr ""
#: ../../src/client/ui/composer-window.vala:278
msgid "Sans Serif"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:930
msgid "Save A_ttachment..."
msgid_plural "Save All A_ttachments..."
msgstr[0] ""
msgstr[1] ""
#: ../../src/client/ui/message-viewer.vala:911
msgid "Save All A_ttachments..."
msgstr ""
#: ../../src/client/ui/message-viewer.vala:727
msgid "Select _All"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:27
msgid "Sent Mail"
msgstr ""
#: ../../src/client/ui/composer-window.vala:281
msgid "Serif"
msgstr ""
#: ../../src/client/ui/composer-window.vala:293
msgid "Small"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:36
msgid "Spam"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:30
msgid "Starred"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:73
#, c-format
msgid "Subject %s\n"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:502
msgid "Subject:"
msgstr ""
#: ../../src/common/common-files.vala:19
msgctxt "Abbreviation for terabyte"
msgid "TB"
msgstr ""
#: ../../src/client/geary-controller.vala:916
#, c-format
msgid ""
"The file already exists in \"%s\". Replacing it will overwrite its contents."
msgstr ""
#: ../../src/client/ui/message-viewer.vala:97
msgid "This message contains images. Do you want to show them?"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:490
msgid "To:"
msgstr ""
#: ../../src/engine/rfc822/rfc822-utils.vala:75
#, c-format
msgid "To: %s\n"
msgstr ""
#: ../../src/engine/api/geary-special-folder-type.vala:39
msgid "Trash"
msgstr ""
#: ../../src/client/geary-controller.vala:190
msgid "U_nstar"
msgstr ""
#: ../../src/client/ui/password-dialog.vala:17
msgid "Unable to login to email server"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:722
msgid "View _Source"
msgstr ""
#: ../../src/client/geary-application.vala:19
msgid "Visit the Yorba web site"
msgstr ""
#: ../../src/engine/api/geary-service-provider.vala:38
msgid "Yahoo! Mail"
msgstr ""
#: ../../src/client/geary-controller.vala:161
msgid "_About"
msgstr ""
#: ../../src/client/geary-controller.vala:64
msgid "_Archive"
msgstr ""
#: ../../src/client/ui/composer-window.vala:567
msgid "_Attach a file"
msgstr ""
#: ../../src/client/ui/composer-window.vala:566
msgid "_Attach another file"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:90
msgid "_Cancel"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:702
msgid "_Copy"
msgstr ""
#: ../../src/client/geary-controller.vala:60
msgid "_Delete"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:949
msgid "_Forward"
msgstr ""
#: ../../src/client/geary-controller.vala:157
msgid "_Help"
msgstr ""
#: ../../src/client/geary-controller.vala:195
msgid "_Label"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:959
msgid "_Mark as Read"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:963
msgid "_Mark as Unread"
msgstr ""
#: ../../src/client/geary-controller.vala:170
msgid "_Mark as..."
msgstr ""
#: ../../src/client/geary-controller.vala:200
msgid "_Move"
msgstr ""
#: ../../src/client/geary-controller.vala:205
msgid "_New Message"
msgstr ""
#: ../../src/client/geary-controller.vala:153
msgid "_Preferences"
msgstr ""
#: ../../src/client/geary-controller.vala:165
msgid "_Quit"
msgstr ""
#: ../../src/client/geary-controller.vala:924
msgid "_Replace"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:939
msgid "_Reply"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:906
msgid "_Save As..."
msgstr ""
#: ../../src/client/ui/message-viewer.vala:90
msgid "_Show Images"
msgstr ""
#: ../../src/client/geary-controller.vala:185
msgid "_Star"
msgstr ""
#: ../../src/client/ui/message-viewer.vala:978
msgid "_View Source"
msgstr ""
#: ../../src/common/common-files.vala:16
msgid "bytes"
msgstr ""
#. / Placeholder filename for attachments with no filename.
#: ../../src/client/ui/message-viewer.vala:1370
#: ../../src/engine/imap-db/imap-db-folder.vala:1190
msgid "none"
msgstr ""
#. / Translator credit for the About dialog
#: ../../src/client/geary-controller.vala:732
msgid "translator-credits"
msgstr ""
......@@ -414,6 +414,14 @@ add_custom_command(
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})
GETTEXT_CREATE_TRANSLATIONS(${GETTEXT_PACKAGE}.pot ALL ${TRANSLATED}