diff --git a/AUTHORS b/AUTHORS index 6a9d2fd6c608b7b0984933af383868d458608008..26e4e78f59305d4894f7058c0be00f8438108a9d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,7 +14,12 @@ Alexandre Bourget <alexandre dot bourget at savoirfairelinux dot com> Guillaume Carmel-Archambault <guillaume.carmel-archambault at savoirfairelinux dot com> - Presence - Contacts - +Yun Liu <yun.liu at savoirfairelinux dot com> + - Change sip library to pjsip + - Support multiple accounts registration + - Add chinese translation + - Many portions of test and debugging + Polytechnic School of Montreal: - Jean-Francois Blanchard-Dionne <jean-francois.blanchard-dionne at polymtl dot ca> - Ala Eddine Limame <ala-eddine.limame at polymtl dot ca> diff --git a/ChangeLog b/ChangeLog index 10c8dc805a663badd5c4a866b891621791c6a543..e688e585483d8923112cc834e57d5a9fef3cad9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-30 Yun Liu + * Change sip library to pjsip + * Support multiple accounts registration + * Update translations (Add chinese translation) + * Many portions of code and debugging + 2008-03-18 Emmanuel Milou * GTK client diff --git a/po/Makefile.am b/po/Makefile.am index 87968cefc1faf67f11f817715a2f952121383676..c5e67123b756d1464b2a3e9097770cc757d6b805 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -5,12 +5,14 @@ DOMAIN=sflphone POFILES=\ fr.po \ es.po \ - de.po + de.po \ + zh_CN.po MOFILES=\ fr.mo \ es.mo \ - de.mo + de.mo \ + zh_CN.mo MSGFMT=msgfmt diff --git a/po/README b/po/README new file mode 100644 index 0000000000000000000000000000000000000000..e66f706d81dc9d70ee1c7b421c501b3e1b9715a8 --- /dev/null +++ b/po/README @@ -0,0 +1,17 @@ +If we need to update sflphone.pot file, do the following steps: + +>cd sflphone-gtk/src +>xgettext -k_ -o sflphone.pot *.c + +>msgmerge zh_CN.po sflphone.pot +>msgmerge fr.po sflphone.pot +>msgmerge es.po sflphone.pot +>msgmerge de.po sflphone.pot + +Modify all the new po files, and then + +>msgfmt -o zh_CN.mo zh_CN.po +>msgfmt -o fr.mo fr.po +>msgfmt -o es.mo es.po +>msgfmt -o de.mo de.po + diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..48e22d35743e6a10bb4d235f6c35b403dca5d930 --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,579 @@ +# Chinese translation of SFLphone. +# Copyright (C) 2008 The Free Software Foundation, Inc. +# This file is distributed under the GNU General Public License Version 3. +# +# Yun Liu <yun.liu@savoirfairelinux.com>, 2008. +# + +msgid "" +msgstr "" +"Project-Id-Version: SFLphone 0.9.2\n" +"Report-Msgid-Bugs-To: Yun Liu <yun.liu@savoirfairelinux.com >\n" +"PO-Revision-Date: 2008-10-28 14:15\n" +"Last-Translator: Yun Liu <yun.liu@savoirfairelinux.com>\n" +"Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" + +#: accountlist.c:158 +msgid "Registered" +msgstr "已注册" + +#: accountlist.c:161 +msgid "Not Registered" +msgstr "未注册" + +#: accountlist.c:164 +msgid "Trying..." +msgstr "正在连接..." + +#: accountlist.c:167 sflnotify.c:171 sflnotify.c:210 +msgid "Error" +msgstr "注册失败" + +#: accountlist.c:170 +msgid "Bad authentification" +msgstr "认证错误" + +#: accountlist.c:173 +msgid "Network unreachable" +msgstr "网络连接失败" + +#: accountlist.c:175 +msgid "Host unreachable" +msgstr "服务器连接失败" + +#: accountlist.c:178 +msgid "Invalid" +msgstr "无效" + +#: accountwindow.c:143 +msgid "Account settings" +msgstr "帐户设置" + +#: accountwindow.c:155 +msgid "Account parameters" +msgstr "帐户相关参数" + +#: accountwindow.c:177 +msgid "_Enabled" +msgstr "启用(E)" + +#: accountwindow.c:183 assistant.c:210 assistant.c:264 +msgid "_Alias" +msgstr "别名(A)" + +#: accountwindow.c:191 +msgid "_Protocol" +msgstr "协议(P)" + +#: accountwindow.c:209 +msgid "Unknown" +msgstr "未知" + +#: accountwindow.c:219 assistant.c:218 assistant.c:272 +msgid "_Host name" +msgstr "主机名(H)" + +#: accountwindow.c:227 assistant.c:226 assistant.c:280 +msgid "_User name" +msgstr "用户名(U)" + +#: accountwindow.c:238 assistant.c:236 assistant.c:290 +msgid "_Password" +msgstr "密码(P)" + +#: accountwindow.c:249 +msgid "_Voicemail box #" +msgstr "语音信箱(V)" + +#: accountwindow.c:260 assistant.c:313 +msgid "Network Address Translation" +msgstr "网络地址解析" + +#: accountwindow.c:271 assistant.c:322 +msgid "E_nable STUN" +msgstr "使用STUN(n)" + +#: accountwindow.c:275 +msgid "Enable it if you are behind a firewall, then restart SFLphone" +msgstr "当使用防火墙时,需设定STUN. 设置完毕后,请重新启动SFLphone" + +#: accountwindow.c:279 +msgid "_STUN Server" +msgstr "STUN服务器(S)" + +#: accountwindow.c:286 +msgid "Format: name.server:port" +msgstr "格式:name.server:port" + +#: actions.c:57 sflnotify.c:103 +#, c-format +msgid "%d voice mails" +msgstr "%d 个语音信息" + +#: actions.c:59 +#, c-format +msgid "%d voice mail" +msgstr "%d 个语音信息" + +#: actions.c:80 +#, c-format +msgid "%s account- %s" +msgstr "%s 帐户- %s" + +#: actions.c:214 +msgid "" +"Unable to connect to the SFLphone server.\n" +"Make sure the daemon is running." +msgstr "" +"连接SFLphone服务器失败.\n" +"请检查daemon是否还在运行." + +#: actions.c:741 +#, c-format +msgid "" +"<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> )" +msgstr "" +"<b>错误:无法找到codecs编码文件.\n" +"\n" +"</b> SFL声音codecs文件应位于<i>%s</i> 或 位于主目录( <i>%s</i> )的<b>.sflphone</b>目录下" + +#: assistant.c:138 +msgid "SFLphone account configuration wizard" +msgstr "SFLphone 帐户设置向导" + +#: assistant.c:165 +msgid "SFLphone 0.8" +msgstr "SFLphone 0.8" + +#: assistant.c:165 +msgid "Welcome to SFLphone!" +msgstr "欢迎使用SFLphone!" + +#: assistant.c:167 +msgid "This installation wizard will help you configure an account." +msgstr "安装向导将帮助您配置帐户" + +#: assistant.c:182 +msgid "VoIP Protocols" +msgstr "VoIP协议" + +#: assistant.c:182 +msgid "Select an account type:" +msgstr "选择帐户类型:" + +#: assistant.c:202 +msgid "SIP account configuration" +msgstr "SIP帐户配置" + +#: assistant.c:202 assistant.c:256 +msgid "Please fill the following information:" +msgstr "请填写以下信息:" + +#: assistant.c:256 +msgid "IAX2 account configuration" +msgstr "IAX2帐户配置" + +#: assistant.c:313 +msgid "You should probably enable this if you are behind a firewall." +msgstr "如果你的网络使用防火墙,你很有可能需要设定此项." + +#: assistant.c:329 +msgid "_STUN server" +msgstr "STUN服务器(S)" + +#: assistant.c:346 +msgid "Account Registration" +msgstr "帐户注册" + +#: assistant.c:346 +msgid "Congratulations!" +msgstr "恭喜!" + +#: assistant.c:348 +msgid "" +"This assistant is now finished.\n" +"\n" +" You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window." +msgstr "" +"配置完成.\n" +"\n" +"你可以随时在 选项/帐户 窗口中查看注册状态或者修改帐户参数" + +#: audioconf.c:150 +#, c-format +msgid "audio device index for output = %d\n" +msgstr "音频设备索引输出 = %d\n" + +#: audioconf.c:558 +msgid "Name" +msgstr "名称" + +#: audioconf.c:563 +msgid "Frequency" +msgstr "频率" + +#: audioconf.c:568 +msgid "Bitrate" +msgstr "比率" + +#: audioconf.c:573 +msgid "Bandwidth" +msgstr "带宽" + +#: audioconf.c:633 +msgid "Pulseaudio" +msgstr "Pulseaudio" + +#: audioconf.c:636 +msgid "ALSA" +msgstr "ALSA" + +#: audioconf.c:662 +msgid "ALSA plugin" +msgstr "ALSA插件" + +#: audioconf.c:684 +msgid "Output" +msgstr "输出" + +#: audioconf.c:706 +msgid "Input" +msgstr "输入" + +#: audioconf.c:739 +msgid "_Enable ringtones" +msgstr "启用铃声(E)" + +#: audioconf.c:744 +msgid "Choose a ringtone" +msgstr "选择铃声" + +#: audioconf.c:749 +msgid "Audio Files" +msgstr "音频文件" + +#: audioconf.c:774 +msgid "Sound Manager" +msgstr "音频管理器" + +#: audioconf.c:781 +msgid "ALSA configuration" +msgstr "ALSA 配置" + +#: audioconf.c:791 +msgid "Codecs" +msgstr "Codecs编码" + +#: audioconf.c:799 +msgid "Ringtones" +msgstr "铃声" + +#: calltree.c:208 +#, c-format +msgid "\"Voicemail\" <%s>" +msgstr "\"语音邮件\" <%s>" + +#: calltree.c:405 calltree.c:407 +msgid "Place a call" +msgstr "拨号" + +#: calltree.c:414 calltree.c:416 +msgid "Pick up" +msgstr "接电话" + +#: calltree.c:424 calltree.c:426 +msgid "Hang up" +msgstr "放电话" + +#: calltree.c:434 calltree.c:436 +msgid "Off Hold" +msgstr "恢复通话" + +#: calltree.c:445 calltree.c:447 +msgid "On Hold" +msgstr "待机" + +#: calltree.c:458 calltree.c:460 +msgid "Transfer" +msgstr "转接" + +#: calltree.c:470 calltree.c:472 +msgid "History" +msgstr "历史" + +#: calltree.c:480 calltree.c:484 +msgid "Voicemail" +msgstr "语音信箱" + +#: configwindow.c:371 +msgid "Protocol" +msgstr "协议" + +#: configwindow.c:378 +msgid "Status" +msgstr "状态" + +#: configwindow.c:470 +msgid "Desktop Notification" +msgstr "桌面提示" + +#: configwindow.c:478 +msgid "_Enable" +msgstr "启用(E)" + +#: configwindow.c:483 +msgid "_Notify voice mails" +msgstr "通知语音邮件(N)" + +#: configwindow.c:489 +msgid "System Tray Icon" +msgstr "系统托盘图标" + +#: configwindow.c:497 +msgid "_Popup main window on incoming call" +msgstr "来电时弹出主窗口(P)" + +#: configwindow.c:502 +msgid "Ne_ver popup main window" +msgstr "从不弹出主窗口(v)" + +#: configwindow.c:506 +msgid "_Start hidden" +msgstr "启动时隐藏(S)" + +#: configwindow.c:512 +msgid "Calls History" +msgstr "拨号历史" + +#: configwindow.c:520 +msgid "_Maximum number of calls" +msgstr "最大拨号数(M)" + +#: configwindow.c:536 +msgid "PulseAudio sound server" +msgstr "PulseAudio服务器" + +#: configwindow.c:544 +msgid "_Control running applications volume" +msgstr "控制正在运行的应用程序的音量(C)" + +#: configwindow.c:557 +msgid "SIP Port" +msgstr "SIP端口号" + +#: configwindow.c:566 +msgid "Apply" +msgstr "应用" + +#: configwindow.c:570 +msgid "Port:" +msgstr "端口:" + +#: configwindow.c:600 +msgid "Preferences" +msgstr "属性" + +#: configwindow.c:620 +msgid "General Settings" +msgstr "常用配置" + +#: configwindow.c:625 +msgid "Audio Settings" +msgstr "音频配置" + +#: configwindow.c:649 +msgid "Accounts" +msgstr "帐户" + +#: configwindow.c:661 +msgid "Accounts previously setup" +msgstr "以前帐户设置" + +#: errors.c:28 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening playback device" +msgstr "" +"<b>ALSA提示</b>\n" +"\n" +"打开回放设备时出错" + +#: errors.c:31 +msgid "" +"<b>ALSA notification</b>\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>ALSA提示</b>\n" +"\n" +"打开采集设备时出错" + +#: historyfilter.c:45 historyfilter.c:63 historyfilter.c:78 +msgid "Search" +msgstr "查找" + +#: mainwindow.c:69 +msgid "" +"<b>There is one call in progress.</b>\n" +"Do you still want to quit?" +msgstr "" +"<b>有一个电话正在处理</b>\n" +"确定要退出?" + +#: mainwindow.c:73 +msgid "" +"<b>There are calls in progress.</b>\n" +"Do you still want to quit?" +msgstr "" +"<b>有电话正在处理中</b>\n" +"确定要退出?" + +#: menus.c:129 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLphone是一个VoIP客户端,它兼容SIP和IAX2协议." + +#: menus.c:132 +msgid "About SFLphone" +msgstr "关于SFLphone" + +#: menus.c:155 +msgid "_Help" +msgstr "帮助(H)" + +#: menus.c:272 +msgid "_New call" +msgstr "新电话(N)" + +#: menus.c:284 menus.c:768 +msgid "_Pick up" +msgstr "拨出(P)" + +#: menus.c:294 menus.c:780 +msgid "_Hang up" +msgstr "放下(H)" + +#: menus.c:304 menus.c:792 +msgid "On _Hold" +msgstr "" + +#: menus.c:320 +msgid "_Account Assistant" +msgstr "帐户向导(A)" + +#: menus.c:350 +msgid "_Call" +msgstr "电话" + +#: menus.c:496 +msgid "History empty" +msgstr "无历史记录" + +#: menus.c:537 +msgid "_Clear history" +msgstr "清空历史记录(C)" + +#: menus.c:549 +msgid "_Accounts" +msgstr "帐户(A)" + +#: menus.c:564 +msgid "_Edit" +msgstr "编辑(E)" + +#: menus.c:624 +msgid "_Dialpad" +msgstr "拨号面板" + +#: menus.c:636 +msgid "_Volume controls" +msgstr "音量控制(V)" + +#: menus.c:645 +msgid "_Search history" +msgstr "查找历史(S)" + +#: menus.c:653 +msgid "_View" +msgstr "查看(V)" + +#: menus.c:875 +msgid "_Call back" +msgstr "回叫(C)" + +#: sflnotify.c:34 sflnotify.c:100 +#, c-format +msgid "%s account: %s" +msgstr "%s 帐户: %s" + +#: sflnotify.c:37 +#, c-format +msgid "<i>From:</i> %s" +msgstr "<i>拨入方:</i> %s" + +#: sflnotify.c:52 +msgid "Accept" +msgstr "接受" + +#: sflnotify.c:53 +msgid "Refuse" +msgstr "拒绝" + +#: sflnotify.c:54 sflnotify.c:117 sflnotify.c:154 +msgid "Ignore" +msgstr "忽略" + +#: sflnotify.c:136 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "使用%s帐户<i>%s</i>呼叫" + +#: sflnotify.c:140 +msgid "Current account" +msgstr "当前帐户" + +#: sflnotify.c:169 +msgid "You haven't setup any accounts" +msgstr "你没有设置任何帐户" + +#: sflnotify.c:185 sflnotify.c:224 +msgid "Setup Accounts" +msgstr "设定帐户" + +#: sflnotify.c:208 +msgid "You have no registered accounts" +msgstr "未发现已注册帐户" + +#: sliders.c:161 +msgid "Speakers volume" +msgstr "扬声器音量" + +#: sliders.c:163 +msgid "Mic volume" +msgstr "话筒音量" + +#: statusicon.c:91 +msgid "_Show main window" +msgstr "显示主窗口(S)" + +#: statusicon.c:124 +#, c-format +msgid "SFLphone - %i accounts registered" +msgstr "SFLphone - %i 个帐户已注册" + +#: timestamp.c:45 +msgid "<small>Missed call</small>" +msgstr "<small>未接电话</small>" + +#: timestamp.c:63 +#, c-format +msgid "<small>Duration:</small> %s" +msgstr "<small>时长:</small> %s" diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index cdb7c992786a47c0c8b31e57b3e113529d2fee16..fd0806894e0ae071364ad91fda7a811e1a1ee9d7 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -527,7 +527,7 @@ create_call_tree (calltab_t* tab) sw = gtk_scrolled_window_new( NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); - g_signal_connect (G_OBJECT ( sw ), "key-press-event",G_CALLBACK (on_key_released), NULL); + g_signal_connect (G_OBJECT ( sw ), "key-release-event",G_CALLBACK (on_key_released), NULL); tab->store = gtk_list_store_new (3, GDK_TYPE_PIXBUF,// Icon diff --git a/sflphone-gtk/src/dialpad.c b/sflphone-gtk/src/dialpad.c index 7c757aa1840eeb7f17cb876859ce06af4912f4bf..df2ab424fc86538a4be005eafdc4b20bdf0c89d0 100644 --- a/sflphone-gtk/src/dialpad.c +++ b/sflphone-gtk/src/dialpad.c @@ -26,6 +26,7 @@ static void dialpad_pressed (GtkWidget * widget UNUSED, gpointer data) { + gtk_widget_grab_focus(GTK_TREE_VIEW(current_calls->view)); sflphone_keypad(0, (gchar*) data); } diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index 586bd79e115f1b92bcc879ae840a77cf22f95e8d..bf9fbe93d0e6941edffa4ec8c9f19d14502502df 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -114,7 +114,8 @@ help_about ( void * foo UNUSED) "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", - "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>" + "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", + "Yun Liu <yun.liu@savoirfairelinux.com>" "Jean-Philippe Barrette-LaPierre", "Laurielle Lea", NULL}; diff --git a/src/main.cpp b/src/main.cpp index 22a6c5b93ed04e523a0b994daefc9470e764ed05..88c44d927aa2dbe78225a4c321e3ce0b2e777788 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,6 +23,8 @@ #include <cstring> #include <iostream> #include <string> +#include <dirent.h> +#include <sys/stat.h> //#include "config.h" #include "global.h" @@ -52,15 +54,27 @@ main (int argc, char **argv) { } else { FILE *fp; char homepid[128]; + char sfldir[128]; unsigned int iPid = getpid(); char cPid[64], cOldPid[64]; sprintf(cPid,"%d", iPid); sprintf(homepid, "%s/.%s/%s", HOMEDIR, PROGDIR, PIDFILE); + sprintf(sfldir, "%s/.%s", HOMEDIR, PROGDIR); if( (fp = fopen(homepid,"r")) == NULL ){ - //PID file doesn't exists, create and write pid in it + // Check if $HOME/.sflphone directory exists or not. + DIR *dir; + if ( (dir = opendir (sfldir)) == NULL) { + //Create it + if ( mkdir(sfldir, 0755) != 0){ + fprintf(stderr, "Creating directory %s failed. Exited.\n", sfldir ); + exit(-1); + } + } + + // PID file doesn't exists, create and write pid in it if( (fp = fopen(homepid,"w")) == NULL ){ fprintf(stderr, _("Creating PID file %s failed. Exited.\n"), homepid); exit(-1); @@ -69,7 +83,7 @@ main (int argc, char **argv) { fclose( fp ); } } else { - // PID file exists. Check the former process still alive or not. If alive, kill it and start a new one. + // PID file exists. Check the former process still alive or not. If alive, give user a hint. fgets( cOldPid, 64, fp ); fclose(fp); if (kill(atoi(cOldPid), 0) == SUCCESS) {