Commit e88f6698 authored by Stepan Salenikovich's avatar Stepan Salenikovich

translations: add gettext support

This patch adds support for compiling and installing gettext
translation files and runtime gettext i18n support in the client
itself.

Issue: #78928
Change-Id: I763431c9f1b36d450d3c77ee32d3f8fb32b9a99c
parent c3c7f1e9
......@@ -45,6 +45,7 @@ PKG_CHECK_MODULES(CLUTTERGTK REQUIRED clutter-gtk-1.0)
PKG_CHECK_MODULES(ICONSYMBLIC REQUIRED gnome-icon-theme-symbolic)
PKG_CHECK_MODULES(EBOOK REQUIRED libebook-1.2>=3.10)
PKG_CHECK_MODULES(LIBNOTIFY libnotify>=0.7.6) #optional
FIND_PACKAGE(Gettext) #optional for translations
# include libs
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
......@@ -253,8 +254,30 @@ GLIB_COMPILE_RESOURCES( GLIB_RESOURCES_RING
# ENDIF()
# for translations
# FIND_PACKAGE ( Gettext REQUIRED )
# ADD_SUBDIRECTORY( po )
IF (GETTEXT_FOUND)
# get all translation files; they're expected to be named using the following convention:
# '<lang code>[_<country code].po'
# eg: fr_CA.po (the country code is optional)
FILE(GLOB PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)
# Install each of the translation files
FOREACH(PO_FILE IN LISTS PO_FILES)
# extract the language (and optional country code) from the filename
GET_FILENAME_COMPONENT(LANG ${PO_FILE} NAME_WE)
GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${PO_FILE})
SET(TRANSLATIONS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/locale/${LANG}/LC_MESSAGES)
# install to share/locale and rename each to ring-client-gnome.mo
INSTALL(
FILES ${PROJECT_BINARY_DIR}/${LANG}.gmo
DESTINATION ${TRANSLATIONS_INSTALL_DIR}
RENAME ${PROJECT_NAME}.mo
)
ENDFOREACH(PO_FILE)
ENDIF(GETTEXT_FOUND)
# install and compile glib gsettings schema
add_schema("cx.ring.RingGnome.gschema.xml" GSCHEMA_RING)
......
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
src/accountadvancedtab.cpp
src/accountaudiotab.cpp
src/accountgeneraltab.cpp
src/accountsecuritytab.cpp
src/accountvideotab.cpp
src/accountview.cpp
src/callsview.cpp
src/choosecontactview.cpp
src/contactpopover.cpp
src/contactsview.cpp
src/currentcallview.cpp
src/dialogs.c
src/editcontactview.cpp
src/frequentcontactsview.cpp
src/generalsettingsview.cpp
src/historyview.cpp
src/incomingcallview.cpp
src/mediasettingsview.cpp
src/ringmainwindow.cpp
src/ringnotify.cpp
src/ring_client_options.c
src/backends/edscontactbackend.cpp
src/utils/menus.cpp
ui/accountadvancedtab.ui
ui/accountaudiotab.ui
ui/accountgeneraltab.ui
ui/accountsecuritytab.ui
ui/accountvideotab.ui
ui/accountview.ui
ui/choosecontactview.ui
ui/currentcallview.ui
ui/editcontactview.ui
ui/generalsettingsview.ui
ui/incomingcallview.ui
ui/mediasettingsview.ui
ui/ringgearsmenu.ui
ui/ringmainwindow.ui
Translation guide:
The client uses gettext for translations, for a comprehensive guide see:
http://www.gnu.org/software/gettext/manual/gettext.htm
In order to generate the .pot (template) file with all the translation strings,
append all the filenames that require translation to POTFILES.in, then run the
following command:
xgettext -d ring-client-gnome -o ring-client-gnome.pot -k_ -D .. -f POTFILES.in
The translation files are expected to be located in the /po dir using the
following naming convention:
<language code>[_<country code>].po
for example: fr_CA.po, lt.po
The Ring project uses Transifex.com to facilitate the translation process. The
project page can be found here:
https://www.transifex.com/savoirfairelinux/ring
# Gettext PO translation template file for the GNOME client of the Ring project.
# Copyright (C) 2015 Savoir-faire Linux Inc.
# This file is distributed under the same license as the Ring package.
# Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>, 2015
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-10 17:56-0400\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"
#: ui/accountadvancedtab.ui:81
msgid "Registration expire timeout (seconds):"
msgstr ""
#: ui/accountadvancedtab.ui:103
msgid "Allow calls from unknown peers"
msgstr ""
#: ui/accountadvancedtab.ui:117
msgid "Allow calls from peers in your call history"
msgstr ""
#: ui/accountadvancedtab.ui:131
msgid "Allow calls from peers in your contacts list"
msgstr ""
#: ui/accountadvancedtab.ui:149
msgid "<b>Registration</b>"
msgstr ""
#: ui/accountadvancedtab.ui:176
msgid "Use random port"
msgstr ""
#: ui/accountadvancedtab.ui:197
msgid "Local port:"
msgstr ""
#: ui/accountadvancedtab.ui:223
msgid "<b>Network Interface</b>"
msgstr ""
#: ui/accountadvancedtab.ui:249
msgid "Same as local parameters"
msgstr ""
#: ui/accountadvancedtab.ui:264
msgid "Set published address and port:"
msgstr ""
#: ui/accountadvancedtab.ui:288
msgid "Address"
msgstr ""
#: ui/accountadvancedtab.ui:310
msgid "Port"
msgstr ""
#: ui/accountadvancedtab.ui:336
msgid "Use STUN"
msgstr ""
#: ui/accountadvancedtab.ui:359 ui/accountadvancedtab.ui:408
msgid "server URL"
msgstr ""
#: ui/accountadvancedtab.ui:385
msgid "Use TURN"
msgstr ""
#: ui/accountadvancedtab.ui:430
msgid "username"
msgstr ""
#: ui/accountadvancedtab.ui:451
msgid "password"
msgstr ""
#: ui/accountadvancedtab.ui:475
msgid "realm"
msgstr ""
#: ui/accountadvancedtab.ui:504
msgid "<b>Published Address</b>"
msgstr ""
#: ui/accountadvancedtab.ui:533
msgid ""
"These settings are only used during SDP session negotiation in case ICE is "
"not supported by the server or peer."
msgstr ""
#: ui/accountadvancedtab.ui:558 ui/accountadvancedtab.ui:632
msgid "Min"
msgstr ""
#: ui/accountadvancedtab.ui:581 ui/accountadvancedtab.ui:655
msgid "Max"
msgstr ""
#: ui/accountadvancedtab.ui:605
msgid "<b>Audio RTP Port Range</b>"
msgstr ""
#: ui/accountadvancedtab.ui:679
msgid "<b>Video RTP Port Range</b>"
msgstr ""
#: ui/accountadvancedtab.ui:695
msgid "<b>SDP Session Negotiation (ICE Fallback)</b>"
msgstr ""
#: ui/accountaudiotab.ui:59 ui/accountvideotab.ui:59
msgid "Up"
msgstr ""
#: ui/accountaudiotab.ui:66 ui/accountvideotab.ui:66
msgid "Down"
msgstr ""
#: ui/accountaudiotab.ui:77 ui/accountvideotab.ui:77
msgid "<b>Codecs</b>"
msgstr ""
#: ui/accountgeneraltab.ui:42
msgid "<b>Account</b>"
msgstr ""
#: ui/accountgeneraltab.ui:80
msgid "<b>Parameters</b>"
msgstr ""
#: ui/accountsecuritytab.ui:37
msgid "Encrypt media streams (SRTP)"
msgstr ""
#: ui/accountsecuritytab.ui:58
msgid "Key exchange protocol"
msgstr ""
#: ui/accountsecuritytab.ui:76
msgid "Fallback on RTP on encryption failure"
msgstr ""
#: ui/accountsecuritytab.ui:94
msgid "<b>Media Stream Encryption</b>"
msgstr ""
#: ui/accountsecuritytab.ui:121
msgid "Encrypt negotiation (TLS)"
msgstr ""
#: ui/accountsecuritytab.ui:146
msgid "CA certificate"
msgstr ""
#: ui/accountsecuritytab.ui:183
msgid "User certificate"
msgstr ""
#: ui/accountsecuritytab.ui:220
msgid "Private key"
msgstr ""
#: ui/accountsecuritytab.ui:243
msgid "Private key password"
msgstr ""
#: ui/accountsecuritytab.ui:290
msgid "TLS protocol method"
msgstr ""
#: ui/accountsecuritytab.ui:313
msgid "Outgoing TLS server name"
msgstr ""
#: ui/accountsecuritytab.ui:335
msgid "Negotiation timeout (seconds)"
msgstr ""
#: ui/accountsecuritytab.ui:369
msgid "Use default ciphers"
msgstr ""
#: ui/accountsecuritytab.ui:385
msgid "Use custom cipher list"
msgstr ""
#: ui/accountsecuritytab.ui:442
msgid "Verify incoming certificates (server side)"
msgstr ""
#: ui/accountsecuritytab.ui:457
msgid "Verify answer certificates (client side)"
msgstr ""
#: ui/accountsecuritytab.ui:472
msgid "Require a certificate for incoming TLS connections"
msgstr ""
#: ui/accountsecuritytab.ui:491
msgid "<b>Negotiation Encryption</b>"
msgstr ""
#: ui/accountvideotab.ui:90
msgid "Enable Video"
msgstr ""
#: ui/accountview.ui:59
msgid "<b>&#8722;</b>"
msgstr ""
#: ui/accountview.ui:83
msgid "<b>+</b>"
msgstr ""
#: ui/choosecontactview.ui:34
msgid "Create New"
msgstr ""
#: ui/currentcallview.ui:122
msgid "Send"
msgstr ""
#: ui/currentcallview.ui:210
msgid "End this call"
msgstr ""
#: ui/currentcallview.ui:214 ui/currentcallview.ui:408
msgid "End call"
msgstr ""
#: ui/currentcallview.ui:232
msgid "Toggle hold"
msgstr ""
#: ui/currentcallview.ui:236 ui/currentcallview.ui:258
#: ui/currentcallview.ui:399
msgid "Hold"
msgstr ""
#: ui/currentcallview.ui:254
msgid "Toggle mute audio"
msgstr ""
#: ui/currentcallview.ui:276
msgid "Toggle mute video"
msgstr ""
#: ui/currentcallview.ui:280 ui/currentcallview.ui:390
msgid "Mute video"
msgstr ""
#: ui/currentcallview.ui:299
msgid "Toggle record"
msgstr ""
#: ui/currentcallview.ui:302
msgid "Record"
msgstr ""
#: ui/currentcallview.ui:318
msgid "Toggle show chat"
msgstr ""
#: ui/currentcallview.ui:322 ui/currentcallview.ui:372
msgid "Chat"
msgstr ""
#: ui/currentcallview.ui:338
msgid "Adjust outgoing video quality (bit/s)"
msgstr ""
#: ui/currentcallview.ui:343 ui/currentcallview.ui:417
msgid "Video quality"
msgstr ""
#: ui/currentcallview.ui:381
msgid "Mute audio"
msgstr ""
#: ui/editcontactview.ui:12
msgid "Select addressbook"
msgstr ""
#: ui/editcontactview.ui:15
msgid "Addressbook"
msgstr ""
#: ui/editcontactview.ui:29
msgid "Name"
msgstr ""
#: ui/editcontactview.ui:32
msgid "Contact name"
msgstr ""
#: ui/editcontactview.ui:47
msgid "Select how this number will be categorized"
msgstr ""
#: ui/editcontactview.ui:50
msgid "Number category"
msgstr ""
#: ui/editcontactview.ui:66
msgid "Number or Ring ID to be added"
msgstr ""
#: ui/editcontactview.ui:72
msgid "Number or Ring ID"
msgstr ""
#: ui/editcontactview.ui:83
msgid "Save"
msgstr ""
#: ui/generalsettingsview.ui:32
msgid "<b>Ring Settings</b>"
msgstr ""
#: ui/generalsettingsview.ui:46
msgid "Start Ring on login"
msgstr ""
#: ui/generalsettingsview.ui:55
msgid "Hide Ring on close instead of quitting."
msgstr ""
#: ui/generalsettingsview.ui:64
msgid "Bring Ring to the foreground on incoming calls."
msgstr ""
#: ui/generalsettingsview.ui:87
msgid "<b>History Settings</b>"
msgstr ""
#: ui/generalsettingsview.ui:105
msgid "Keep history for (days):"
msgstr ""
#: ui/generalsettingsview.ui:128
msgid "(set to 0 for unlimited history)"
msgstr ""
#: ui/generalsettingsview.ui:137
msgid "Clear all history"
msgstr ""
#: ui/incomingcallview.ui:87
msgid "Incoming..."
msgstr ""
#: ui/incomingcallview.ui:120
msgid " Accept"
msgstr ""
#: ui/incomingcallview.ui:135
msgid " Reject"
msgstr ""
#: ui/incomingcallview.ui:150
msgid " Hang-up"
msgstr ""
#: ui/mediasettingsview.ui:36
msgid "Audio manager:"
msgstr ""
#: ui/mediasettingsview.ui:48
msgid "Ringtone device:"
msgstr ""
#: ui/mediasettingsview.ui:60
msgid "Output device:"
msgstr ""
#: ui/mediasettingsview.ui:72
msgid "Input device:"
msgstr ""
#: ui/mediasettingsview.ui:127
msgid "<b>Audio Settings</b>"
msgstr ""
#: ui/mediasettingsview.ui:163
msgid "Device:"
msgstr ""
#: ui/mediasettingsview.ui:175
msgid "Channel:"
msgstr ""
#: ui/mediasettingsview.ui:187
msgid "Resolution:"
msgstr ""
#: ui/mediasettingsview.ui:199
msgid "Frame rate:"
msgstr ""
#: ui/mediasettingsview.ui:258
msgid "<b>Camera Settings</b>"
msgstr ""
#: ui/ringgearsmenu.ui:13
msgid "_About"
msgstr ""
#: ui/ringgearsmenu.ui:19
msgid "_Quit"
msgstr ""
#: ui/ringmainwindow.ui:21
msgid "Menu"
msgstr ""
#: ui/ringmainwindow.ui:94
msgid "General"
msgstr ""
#: ui/ringmainwindow.ui:104
msgid "Media"
msgstr ""
#: ui/ringmainwindow.ui:115
msgid "Accounts"
msgstr ""
#: ui/ringmainwindow.ui:133
msgid "Settings"
msgstr ""
#: ui/ringmainwindow.ui:222
msgid "Contacts"
msgstr ""
#: ui/ringmainwindow.ui:232
msgid "History"
msgstr ""
#: ui/ringmainwindow.ui:320
msgid "Your Ring ID: "
msgstr ""
#: ui/ringmainwindow.ui:330
msgid "<span fgcolor=\"gray\">fetching Ring ID...</span>"
msgstr ""
#: ui/ringmainwindow.ui:375
msgid "Welcome to "
msgstr ""
#: ui/ringmainwindow.ui:392
msgid "Enter your alias to get started:"
msgstr ""
#: ui/ringmainwindow.ui:409
msgid "Generating your Ring account..."
msgstr ""
#: ui/ringmainwindow.ui:423
msgid "Next"
msgstr ""
#: ui/ringmainwindow.ui:445
msgid "Your Ring account has been created with the following Ring ID:"
msgstr ""
#: ui/ringmainwindow.ui:460
msgid "Share it with your friends so they can contact you via Ring!"
msgstr ""
#: ui/ringmainwindow.ui:465
msgid "Done"
msgstr ""
......@@ -10,3 +10,6 @@
#define RING_CLIENT_INSTALL "@CMAKE_INSTALL_PREFIX@"
#define RING_DATA_DIR "/share/gnome-ring"
#define PACKAGE_NAME "@PROJECT_NAME@"
#define LOCALEDIR "@CMAKE_INSTALL_PREFIX@/share/locale"
......@@ -29,11 +29,18 @@
*/
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include "config.h"
#include "ring_client.h"
int
main(int argc, char *argv[])
{
/* Internationalization; localization is done automatically by gtk during init */
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
RingClient *client = ring_client_new(argc, argv);
return g_application_run(G_APPLICATION(client), argc, argv);
}
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