From 8cfdbab9191b00540ba7232101b082fa33808af7 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Date: Mon, 31 Mar 2008 14:52:03 -0400 Subject: [PATCH] Move translation directory (po) from sflphone-gtk/src to repository root --- configure.ac | 4 +--- sflphone-gtk/configure.ac | 1 - sflphone-gtk/src/Makefile.am | 2 -- sflphone-gtk/src/actions.c | 10 +++++----- sflphone-gtk/src/main.c | 1 - sflphone-gtk/src/mainwindow.c | 4 ++-- src/global.h | 13 +++++++++---- src/main.cpp | 2 ++ 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index eec523431b..5c339e79fc 100644 --- a/configure.ac +++ b/configure.ac @@ -47,9 +47,7 @@ AC_CONFIG_FILES([src/Makefile \ src/memmanager/Makefile \ src/mixer/Makefile]) -AC_CONFIG_FILES([skins/Makefile \ - skins/metal/Makefile \ - skins/gmetal/Makefile \ +AC_CONFIG_FILES([po/Makefile \ ringtones/Makefile]) AC_CONFIG_FILES([doc/Makefile \ diff --git a/sflphone-gtk/configure.ac b/sflphone-gtk/configure.ac index 652e17f56a..ea150b2d62 100644 --- a/sflphone-gtk/configure.ac +++ b/sflphone-gtk/configure.ac @@ -36,7 +36,6 @@ AC_SUBST(DEPS_LIBS) AC_OUTPUT([ Makefile src/Makefile -src/po/Makefile pixmaps/Makefile sflphone.desktop ]) diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index bcfa358ab9..eeaa1392ff 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -1,5 +1,3 @@ -SUBDIRS=po - bin_PROGRAMS = sflphone-gtk sflphone_gtk_SOURCES = \ diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index c1d5769289..ed95957e11 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -159,7 +159,7 @@ sflphone_init() codec_list_init(); if(!dbus_connect ()) { - main_window_error_message("Unable to connect to the SFLphone server.\nMake sure the daemon is running."); + main_window_error_message(_("Unable to connect to the SFLphone server.\nMake sure the daemon is running.")); return FALSE; } else @@ -541,7 +541,7 @@ sflphone_place_call ( call_t * c ) } else { - main_window_error_message("The account selected as default is not registered."); + main_window_error_message(_("The account selected as default is not registered.")); } } @@ -554,7 +554,7 @@ sflphone_place_call ( call_t * c ) } else { - main_window_error_message("There are no registered accounts to make this call with."); + main_window_error_message(_("There is no registered account to make this call with.")); } } @@ -575,7 +575,7 @@ sflphone_throw_exception( gchar* msg , int err ) gchar* markup = malloc(1000); switch( err ){ case ALSA_ERROR: - sprintf( markup , "<b>ALSA notification</b>\n\n"); + sprintf( markup , _("<b>ALSA notification</b>\n\n")); break; } sprintf( markup , "%s%s" , markup , msg ); @@ -629,7 +629,7 @@ sflphone_fill_codec_list() } if( codec_list_get_size() == 0) { gchar* markup = malloc(1000); - sprintf(markup , "<b>Error: No audio codecs found.\n\n</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</b> directory in your home( <i>%s</i> )", CODECS_DIR , g_get_home_dir()); + sprintf(markup , _("<b>Error: No audio codecs found.\n\n</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</b> directory in your home( <i>%s</i> )"), CODECS_DIR , g_get_home_dir()); main_window_error_message( markup ); g_free( markup ); dbus_unregister(getpid()); diff --git a/sflphone-gtk/src/main.c b/sflphone-gtk/src/main.c index 40c748c1c3..36ccc06367 100644 --- a/sflphone-gtk/src/main.c +++ b/sflphone-gtk/src/main.c @@ -41,7 +41,6 @@ There is NO WARRANTY, to the extent permitted by law.\n\n"); srand ( time(NULL) ); // Internationalization - g_print("%s\n",setlocale( LC_ALL , "" )); bindtextdomain( "sflphone" , "/usr/share/locale" ); textdomain( "sflphone" ); diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index b6c883982c..59cc66883a 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -176,7 +176,7 @@ create_main_window () GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_YES_NO, - "<b><big>Welcome to SFLphone!</big></b>\n\nThere are no VoIP accounts configured, would you like to edit the preferences now?"); + _("<b><big>Welcome to SFLphone!</big></b>\n\nThere is no VoIP account configured.\n Would you like to create one now?")); int response = gtk_dialog_run (GTK_DIALOG(dialog)); @@ -184,7 +184,7 @@ create_main_window () if (response == GTK_RESPONSE_YES) { - show_config_window(); + show_accounts_window(); } } diff --git a/src/global.h b/src/global.h index cd712ed55c..a4416190f6 100644 --- a/src/global.h +++ b/src/global.h @@ -1,5 +1,6 @@ /* - * Copyright (C) 2004-2006 Savoir-Faire Linux inc. + * Copyright (C) 2004-2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Yan Morin <yan.morin@savoirfairelinux.com> * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> * @@ -23,10 +24,14 @@ #include <assert.h> #include <stdio.h> +#include <libintl.h> +#include <locale.h> typedef float float32; typedef short int16; +#define _(string) gettext (string) + #ifdef DATAFORMAT_IS_FLOAT #define SFLDataFormat float32 #define SFLDataFormatString "Float32" @@ -57,8 +62,8 @@ typedef short int16; #define _debugAlsa(...) #endif -#define SFLPHONED_VERSION "0.7.2" -#define SFLPHONED_VERSIONNUM 0x000702 +#define SFLPHONED_VERSION "0.8.2" +#define SFLPHONED_VERSIONNUM 0x000802 #define PROGNAME "sflphoned" #define PROGNAME_GLOBAL "sflphone" @@ -66,7 +71,7 @@ typedef short int16; #define RINGDIR "ringtones" #define CODECDIR "codecs" -#define _(arg) arg +//#define _(arg) arg #define MONO 1 #define CHANNELS 2 #define SIZEBUF 1024*1024 diff --git a/src/main.cpp b/src/main.cpp index 0247fa23a7..08ee552142 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,6 +59,8 @@ main (int argc, char **argv) { } bool initOK = false; try { + bindtextdomain( "sflphone" , "/usr/share/locale" ); + textdomain( "sflphone" ); Manager::instance().initConfigFile(); Manager::instance().init(); initOK = true; -- GitLab