From 860db2f6126e50dcc4aa5dad88be3bccbca188fb Mon Sep 17 00:00:00 2001 From: JFreegman Date: Thu, 2 Apr 2015 22:44:19 -0400 Subject: [PATCH 01/33] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07ec154..f8e3ddc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,8 +45,3 @@ script: notifications: email: false - irc: - channels: - - "chat.freenode.net#tox-dev" - on_success: always - on_failure: always From bbb639c5aa8a621dce5a280b14974529d1802142 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Fri, 3 Apr 2015 13:04:28 +0200 Subject: [PATCH 02/33] Makefile: add uninstall target --- cfg/targets/help.mk | 13 +++++++------ cfg/targets/uninstall.mk | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 cfg/targets/uninstall.mk diff --git a/cfg/targets/help.mk b/cfg/targets/help.mk index 7bca5bd..fba1c8f 100644 --- a/cfg/targets/help.mk +++ b/cfg/targets/help.mk @@ -1,12 +1,13 @@ # Help target help: @echo "-- Targets --" - @echo " all: Build toxic and documentation [DEFAULT]" - @echo " toxic: Build toxic" - @echo " doc: Build documentation" - @echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")" - @echo " clean: Remove built files" - @echo " help: This help" + @echo " all: Build toxic and documentation [DEFAULT]" + @echo " toxic: Build toxic" + @echo " doc: Build documentation" + @echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")" + @echo " uninstall: Remove toxic from PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")" + @echo " clean: Remove built files" + @echo " help: This help" @echo @echo "-- Variables --" @echo " DISABLE_X11: Set to \"1\" to force building without X11 support" diff --git a/cfg/targets/uninstall.mk b/cfg/targets/uninstall.mk new file mode 100644 index 0000000..bc60ef8 --- /dev/null +++ b/cfg/targets/uninstall.mk @@ -0,0 +1,24 @@ +# Uninstall target +uninstall: + @echo "Removing toxic executable" + @rm -f $(abspath $(DESTDIR)/$(BINDIR)/toxic) + + @echo "Removing desktop file" + @rm -f $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE)) + + @echo "Removing data files" + @for f in $(DATAFILES) ; do \ + rm -f $(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\ + done + @for f in $(SNDFILES) ; do \ + rm -f $(abspath $(DESTDIR)/$(DATADIR)/sounds/$$f) ;\ + done + + @echo "Removing man pages" + @for f in $(MANFILES) ; do \ + section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\ + file=$$section/$$f ;\ + rm -f $$file $$file.gz ;\ + done + +.PHONY: uninstall From f656d0a7223de1ff2b1327ec3158a162f72966d7 Mon Sep 17 00:00:00 2001 From: JFreegman Date: Sat, 4 Apr 2015 03:42:43 -0400 Subject: [PATCH 03/33] Update .travis.yml --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f8e3ddc..3da703b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,4 +44,9 @@ script: - make -j2 || make || exit 1 notifications: email: false - + + irc: + channels: + - "chat.freenode.net#tox-dev" + on_success: always + on_failure: always From 1a7eaeddba37082e69bbd21d84b26988e92dde2b Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sat, 4 Apr 2015 21:15:34 -0400 Subject: [PATCH 04/33] fix a few avatar bugs --- src/avatars.c | 23 +++++++++-------------- src/avatars.h | 2 ++ src/global_commands.c | 4 +++- src/help.c | 2 +- src/toxic.c | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/avatars.c b/src/avatars.c index fb7007d..8dfa302 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -27,6 +27,7 @@ #include "misc_tools.h" #include "file_transfers.h" #include "friendlist.h" +#include "avatars.h" extern FriendsList Friends; @@ -36,7 +37,6 @@ static struct Avatar { char path[PATH_MAX + 1]; size_t path_len; off_t size; - bool is_set; } Avatar; @@ -55,8 +55,7 @@ int avatar_send(Tox *m, uint32_t friendnum) TOX_ERR_FILE_SEND err; uint32_t filenum = tox_file_send(m, friendnum, TOX_FILE_KIND_AVATAR, (size_t) Avatar.size, NULL, (uint8_t *) Avatar.name, Avatar.name_len, &err); - - if (!Avatar.is_set) + if (Avatar.size == 0) return 0; if (err != TOX_ERR_FILE_SEND_OK) { @@ -74,14 +73,8 @@ int avatar_send(Tox *m, uint32_t friendnum) if (ft->file == NULL) return -1; - ft->file_size = Avatar.size; - - if (ft->file_size == 0) { - fclose(ft->file); - return -1; - } - memcpy(ft->file_name, Avatar.name, Avatar.name_len + 1); + ft->file_size = Avatar.size; ft->state = FILE_TRANSFER_PENDING; ft->filenum = filenum; ft->friendnum = friendnum; @@ -109,8 +102,6 @@ static void avatar_send_all(Tox *m) */ int avatar_set(Tox *m, const char *path, size_t path_len) { - avatar_clear(); - if (path_len == 0 || path_len >= sizeof(Avatar.path)) return -1; @@ -128,12 +119,16 @@ int avatar_set(Tox *m, const char *path, size_t path_len) fclose(fp); + off_t size = file_size(path); + + if (size == 0 || size > MAX_AVATAR_FILE_SIZE) + return -1; + get_file_name(Avatar.name, sizeof(Avatar.name), path); Avatar.name_len = strlen(Avatar.name); memcpy(Avatar.path, path, sizeof(Avatar.path)); Avatar.path_len = path_len; - Avatar.size = file_size(path); - Avatar.is_set = 1; + Avatar.size = size; avatar_send_all(m); diff --git a/src/avatars.h b/src/avatars.h index 4ef2c60..af3c4af 100644 --- a/src/avatars.h +++ b/src/avatars.h @@ -23,6 +23,8 @@ #ifndef AVATARS_H #define AVATARS_H +#define MAX_AVATAR_FILE_SIZE 65536 + /* Sends avatar to friendnum. * * Returns 0 on success. diff --git a/src/global_commands.c b/src/global_commands.c index 5d7c6b1..f5e6fd7 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -225,7 +225,9 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ get_file_name(filename, sizeof(filename), path); if (avatar_set(m, path, len) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set avatar."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, + "Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes.", + MAX_AVATAR_FILE_SIZE); return; } diff --git a/src/help.c b/src/help.c index f212deb..8989c11 100644 --- a/src/help.c +++ b/src/help.c @@ -144,7 +144,7 @@ static void help_draw_global(ToxWindow *self) wprintw(win, " /add : Add contact with optional message\n"); wprintw(win, " /accept : Accept friend request\n"); - wprintw(win, " /avatar : Set a personal avatar\n"); + wprintw(win, " /avatar : Set an avatar (leave path empty to unset)\n"); wprintw(win, " /decline : Decline friend request\n"); wprintw(win, " /requests : List pending friend requests\n"); wprintw(win, " /connect : Manually connect to a DHT node\n"); diff --git a/src/toxic.c b/src/toxic.c index 55f5a19..dd0ee09 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -123,8 +123,8 @@ void exit_toxic_success(Tox *m) { store_data(m, DATA_FILE); memset(&user_password, 0, sizeof(struct user_password)); - kill_all_windows(m); kill_all_file_transfers(m); + kill_all_windows(m); terminate_notify(); #ifdef AUDIO From 5a2c3412590b00551a78cf4a0f1669452b489a47 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Mon, 6 Apr 2015 11:44:02 +0200 Subject: [PATCH 05/33] Makefile: try to fix Tox/toxic#307 @henriqueleng please test it and report back if it works for you. --- cfg/targets/install.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cfg/targets/install.mk b/cfg/targets/install.mk index cdc0067..12050ff 100644 --- a/cfg/targets/install.mk +++ b/cfg/targets/install.mk @@ -13,7 +13,8 @@ install: $(BUILD_DIR)/toxic @for f in $(DATAFILES) ; do \ install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\ file=$(abspath $(DESTDIR)/$(DATADIR)/$$f) ;\ - sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ + sed -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file > temp_file && \ + mv temp_file $$file ;\ done @mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds @for f in $(SNDFILES) ; do \ @@ -30,8 +31,10 @@ install: $(BUILD_DIR)/toxic file=$$section/$$f ;\ mkdir -p $$section ;\ install -m 0644 $(DOC_DIR)/$$f $$file ;\ - sed -i'' -e 's:__VERSION__:'$(VERSION)':g' $$file ;\ - sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ + sed -e 's:__VERSION__:'$(VERSION)':g' $$file > temp_file && \ + mv temp_file $$file ;\ + sed -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file > temp_file && \ + mv temp_file $$file ;\ gzip -f -9 $$file ;\ done From 02e6d2db3c8cac0c3196223180c4fbd8f97a1c30 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Thu, 9 Apr 2015 02:14:23 -0400 Subject: [PATCH 06/33] fix possible segfault --- src/avatars.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/avatars.c b/src/avatars.c index 8dfa302..a17c3be 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -32,7 +32,7 @@ extern FriendsList Friends; static struct Avatar { - char name[MAX_STR_SIZE + 1]; + char name[TOX_MAX_FILENAME_LENGTH + 1]; size_t name_len; char path[PATH_MAX + 1]; size_t path_len; @@ -73,7 +73,7 @@ int avatar_send(Tox *m, uint32_t friendnum) if (ft->file == NULL) return -1; - memcpy(ft->file_name, Avatar.name, Avatar.name_len + 1); + snprintf(ft->file_name, sizeof(ft->file_name), "%s", Avatar.name); ft->file_size = Avatar.size; ft->state = FILE_TRANSFER_PENDING; ft->filenum = filenum; @@ -126,7 +126,7 @@ int avatar_set(Tox *m, const char *path, size_t path_len) get_file_name(Avatar.name, sizeof(Avatar.name), path); Avatar.name_len = strlen(Avatar.name); - memcpy(Avatar.path, path, sizeof(Avatar.path)); + snprintf(Avatar.path, sizeof(Avatar.path), "%s", path); Avatar.path_len = path_len; Avatar.size = size; From 0bc610e18dc22112d57c744db13c66e385cccf15 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Fri, 10 Apr 2015 00:16:01 -0400 Subject: [PATCH 07/33] null terminate status message --- src/prompt.c | 4 +++- src/term_mplex.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index 175f23b..8377125 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -298,7 +298,9 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) char statusmsg[TOX_MAX_STATUS_MESSAGE_LENGTH]; pthread_mutex_lock(&Winthread.lock); - tox_self_get_status_message(m, (uint8_t *) statusmsg); + size_t slen = tox_self_get_status_message_size(m); + tox_self_get_status_message (m, (uint8_t*) statusmsg); + statusmsg[slen] = '\0'; pthread_mutex_unlock(&Winthread.lock); snprintf(statusbar->statusmsg, sizeof(statusbar->statusmsg), "%s", statusmsg); diff --git a/src/term_mplex.c b/src/term_mplex.c index 0036b73..130e868 100644 --- a/src/term_mplex.c +++ b/src/term_mplex.c @@ -339,7 +339,9 @@ static void mplex_timer_handler (Tox *m) prev_status = current_status; new_status = TOX_USER_STATUS_AWAY; pthread_mutex_lock (&Winthread.lock); + size_t slen = tox_self_get_status_message_size(m); tox_self_get_status_message (m, (uint8_t*) prev_note); + prev_note[slen] = '\0'; pthread_mutex_unlock (&Winthread.lock); new_note = user_settings->mplex_away_note; } From 82e76a3b5b92a401547e40a1c5ac1ed520e953ea Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 13 Apr 2015 00:32:35 -0400 Subject: [PATCH 08/33] try to fall back to ipv4 if tox fails to init with ipv6 --- src/toxic.c | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index dd0ee09..ba52981 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -572,7 +572,7 @@ static void init_tox_options(struct Tox_Options *tox_opts) /* Returns a new Tox object on success. * If object fails to initialize the toxic process will terminate. */ -static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) +static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW *new_err) { Tox *m = NULL; @@ -596,8 +596,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) bool is_encrypted = tox_is_data_encrypted((uint8_t *) data); /* attempt to encrypt an already encrypted data file */ - if (arg_opts.encrypt_data && is_encrypted) + if (arg_opts.encrypt_data && is_encrypted) { + fclose(fp); exit_toxic_err("failed in load_toxic", FATALERR_ENCRYPT); + } if (arg_opts.unencrypt_data && is_encrypted) queue_init_message("Data file '%s' has been unencrypted", data_path); @@ -619,8 +621,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) pwlen = password_prompt(user_password.pass, sizeof(user_password.pass)); user_password.len = pwlen; - if (strcasecmp(user_password.pass, "q") == 0) + if (strcasecmp(user_password.pass, "q") == 0) { + fclose(fp); exit(0); + } if (pwlen < MIN_PASSWORD_LEN) { system("clear"); @@ -634,11 +638,12 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) (uint8_t *) plain, &pwerr); if (pwerr == TOX_ERR_DECRYPTION_OK) { - TOX_ERR_NEW err; - m = tox_new(tox_opts, (uint8_t *) plain, plain_len, &err); + m = tox_new(tox_opts, (uint8_t *) plain, plain_len, new_err); - if (err != TOX_ERR_NEW_OK) - exit_toxic_err("tox_new() failed", err); + if (*new_err != TOX_ERR_NEW_OK) { + fclose(fp); + return NULL; + } break; } else if (pwerr == TOX_ERR_DECRYPTION_FAILED) { @@ -646,15 +651,17 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) sleep(1); printf("Invalid password. Try again. "); } else { + fclose(fp); exit_toxic_err("tox_pass_decrypt() failed", pwerr); } } } else { /* data is not encrypted */ - TOX_ERR_NEW err; - m = tox_new(tox_opts, (uint8_t *) data, len, &err); + m = tox_new(tox_opts, (uint8_t *) data, len, new_err); - if (err != TOX_ERR_NEW_OK) - exit_toxic_err("tox_new() failed", err); + if (*new_err != TOX_ERR_NEW_OK) { + fclose(fp); + return NULL; + } } fclose(fp); @@ -662,11 +669,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts) if (file_exists(data_path)) exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); - TOX_ERR_NEW err; - m = tox_new(tox_opts, NULL, 0, &err); + m = tox_new(tox_opts, NULL, 0, new_err); - if (err != TOX_ERR_NEW_OK) - exit_toxic_err("tox_new() failed", err); + if (*new_err != TOX_ERR_NEW_OK) + return NULL; if (store_data(m, data_path) == -1) exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); @@ -680,10 +686,17 @@ static Tox *load_toxic(char *data_path) struct Tox_Options tox_opts; init_tox_options(&tox_opts); - Tox *m = load_tox(data_path, &tox_opts); + TOX_ERR_NEW new_err; + Tox *m = load_tox(data_path, &tox_opts, &new_err); - if (m == NULL) - exit_toxic_err("load_tox() failed", FATALERR_TOX_INIT); + if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { + queue_init_message("Falling back to ipv4"); + tox_opts.ipv6_enabled = false; + m = load_tox(data_path, &tox_opts, &new_err); + } + + if (m == NULL || new_err != TOX_ERR_NEW_OK) + exit_toxic_err("Tox network failed to initialize (tox_new failed with error %d)", new_err); init_tox_callbacks(m); load_friendlist(m); From 4d73f8b24164a452b8dd3dbf42ccca318f123ba0 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 13 Apr 2015 00:58:33 -0400 Subject: [PATCH 09/33] not clear which error message is given for ipv6 failure --- src/toxic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index ba52981..49edb52 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -689,13 +689,13 @@ static Tox *load_toxic(char *data_path) TOX_ERR_NEW new_err; Tox *m = load_tox(data_path, &tox_opts, &new_err); - if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { + if (new_err != TOX_ERR_NEW_OK && tox_opts.ipv6_enabled) { queue_init_message("Falling back to ipv4"); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); } - if (m == NULL || new_err != TOX_ERR_NEW_OK) + if (new_err != TOX_ERR_NEW_OK) exit_toxic_err("Tox network failed to initialize (tox_new failed with error %d)", new_err); init_tox_callbacks(m); From 414f58d89686a8d19299c5ae1e7f5daab1682699 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 14 Apr 2015 17:18:09 -0400 Subject: [PATCH 10/33] correctly handle tox_new errors --- src/toxic.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index 49edb52..258d69f 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -640,7 +640,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (pwerr == TOX_ERR_DECRYPTION_OK) { m = tox_new(tox_opts, (uint8_t *) plain, plain_len, new_err); - if (*new_err != TOX_ERR_NEW_OK) { + if (m == NULL) { fclose(fp); return NULL; } @@ -658,7 +658,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW } else { /* data is not encrypted */ m = tox_new(tox_opts, (uint8_t *) data, len, new_err); - if (*new_err != TOX_ERR_NEW_OK) { + if (m == NULL) { fclose(fp); return NULL; } @@ -671,7 +671,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW m = tox_new(tox_opts, NULL, 0, new_err); - if (*new_err != TOX_ERR_NEW_OK) + if (m == NULL) return NULL; if (store_data(m, data_path) == -1) @@ -689,14 +689,17 @@ static Tox *load_toxic(char *data_path) TOX_ERR_NEW new_err; Tox *m = load_tox(data_path, &tox_opts, &new_err); - if (new_err != TOX_ERR_NEW_OK && tox_opts.ipv6_enabled) { + if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { queue_init_message("Falling back to ipv4"); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); } + if (!m) + exit_toxic_err("tox_new returned fatal error %d", new_err); + if (new_err != TOX_ERR_NEW_OK) - exit_toxic_err("Tox network failed to initialize (tox_new failed with error %d)", new_err); + queue_init_message("tox_new returned non-fatal error %d", new_err); init_tox_callbacks(m); load_friendlist(m); From 231078b6b90c27533ce5f101c3460c2b3a7c2557 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 18 May 2015 19:52:22 -0400 Subject: [PATCH 11/33] default tox options on initialization --- src/toxic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/toxic.c b/src/toxic.c index 258d69f..38e8145 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -542,6 +542,8 @@ static void init_tox_callbacks(Tox *m) static void init_tox_options(struct Tox_Options *tox_opts) { + tox_options_default(tox_opts); + tox_opts->ipv6_enabled = !arg_opts.use_ipv4; tox_opts->udp_enabled = !arg_opts.force_tcp; tox_opts->proxy_type = arg_opts.proxy_type; @@ -696,7 +698,7 @@ static Tox *load_toxic(char *data_path) } if (!m) - exit_toxic_err("tox_new returned fatal error %d", new_err); + exit_toxic_err("tox_new returned fatal error", new_err); if (new_err != TOX_ERR_NEW_OK) queue_init_message("tox_new returned non-fatal error %d", new_err); From 36640224afbc97f9f87437145607378e8fe245f7 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sun, 24 May 2015 17:36:13 -0400 Subject: [PATCH 12/33] toxcore API changes to tox_new --- src/toxic.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index 38e8145..a2e2e55 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -640,7 +640,11 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW (uint8_t *) plain, &pwerr); if (pwerr == TOX_ERR_DECRYPTION_OK) { - m = tox_new(tox_opts, (uint8_t *) plain, plain_len, new_err); + tox_opts->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE; + tox_opts->savedata_data = (uint8_t *) plain; + tox_opts->savedata_length = plain_len; + + m = tox_new(tox_opts, new_err); if (m == NULL) { fclose(fp); @@ -658,7 +662,11 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW } } } else { /* data is not encrypted */ - m = tox_new(tox_opts, (uint8_t *) data, len, new_err); + tox_opts->savedata_type = TOX_SAVEDATA_TYPE_TOX_SAVE; + tox_opts->savedata_data = (uint8_t *) data; + tox_opts->savedata_length = len; + + m = tox_new(tox_opts, new_err); if (m == NULL) { fclose(fp); @@ -671,7 +679,9 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (file_exists(data_path)) exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); - m = tox_new(tox_opts, NULL, 0, new_err); + tox_opts->savedata_type = TOX_SAVEDATA_TYPE_NONE; + + m = tox_new(tox_opts, new_err); if (m == NULL) return NULL; From d0a7ca17d298e3c1da9b77ca8b0d88fd109dc65e Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sun, 24 May 2015 17:56:30 -0400 Subject: [PATCH 13/33] separate bootstrapping and adding TCP relays per toxcore API changes --- src/global_commands.c | 1 + src/toxic.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/global_commands.c b/src/global_commands.c index f5e6fd7..fc7e3b8 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -260,6 +260,7 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) TOX_ERR_BOOTSTRAP err; tox_bootstrap(m, ip, atoi(port), (uint8_t *) binary_string, &err); + tox_add_tcp_relay(m, ip, atoi(port), (uint8_t *) binary_string, &err); free(binary_string); switch (err) { diff --git a/src/toxic.c b/src/toxic.c index a2e2e55..9d14328 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -305,14 +305,34 @@ static int load_nodelist(const char *filename) return 0; } +/* Bootstraps and adds as TCP relay. + * Returns 0 if both actions are successful. + * Returns -1 otherwise. + */ int init_connection_helper(Tox *m, int line) { - return tox_bootstrap(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], NULL); + TOX_ERR_BOOTSTRAP err; + tox_bootstrap(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); + + if (err != TOX_ERR_BOOTSTRAP_OK) { + fprintf(stderr, "Failed to bootstrap %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + return -1; + } + + tox_add_tcp_relay(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); + + if (err != TOX_ERR_BOOTSTRAP_OK) { + fprintf(stderr, "Failed to add TCP relay %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + return -1; + } + + return 0; } /* Connects to a random DHT node listed in the DHTnodes file * * return codes: + * 0: success * 1: failed to open node file * 2: no line of sufficient length in node file * 3: failed to resolve name to IP @@ -324,8 +344,10 @@ static bool srvlist_loaded = false; int init_connection(Tox *m) { - if (toxNodes.lines > 0) /* already loaded nodelist */ - return init_connection_helper(m, rand() % toxNodes.lines) ? 0 : 3; + if (toxNodes.lines > 0) { /* already loaded nodelist */ + init_connection_helper(m, rand() % toxNodes.lines); + return 0; + } /* only once: * - load the nodelist @@ -348,7 +370,7 @@ int init_connection(Tox *m) int n = MIN(NUM_INIT_NODES, toxNodes.lines); for (i = 0; i < n; ++i) { - if (init_connection_helper(m, rand() % toxNodes.lines)) + if (init_connection_helper(m, rand() % toxNodes.lines) == 0) res = 0; } From 85d3c18ba696d94a1ee84d7472512528a887daca Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Mon, 25 May 2015 16:38:52 +0200 Subject: [PATCH 14/33] Add localization system (gettext) --- INSTALL.md | 53 +- cfg/checks/check_features.mk | 6 + cfg/global_vars.mk | 5 + cfg/systems/Darwin.mk | 6 + cfg/targets/help.mk | 1 + cfg/targets/install.mk | 11 + src/audio_call.c | 118 +-- src/autocomplete.c | 8 +- src/avatars.c | 10 +- src/chat.c | 101 +- src/chat_commands.c | 78 +- src/configdir.c | 8 +- src/dns.c | 52 +- src/execute.c | 12 +- src/friendlist.c | 60 +- src/global_commands.c | 112 ++- src/group_commands.c | 18 +- src/groupchat.c | 46 +- src/help.c | 143 ++- src/line_info.c | 10 +- src/log.c | 12 +- src/message_queue.c | 8 +- src/misc_tools.c | 10 +- src/prompt.c | 52 +- src/toxic.c | 176 ++-- src/toxic.h | 4 +- src/windows.c | 10 +- translations/en.mo | Bin 0 -> 28476 bytes translations/en.po | 1602 ++++++++++++++++++++++++++++++ translations/it.mo | Bin 0 -> 30657 bytes translations/it.po | 1602 ++++++++++++++++++++++++++++++ translations/tools/create_mo.sh | 19 + translations/tools/create_po.sh | 22 + translations/tools/update_po.sh | 19 + translations/tools/update_pot.sh | 4 + translations/toxic.pot | 1574 +++++++++++++++++++++++++++++ 36 files changed, 5535 insertions(+), 437 deletions(-) create mode 100644 translations/en.mo create mode 100644 translations/en.po create mode 100644 translations/it.mo create mode 100644 translations/it.po create mode 100755 translations/tools/create_mo.sh create mode 100755 translations/tools/create_po.sh create mode 100755 translations/tools/update_po.sh create mode 100755 translations/tools/update_pot.sh create mode 100644 translations/toxic.pot diff --git a/INSTALL.md b/INSTALL.md index 4e96a30..49fbb8b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -3,6 +3,10 @@ * [OS X Notes](#deps_osx) * [Compiling](#compiling) * [Documentation](#docs) +* [Translating](#langs) + * [Create new translation 1: PO file](#new_lang_1) + * [Create new translation 2: MO file](#new_lang_2) + * [Update existing translation](#upd_lang) * [Notes](#notes) * [Compilation variables](#comp_vars) * [Packaging](#packaging) @@ -20,20 +24,23 @@ | [OpenALUT](http://openal.org) | SOUND NOTIFICATIONS | libalut-dev | | [LibNotify](https://developer.gnome.org/libnotify) | DESKTOP NOTIFICATIONS | libnotify-dev | | [AsciiDoc](http://asciidoc.org/index.html) | DOCUMENTATION1 | asciidoc | -1: see [Documentation](#docs) +| [Gettext](https://www.gnu.org/software/gettext) | LOCALIZATION2 | gettext | +1: see [Documentation](#docs)
+2: see [Translating](#langs) #### OS X Notes Using [Homebrew](http://brew.sh): ``` -brew install openal-soft freealut libconfig +brew install openal-soft freealut libconfig gettext brew install https://raw.githubusercontent.com/Tox/homebrew-tox/master/Formula/libtoxcore.rb brew install https://raw.githubusercontent.com/Homebrew/homebrew-x11/master/libnotify.rb +brew link gettext ``` You can omit `libnotify` if you intend to build without desktop notifications enabled. - + ## Compiling ``` make PREFIX="/where/to/install" @@ -46,6 +53,45 @@ Run `make doc` in the build directory after editing the asciidoc files to regene **NOTE FOR DEVELOPERS**: asciidoc files and generated manpages will need to be commited together.
**NOTE FOR EVERYONE**: [asciidoc](http://asciidoc.org/index.html) (and this step) is only required for regenerating manpages when you modify them. +
+## Translating +Toxic uses gettext to localize some strings in various languages.
+These notes are for people who want help translating toxic in new languages (or improve an existing translation).
+The following example shows how to create/update german translation (de). + +
+#### Create new translation 1: PO file +To start a new translation, you can use the [provided script](translations/tools/create_po.sh): +``` +cd toxic-src/translations/tools +./create_po.sh +Insert locale to create (for example "en"): de +Created de.po. +``` +Now you can proceed to translate `toxic-src/translations/de.po`. + + +#### Create new translation 2: MO file +When you fully translated the PO file, you are ready to create the MO (Machine Object) file.
+Again you can use the [provided script](translations/tools/create_mo.sh) to achieve this: +``` +cd toxic-src/translations/tools +./create_mo.sh +Insert locale (for example "en"): de +``` + +
+#### Update existing translation +When the toxic sources are updated, you probably need to update your translation as well.
+To do so use the [provided script](translations/tools/update_po.sh) to update the PO file: +``` +cd toxic-src/translations/tools +./update_po.sh +Insert locale to update (for example "en"): de +..................................... done. +``` +Then you need to translate new/changed strings and after you fully updated the PO file, create the MO file as described [above](#new_lang_2). +
## Notes @@ -58,6 +104,7 @@ Run `make doc` in the build directory after editing the asciidoc files to regene * `DISABLE_AV=1` → build toxic without audio call support * `DISABLE_SOUND_NOTIFY=1` → build toxic without sound notifications support * `DISABLE_DESKTOP_NOTIFY=1` → build toxic without desktop notifications support + * `DISABLE_LOCALIZATION=1` → build toxic without localization support #### Packaging diff --git a/cfg/checks/check_features.mk b/cfg/checks/check_features.mk index 430d1af..d6bcc57 100644 --- a/cfg/checks/check_features.mk +++ b/cfg/checks/check_features.mk @@ -24,6 +24,12 @@ ifneq ($(DESK_NOTIFY), disabled) -include $(CHECKS_DIR)/desktop_notifications.mk endif +# Check if we want build localization support +LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) +ifneq ($(LOCALIZATION), enabled) + CFLAGS += -DNO_GETTEXT +endif + # Check if we can build Toxic CHECK_LIBS = $(shell pkg-config --exists $(LIBS) || echo -n "error") ifneq ($(CHECK_LIBS), error) diff --git a/cfg/global_vars.mk b/cfg/global_vars.mk index d5c7b57..5d4a14c 100644 --- a/cfg/global_vars.mk +++ b/cfg/global_vars.mk @@ -13,6 +13,7 @@ DOC_DIR = $(BASE_DIR)/doc SRC_DIR = $(BASE_DIR)/src SND_DIR = $(BASE_DIR)/sounds MISC_DIR = $(BASE_DIR)/misc +TRANSLATIONS_DIR = $(BASE_DIR)/translations # Project files MANFILES = toxic.1 toxic.conf.5 @@ -22,9 +23,13 @@ SNDFILES = ToxicContactOnline.wav ToxicContactOffline.wav ToxicError.wav SNDFILES += ToxicRecvMessage.wav ToxicOutgoingCall.wav ToxicIncomingCall.wav SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav +# Available languages (sorted alphabetically) +LANGS = en it + # Install directories PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic MANDIR = $(PREFIX)/share/man APPDIR = $(PREFIX)/share/applications +LOCALEDIR = ${PREFIX}/share/locale diff --git a/cfg/systems/Darwin.mk b/cfg/systems/Darwin.mk index f33a4be..b4c82ad 100644 --- a/cfg/systems/Darwin.mk +++ b/cfg/systems/Darwin.mk @@ -8,3 +8,9 @@ LIBS := $(filter-out ncursesw, $(LIBS)) # OS X ships a usable, recent version of ncurses, but calls it ncurses not ncursesw. LDFLAGS += -lncurses -lalut -ltoxav -ltoxcore -ltoxdns -lresolv -lconfig -ltoxencryptsave -g CFLAGS += -I/usr/local/opt/freealut/include/AL -I/usr/local/opt/glib/include/glib-2.0 -g + +# Check if we want build localization support +LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) +ifneq ($(LOCALIZATION), disabled) + LDFLAGS += -lintl +endif diff --git a/cfg/targets/help.mk b/cfg/targets/help.mk index fba1c8f..4946b00 100644 --- a/cfg/targets/help.mk +++ b/cfg/targets/help.mk @@ -14,6 +14,7 @@ help: @echo " DISABLE_AV: Set to \"1\" to force building without audio call support" @echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support" @echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support" + @echo " DISABLE_LOCALIZATION: Set to \"1\" to force building without localization support" @echo " USER_CFLAGS: Add custom flags to default CFLAGS" @echo " USER_LDFLAGS: Add custom flags to default LDFLAGS" @echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")" diff --git a/cfg/targets/install.mk b/cfg/targets/install.mk index 12050ff..3f9bf47 100644 --- a/cfg/targets/install.mk +++ b/cfg/targets/install.mk @@ -8,6 +8,17 @@ install: $(BUILD_DIR)/toxic @mkdir -p $(abspath $(DESTDIR)/$(APPDIR)) @install -m 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE)) + @if [ -z "$(DISABLE_LOCALIZATION)" -o "$(DISABLE_LOCALIZATION)" = "0" ]; then \ + echo "Installing translations" ; \ + for i in $(LANGS) ; do \ + if [ ! -e $(TRANSLATIONS_DIR)/$$i.mo ]; then \ + continue ; \ + fi ; \ + mkdir -p $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES) ; \ + install -m 0644 $(TRANSLATIONS_DIR)/$$i.mo $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES/toxic.mo) ; \ + done ; \ + fi + @echo "Installing data files" @mkdir -p $(abspath $(DESTDIR)/$(DATADIR)) @for f in $(DATAFILES) ; do \ diff --git a/src/audio_call.c b/src/audio_call.c index 54b865b..274b5bb 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -37,6 +37,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #include @@ -124,7 +130,7 @@ ToxAv *init_audio(ToxWindow *self, Tox *tox) } if ( init_devices(ASettins.av) == de_InternalError ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to init devices"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to init devices")); toxav_kill(ASettins.av); return ASettins.av = NULL; } @@ -167,7 +173,7 @@ void read_device_callback (const int16_t* captured, uint32_t size, void* data) uint8_t encoded_payload[RTP_PAYLOAD_SIZE]; int32_t payload_size = toxav_prepare_audio_frame(ASettins.av, call_index, encoded_payload, RTP_PAYLOAD_SIZE, captured, size); if ( payload_size <= 0 || toxav_send_audio(ASettins.av, call_index, encoded_payload, payload_size) < 0 ) { - /*fprintf(stderr, "Could not encode audio packet\n");*/ + /*fprintf(stderr, gettext("Could not encode audio packet\n"));*/ } } @@ -186,13 +192,13 @@ void write_device_callback(void *agent, int32_t call_index, const int16_t* PCM, int start_transmission(ToxWindow *self, Call *call) { if ( !self || !ASettins.av || self->call_idx == -1 ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); return -1; } /* Don't provide support for video */ if ( 0 != toxav_prepare_transmission(ASettins.av, self->call_idx, 0) ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); return -1; } @@ -208,16 +214,16 @@ int start_transmission(ToxWindow *self, Call *call) if ( open_primary_device(input, &call->in_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open input device!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open input device!")); if ( register_device_callback(self->call_idx, call->in_idx, read_device_callback, &self->call_idx, true) != de_None) /* Set VAD as true for all; TODO: Make it more dynamic */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to register input handler!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to register input handler!")); if ( open_primary_device(output, &call->out_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open output device!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open output device!")); call->has_output = 0; } @@ -275,7 +281,7 @@ void callback_recv_starting ( void* av, int32_t call_index, void* arg ) if (windows[i].onStarting != NULL && windows[i].call_idx == call_index) { windows[i].onStarting(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index])) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , "Error starting transmission!"); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , gettext("Error starting transmission!")); } return; } @@ -294,7 +300,7 @@ void callback_call_started ( void* av, int32_t call_index, void* arg ) if (windows[i].onStart != NULL && windows[i].call_idx == call_index) { windows[i].onStart(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index]) ) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, "Error starting transmission!"); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error starting transmission!")); return; } } @@ -348,30 +354,30 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } if (!self->stb->connection) { - error_str = "Friend is offline."; + error_str = gettext("Friend is offline."); goto on_error; } ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, &ASettins.cs, 30); if ( error != av_ErrorNone ) { - if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = "Already in a call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = gettext("Already in a call!"); + else error_str = gettext("Internal error!"); goto on_error; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Calling... idx: %d", self->call_idx); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Calling... idx: %d"), self->call_idx); return; on_error: @@ -383,21 +389,21 @@ void cmd_answer(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } ToxAvError error = toxav_answer(ASettins.av, self->call_idx, &ASettins.cs); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot answer in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot answer in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -414,21 +420,21 @@ void cmd_reject(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } - ToxAvError error = toxav_reject(ASettins.av, self->call_idx, "Why not?"); + ToxAvError error = toxav_reject(ASettins.av, self->call_idx, gettext("Why not?")); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot reject in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot reject in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -445,12 +451,12 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } @@ -458,19 +464,19 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (toxav_get_call_state(ASettins.av, self->call_idx) == av_CallInviting) { error = toxav_cancel(ASettins.av, self->call_idx, self->num, - "Only those who appreciate small things know the beauty that is life"); + gettext("Only those who appreciate small things know the beauty that is life")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); #endif - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); } else { error = toxav_hangup(ASettins.av, self->call_idx); } if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot hangup in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot hangup in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -485,8 +491,8 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else error_str = "Only one argument allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else error_str = gettext("Only one argument allowed!"); goto on_error; } @@ -500,7 +506,7 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -517,9 +523,9 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else if ( argc < 2 ) error_str = "Must have id!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else if ( argc < 2 ) error_str = gettext("Must have id!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -533,7 +539,7 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -542,12 +548,12 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } if ( set_primary_device(type, selection) == de_InvalidSelection ) { - error_str="Invalid selection!"; + error_str=gettext("Invalid selection!"); goto on_error; } @@ -561,9 +567,9 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else if ( argc < 2 ) error_str = "Must have id!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else if ( argc < 2 ) error_str = gettext("Must have id!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -577,7 +583,7 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -586,12 +592,12 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } if ( selection_valid(type, selection) == de_InvalidSelection ) { - error_str="Invalid selection!"; + error_str=gettext("Invalid selection!"); goto on_error; } @@ -634,8 +640,8 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -649,7 +655,7 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -680,8 +686,8 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Must have value!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Must have value!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -690,7 +696,7 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M float value = strtof(argv[1], &end); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } @@ -719,10 +725,10 @@ void stop_current_call(ToxWindow* self) toxav_hangup(ASettins.av, self->call_idx); break; case av_CallInviting: - toxav_cancel(ASettins.av, self->call_idx, 0, "Not interested anymore"); + toxav_cancel(ASettins.av, self->call_idx, 0, gettext("Not interested anymore")); break; case av_CallStarting: - toxav_reject(ASettins.av, self->call_idx, "Not interested"); + toxav_reject(ASettins.av, self->call_idx, gettext("Not interested")); break; default: break; diff --git a/src/autocomplete.c b/src/autocomplete.c index 8cf703c..c500a03 100644 --- a/src/autocomplete.c +++ b/src/autocomplete.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #include @@ -117,7 +123,7 @@ int complete_line(ToxWindow *self, const void *list, int n_items, int size) char *sub = malloc(strlen(ubuf) + 1); if (sub == NULL) - exit_toxic_err("failed in complete_line", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in complete_line"), FATALERR_MEMORY); if (!s && !dir_search) { strcpy(sub, tmp); diff --git a/src/avatars.c b/src/avatars.c index a17c3be..d9c621a 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "misc_tools.h" #include "file_transfers.h" #include "friendlist.h" @@ -59,7 +65,7 @@ int avatar_send(Tox *m, uint32_t friendnum) return 0; if (err != TOX_ERR_FILE_SEND_OK) { - fprintf(stderr, "tox_file_send failed for friendnumber %d (error %d)\n", friendnum, err); + fprintf(stderr, gettext("tox_file_send failed for friendnumber %d (error %d)\n"), friendnum, err); return -1; } @@ -203,7 +209,7 @@ void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, "tox_file_send_chunk failed in avatar callback (error %d)\n", err); + fprintf(stderr, gettext("tox_file_send_chunk failed in avatar callback (error %d)\n"), err); ft->position += send_length; } diff --git a/src/chat.c b/src/chat.c index 9eaed52..6dafd9e 100644 --- a/src/chat.c +++ b/src/chat.c @@ -31,6 +31,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "execute.h" @@ -47,6 +53,9 @@ #include "notify.h" #include "message_queue.h" +#define YES_STR gettext("yes") +#define NO_STR gettext("no") + #ifdef AUDIO #include "audio_call.h" #endif /* AUDIO */ @@ -211,7 +220,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C ? tox_friend_get_typing(m, num, NULL) : false; chat_resume_file_transfers(m, num); - msg = "has come online"; + msg = gettext("has come online"); line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); } else if (connection_status == TOX_CONNECTION_NONE) { @@ -222,7 +231,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C chat_stop_file_senders(m, num); - msg = "has gone offline"; + msg = gettext("has gone offline"); line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); } @@ -307,21 +316,21 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), "File '%s' successfully sent.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File '%s' successfully sent."), ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Null file pointer.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Null file pointer."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (ft->position != position) { if (fseek(ft->file, position, SEEK_SET) == -1) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Seek fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Seek fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -333,7 +342,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, size_t send_length = fread(send_data, 1, sizeof(send_data), ft->file); if (send_length != length) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Read fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Read fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -342,7 +351,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, "tox_file_send_chunk failed in chat callback (error %d)\n", err); + fprintf(stderr, gettext("tox_file_send_chunk failed in chat callback (error %d)\n"), err); ft->position += send_length; ft->bps += send_length; @@ -365,20 +374,20 @@ static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, ui char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), "File '%s' successfully received.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File '%s' successfully received."), ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Invalid file pointer.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Invalid file pointer."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (fwrite(data, length, 1, ft->file) != 1) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Write fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Write fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -404,7 +413,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint /* transfer is accepted */ if (ft->state == FILE_TRANSFER_PENDING) { ft->state = FILE_TRANSFER_STARTED; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.", + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer [%d] for '%s' accepted."), ft->index, ft->file_name); char progline[MAX_STR_SIZE]; prep_prog_line(progline); @@ -422,7 +431,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint break; case TOX_FILE_CONTROL_CANCEL: - snprintf(msg, sizeof(msg), "File transfer for '%s' was aborted.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' was aborted."), ft->file_name); close_file_transfer(self, m, ft, -1, msg, notif_error); break; } @@ -438,13 +447,13 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (!ft) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Too many concurrent file transfers."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Too many concurrent file transfers.")); return; } char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), file_size); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer request for '%s' (%s)", filename, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer request for '%s' (%s)"), filename, sizestr); char file_path[MAX_STR_SIZE]; size_t path_len = name_length; @@ -459,7 +468,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (path_len >= sizeof(ft->file_path) || name_length >= sizeof(ft->file_name)) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer faield: File path too long."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer faield: File path too long.")); return; } @@ -485,12 +494,12 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (count > 999) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: invalid file path."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: invalid file path.")); return; } } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type '/savefile %d' to accept the file transfer.", ft->index); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type '%s %d' to accept the file transfer."), "/savefile", ft->index); ft->state = FILE_TRANSFER_PENDING; ft->direction = FILE_TRANSFER_RECV; @@ -503,10 +512,10 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (self->active_box != -1) box_notify2(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, self->active_box, - "Incoming file: %s", filename ); + gettext("Incoming file: %s"), filename ); else box_notify(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, &self->active_box, self->name, - "Incoming file: %s", filename ); + gettext("Incoming file: %s"), filename ); } static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, uint8_t type, const char *group_pub_key, @@ -521,7 +530,7 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui char *k = malloc(length); if (k == NULL) - exit_toxic_err("Failed in chat_onGroupInvite", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in chat_onGroupInvite"), FATALERR_MEMORY); memcpy(k, group_pub_key, length); Friends.list[friendnumber].group_invite.key = k; @@ -535,12 +544,12 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui get_nick_truncate(m, name, friendnumber); if (self->active_box != -1) - box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, "invites you to join group chat"); + box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, gettext("invites you to join group chat")); else - box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, "invites you to join group chat"); + box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, gettext("invites you to join group chat")); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s has invited you to a group chat.", name); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/join\" to join the chat."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("%s has invited you to a group chat."), name); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s\" to join the chat."), "/join"); } /* Av Stuff */ @@ -554,16 +563,16 @@ void chat_onInvite (ToxWindow *self, ToxAv *av, int call_index) /* call_index is set here and reset on call end */ self->call_idx = call_index; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Incoming audio call! Type: \"/answer\" or \"/reject\""); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Incoming audio call! Type: \"%s\" or \"%s\""), "/answer", "/reject"); if (self->ringing_sound == -1) sound_notify(self, call_incoming, NT_LOOP, &self->ringing_sound); if (self->active_box != -1) - box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, "Incoming audio call!"); + box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, gettext("Incoming audio call!")); else - box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, "Incoming audio call!"); + box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, gettext("Incoming audio call!")); } void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) @@ -571,7 +580,7 @@ void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) if ( !self || self->call_idx != call_index || self->num != toxav_get_peer_id(av, call_index, 0)) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ringing...type \"/hangup\" to cancel it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Ringing...type \"%s\" to cancel it."), "/hangup"); #ifdef SOUND_NOTIFY if (self->ringing_sound == -1) @@ -586,7 +595,7 @@ void chat_onStarting (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -600,7 +609,7 @@ void chat_onEnding (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -613,7 +622,7 @@ void chat_onError (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Error!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -627,7 +636,7 @@ void chat_onStart (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -641,7 +650,7 @@ void chat_onCancel (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -654,7 +663,7 @@ void chat_onReject (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Rejected!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Rejected!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -668,7 +677,7 @@ void chat_onEnd (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -681,7 +690,7 @@ void chat_onRequestTimeout (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No answer!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No answer!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -695,7 +704,7 @@ void chat_onPeerTimeout (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Peer disconnected; call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Peer disconnected; call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -752,31 +761,31 @@ static void draw_infobox(ToxWindow *self) infobox->lastupdate = curtime; - const char *in_is_muted = infobox->in_is_muted ? "yes" : "no"; - const char *out_is_muted = infobox->out_is_muted ? "yes" : "no"; + const char *in_is_muted = infobox->in_is_muted ? YES_STR : NO_STR; + const char *out_is_muted = infobox->out_is_muted ? YES_STR : NO_STR; wmove(infobox->win, 1, 1); wattron(infobox->win, COLOR_PAIR(RED) | A_BOLD); - wprintw(infobox->win, " Call Active\n"); + wprintw(infobox->win, gettext(" Call Active\n")); wattroff(infobox->win, COLOR_PAIR(RED) | A_BOLD); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " Duration: "); + wprintw(infobox->win, gettext(" Duration: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", infobox->timestr); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " In muted: "); + wprintw(infobox->win, gettext(" In muted: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", in_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " Out muted: "); + wprintw(infobox->win, gettext(" Out muted: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", out_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " VAD level: "); + wprintw(infobox->win, gettext(" VAD level: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%.2f\n", infobox->vad_lvl); @@ -1068,7 +1077,7 @@ static void chat_onInit(ToxWindow *self, Tox *m) ctx->cqueue = calloc(1, sizeof(struct chat_queue)); if (ctx->log == NULL || ctx->hst == NULL || ctx->cqueue == NULL) - exit_toxic_err("failed in chat_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in chat_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -1140,7 +1149,7 @@ ToxWindow new_chat(Tox *m, uint32_t friendnum) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_chat", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_chat"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/chat_commands.c b/src/chat_commands.c index 3352f47..63218e5 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -23,6 +23,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -39,7 +45,7 @@ extern FriendsList Friends; void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 2) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Requires type in|out and the file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Requires type %s and the file ID."), "in|out"); return; } @@ -48,7 +54,7 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar int idx = atoi(argv[2]); if (idx >= MAX_FILES || idx < 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } @@ -60,50 +66,50 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar } else if (strcasecmp(inoutstr, "out") == 0) { ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_SEND); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type must be 'in' or 'out'."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type must be '%s' or '%s'."), "in", "out"); return; } if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } if (ft->state == FILE_TRANSFER_INACTIVE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } - snprintf(msg, sizeof(msg), "File transfer for '%s' aborted.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' aborted."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, silent); } void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group number required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group number required.")); return; } int groupnum = atoi(argv[1]); if (groupnum == 0 && strcmp(argv[1], "0")) { /* atoi returns 0 value on invalid input */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid group number."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid group number.")); return; } if (tox_invite_friend(m, self->num, groupnum) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to invite contact to group."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to invite contact to group.")); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invited contact to Group %d.", groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invited contact to Group %d."), groupnum); } void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); return; } @@ -112,7 +118,7 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar uint8_t type = Friends.list[self->num].group_invite.type; if (!Friends.list[self->num].group_invite.pending) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending group chat invite."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending group chat invite.")); return; } @@ -127,12 +133,12 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); tox_del_groupchat(m, groupnum); return; } @@ -142,31 +148,31 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File ID required.")); return; } int idx = atoi(argv[1]); if ((idx == 0 && strcmp(argv[1], "0")) || idx >= MAX_FILES) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } struct FileTransfer *ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_RECV); if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } if (ft->state != FILE_TRANSFER_PENDING) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } if ((ft->file = fopen(ft->file_path, "a")) == NULL) { - const char *msg = "File transfer failed: Invalid file path."; + const char *msg = gettext("File transfer failed: Invalid file path."); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -177,7 +183,7 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv if (err != TOX_ERR_FILE_CONTROL_OK) goto on_recv_error; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Saving file [%d] as: '%s'", idx, ft->file_path); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Saving file [%d] as: '%s'"), idx, ft->file_path); /* prep progress bar line */ char progline[MAX_STR_SIZE]; @@ -192,23 +198,23 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv on_recv_error: switch (err) { case TOX_ERR_FILE_CONTROL_FRIEND_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend not found."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend not found.")); return; case TOX_ERR_FILE_CONTROL_FRIEND_NOT_CONNECTED: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend is not online."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend is not online.")); return; case TOX_ERR_FILE_CONTROL_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Invalid filenumber."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Invalid filenumber.")); return; case TOX_ERR_FILE_CONTROL_SENDQ: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Connection error."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Connection error.")); return; default: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed (error %d)\n", err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed (error %d)\n"), err); return; } } @@ -218,12 +224,12 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv const char *errmsg = NULL; if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path required.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path must be enclosed in quotes.")); return; } @@ -234,21 +240,21 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv path[path_len] = '\0'; if (path_len >= MAX_STR_SIZE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path exceeds character limit."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path exceeds character limit.")); return; } FILE *file_to_send = fopen(path, "r"); if (file_to_send == NULL) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File not found."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File not found.")); return; } off_t filesize = file_size(path); if (filesize == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file.")); fclose(file_to_send); return; } @@ -281,30 +287,30 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), filesize); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Sending file [%d]: '%s' (%s)", filenum, file_name, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Sending file [%d]: '%s' (%s)"), filenum, file_name, sizestr); return; on_send_error: switch (err) { case TOX_ERR_FILE_SEND_FRIEND_NOT_FOUND: - errmsg = "File transfer failed: Invalid friend."; + errmsg = gettext("File transfer failed: Invalid friend."); break; case TOX_ERR_FILE_SEND_FRIEND_NOT_CONNECTED: - errmsg = "File transfer failed: Friend is offline."; + errmsg = gettext("File transfer failed: Friend is offline."); break; case TOX_ERR_FILE_SEND_NAME_TOO_LONG: - errmsg = "File transfer failed: Filename is too long."; + errmsg = gettext("File transfer failed: Filename is too long."); break; case TOX_ERR_FILE_SEND_TOO_MANY: - errmsg = "File transfer failed: Too many concurrent file transfers."; + errmsg = gettext("File transfer failed: Too many concurrent file transfers."); break; default: - errmsg = "File transfer failed."; + errmsg = gettext("File transfer failed."); break; } diff --git a/src/configdir.c b/src/configdir.c index 8a9f60c..a6fda82 100644 --- a/src/configdir.c +++ b/src/configdir.c @@ -29,6 +29,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "configdir.h" @@ -116,7 +122,7 @@ int create_user_config_dirs(char *path) char *logpath = malloc(strlen(path) + strlen(LOGDIR) + 1); if (fullpath == NULL || logpath == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); strcpy(fullpath, path); strcat(fullpath, CONFIGDIR); diff --git a/src/dns.c b/src/dns.c index ade723c..8a7a6f3 100644 --- a/src/dns.c +++ b/src/dns.c @@ -26,6 +26,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #else @@ -146,7 +152,7 @@ static int load_dns_domainlist(const char *path) static int dns_error(ToxWindow *self, const char *errmsg) { pthread_mutex_lock(&Winthread.lock); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "User lookup failed: %s", errmsg); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("User lookup failed: %s"), errmsg); pthread_mutex_unlock(&Winthread.lock); return -1; @@ -172,18 +178,18 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char int len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, "dn_expand failed."); + return dns_error(self, gettext("dn_expand failed.")); ans_pt += len; if (ans_pt > ans_end - 4) - return dns_error(self, "DNS reply was too short."); + return dns_error(self, gettext("DNS reply was too short.")); int type; GETSHORT(type, ans_pt); if (type != T_TXT) - return dns_error(self, "Broken DNS reply."); + return dns_error(self, gettext("Broken DNS reply.")); ans_pt += INT16SZ; /* class */ @@ -195,12 +201,12 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, "Second dn_expand failed."); + return dns_error(self, gettext("Second dn_expand failed.")); ans_pt += len; if (ans_pt > ans_end - 10) - return dns_error(self, "DNS reply was too short."); + return dns_error(self, gettext("DNS reply was too short.")); GETSHORT(type, ans_pt); ans_pt += INT16SZ; @@ -208,20 +214,20 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char GETSHORT(size, ans_pt); if (ans_pt + size < answer || ans_pt + size > ans_end) - return dns_error(self, "RR overflow."); + return dns_error(self, gettext("RR overflow.")); } while (type == T_CNAME); if (type != T_TXT) - return dns_error(self, "DNS response failed."); + return dns_error(self, gettext("DNS response failed.")); uint32_t txt_len = *ans_pt; if (!size || txt_len >= size || !txt_len) - return dns_error(self, "No record found."); + return dns_error(self, gettext("No record found.")); if (txt_len > MAX_DNS_REQST_SIZE) - return dns_error(self, "Invalid DNS response."); + return dns_error(self, gettext("Invalid DNS response.")); ans_pt++; ans_pt[txt_len] = '\0'; @@ -298,7 +304,7 @@ void *dns3_lookup_thread(void *data) int namelen = parse_addr(t_data.addr, name, inputdomain); if (namelen == -1) { - dns_error(self, "Must be a Tox ID or an address in the form username@domain"); + dns_error(self, gettext("Must be a Tox ID or an address in the form username@domain")); killdns_thread(NULL); } @@ -308,14 +314,14 @@ void *dns3_lookup_thread(void *data) int match = get_domain_match(DNS_pubkey, domain, inputdomain); if (match == -1) { - dns_error(self, "Domain not found."); + dns_error(self, gettext("Domain not found.")); killdns_thread(NULL); } void *dns_obj = tox_dns3_new((uint8_t *) DNS_pubkey); if (dns_obj == NULL) { - dns_error(self, "Core failed to create DNS object."); + dns_error(self, gettext("Core failed to create DNS object.")); killdns_thread(NULL); } @@ -326,7 +332,7 @@ void *dns3_lookup_thread(void *data) (uint8_t *) name, namelen); if (str_len == -1) { - dns_error(self, "Core failed to generate DNS3 string."); + dns_error(self, gettext("Core failed to generate DNS3 string.")); killdns_thread(dns_obj); } @@ -340,7 +346,7 @@ void *dns3_lookup_thread(void *data) int ans_len = res_query(d_string, C_IN, T_TXT, answer, sizeof(answer)); if (ans_len <= 0) { - dns_error(self, "DNS query failed."); + dns_error(self, gettext("DNS query failed.")); killdns_thread(dns_obj); } @@ -355,7 +361,7 @@ void *dns3_lookup_thread(void *data) /* extract the encrypted ID from TXT response */ if (strncmp(ans_id, TOX_DNS3_TXT_PREFIX, prfx_len) != 0) { - dns_error(self, "Bad DNS3 TXT response."); + dns_error(self, gettext("Bad DNS3 TXT response.")); killdns_thread(dns_obj); } @@ -363,7 +369,7 @@ void *dns3_lookup_thread(void *data) if (tox_decrypt_dns3_TXT(dns_obj, (uint8_t *) t_data.id_bin, (uint8_t *) encrypted_id, strlen(encrypted_id), request_id) == -1) { - dns_error(self, "Core failed to decrypt DNS response."); + dns_error(self, gettext("Core failed to decrypt DNS response.")); killdns_thread(dns_obj); } @@ -379,12 +385,12 @@ void *dns3_lookup_thread(void *data) void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, const char *msg) { if (arg_opts.proxy_type != TOX_PROXY_TYPE_NONE && arg_opts.force_tcp) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "DNS lookups are disabled."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("DNS lookups are disabled.")); return; } if (t_data.busy) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please wait for previous user lookup to finish."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please wait for previous user lookup to finish.")); return; } @@ -394,7 +400,7 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, int ret = load_dns_domainlist(path); if (ret < 0) { - const char *errmsg = "DNS server list failed to load with error code %d. Falling back to hard-coded list."; + const char *errmsg = gettext("DNS server list failed to load with error code %d. Falling back to hard-coded list."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, ret); } } @@ -407,20 +413,20 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, t_data.busy = 1; if (pthread_attr_init(&dns_thread.attr) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to init"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to init")); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_attr_setdetachstate(&dns_thread.attr, PTHREAD_CREATE_DETACHED) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to set"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to set")); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_create(&dns_thread.tid, &dns_thread.attr, dns3_lookup_thread, NULL) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread failed to init"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread failed to init")); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; diff --git a/src/execute.c b/src/execute.c index 9e83a83..81dfb70 100644 --- a/src/execute.c +++ b/src/execute.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "execute.h" @@ -98,7 +104,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a char *cmd = strdup(input); if (cmd == NULL) - exit_toxic_err("failed in parse_command", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in parse_command"), FATALERR_MEMORY); int num_args = 0; int i = 0; /* index of last char in an argument */ @@ -112,7 +118,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a i = char_find(1, cmd, '\"'); if (cmd[i] == '\0') { - const char *errmsg = "Invalid argument. Did you forget a closing \"?"; + const char *errmsg = gettext("Invalid argument. Did you forget a closing \"?"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); free(cmd); return -1; @@ -183,5 +189,5 @@ void execute(WINDOW *w, ToxWindow *self, Tox *m, const char *input, int mode) if (do_command(w, self, m, num_args, global_commands, args) == 0) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid command."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid command.")); } diff --git a/src/friendlist.c b/src/friendlist.c index c8df965..45af2b2 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -26,6 +26,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include #include "toxic.h" @@ -84,7 +90,7 @@ static void realloc_friends(int n) uint32_t *f_idx = realloc(Friends.index, n * sizeof(uint32_t)); if (f == NULL || f_idx == NULL) - exit_toxic_err("failed in realloc_friends", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in realloc_friends"), FATALERR_MEMORY); Friends.list = f; Friends.index = f_idx; @@ -104,7 +110,7 @@ static void realloc_blocklist(int n) uint32_t *b_idx = realloc(Blocked.index, n * sizeof(uint32_t)); if (b == NULL || b_idx == NULL) - exit_toxic_err("failed in realloc_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in realloc_blocklist"), FATALERR_MEMORY); Blocked.list = b; Blocked.index = b_idx; @@ -132,7 +138,7 @@ static int save_blocklist(char *path) char *data = malloc(len); if (data == NULL) - exit_toxic_err("Failed in save_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in save_blocklist"), FATALERR_MEMORY); int i; @@ -199,7 +205,7 @@ int load_blocklist(char *path) if (data == NULL) { fclose(fp); - exit_toxic_err("Failed in load_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in load_blocklist"), FATALERR_MEMORY); } if (fread(data, len, 1, fp) != 1) { @@ -322,7 +328,7 @@ static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESS get_time_str(timefrmt, sizeof(timefrmt)); line_info_add(prompt, timefrmt, nick, NULL, IN_MSG, 0, 0, "%s", str); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "* Warning: Too many windows are open."); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("* Warning: Too many windows are open.")); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -337,7 +343,7 @@ static void friendlist_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, ++Friends.num_online; if (avatar_send(m, num) == -1) - fprintf(stderr, "avatar_send failed for friend %d\n", num); + fprintf(stderr, gettext("avatar_send failed for friend %d\n"), num); } Friends.list[num].connection_status = connection_status; @@ -412,7 +418,7 @@ void friendlist_onFriendAdded(ToxWindow *self, Tox *m, uint32_t num, bool sort) tox_friend_get_public_key(m, num, (uint8_t *) Friends.list[i].pub_key, &pkerr); if (pkerr != TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK) - fprintf(stderr, "tox_friend_get_public_key failed (error %d)\n", pkerr); + fprintf(stderr, gettext("tox_friend_get_public_key failed (error %d)\n"), pkerr); TOX_ERR_FRIEND_GET_LAST_ONLINE loerr; uint64_t t = tox_friend_get_last_online(m, num, &loerr); @@ -491,7 +497,7 @@ static void friendlist_onFileRecv(ToxWindow *self, Tox *m, uint32_t num, uint32_ get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - "* File transfer from %s failed: too many windows are open.", nick); + gettext("* File transfer from %s failed: too many windows are open."), nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -514,7 +520,7 @@ static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, uint8 get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - "* Group chat invite from %s failed: too many windows are open.", nick); + gettext("* Group chat invite from %s failed: too many windows are open."), nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -537,7 +543,7 @@ static void delete_friend(Tox *m, uint32_t f_num) { TOX_ERR_FRIEND_DELETE err; if (tox_friend_delete(m, f_num, &err) != true) { - fprintf(stderr, "tox_friend_delete failed with error %d\n", err); + fprintf(stderr, gettext("tox_friend_delete failed with error %d\n"), err); return; } @@ -617,7 +623,7 @@ static void draw_del_popup(void) wattroff(PendingDelete.popup, A_BOLD); wmove(PendingDelete.popup, 1, 1); - wprintw(PendingDelete.popup, "Delete contact "); + wprintw(PendingDelete.popup, gettext("Delete contact ")); wattron(PendingDelete.popup, A_BOLD); if (blocklist_view == 0) @@ -698,7 +704,7 @@ static void unblock_friend(Tox *m, uint32_t bnum) uint32_t friendnum = tox_friend_add_norequest(m, (uint8_t *) Blocked.list[bnum].pub_key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to unblock friend (error %d)\n", err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to unblock friend (error %d)\n"), err); return; } @@ -757,7 +763,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) Friends.list[f].chatwin = add_window(m, new_chat(m, Friends.list[f].num)); set_active_window(Friends.list[f].chatwin); } else { - const char *msg = "* Warning: Too many windows are open."; + const char *msg = gettext("* Warning: Too many windows are open."); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, msg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -794,7 +800,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) { wattron(self->window, A_BOLD); - wprintw(self->window, " Blocked: "); + wprintw(self->window, gettext(" Blocked: ")); wattroff(self->window, A_BOLD); wprintw(self->window, "%d\n\n", Blocked.num_blocked); @@ -846,7 +852,7 @@ static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, "Key: "); + wprintw(self->window, gettext("Key: ")); wattroff(self->window, A_BOLD); int i; @@ -872,11 +878,11 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) bool fix_statuses = x2 != self->x; /* true if window max x value has changed */ wattron(self->window, COLOR_PAIR(CYAN)); - wprintw(self->window, " Press the"); + wprintw(self->window, gettext(" Press the")); wattron(self->window, A_BOLD); wprintw(self->window, " h "); wattroff(self->window, A_BOLD); - wprintw(self->window, "key for help\n\n"); + wprintw(self->window, gettext("key for help\n\n")); wattroff(self->window, COLOR_PAIR(CYAN)); if (blocklist_view == 1) { @@ -888,7 +894,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) struct tm cur_loc_tm = *localtime((const time_t *) &cur_time); wattron(self->window, A_BOLD); - wprintw(self->window, " Online: "); + wprintw(self->window, gettext(" Online: ")); wattroff(self->window, A_BOLD); wprintw(self->window, "%d/%d \n\n", Friends.num_online, Friends.num_friends); @@ -1002,19 +1008,19 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) switch (day_dist) { case 0: - wprintw(self->window, " Last seen: Today %s\n", hourmin); + wprintw(self->window, gettext(" Last seen: Today %s\n"), hourmin); break; case 1: - wprintw(self->window, " Last seen: Yesterday %s\n", hourmin); + wprintw(self->window, gettext(" Last seen: Yesterday %s\n"), hourmin); break; default: - wprintw(self->window, " Last seen: %d days ago\n", day_dist); + wprintw(self->window, gettext(" Last seen: %d days ago\n"), day_dist); break; } } else { - wprintw(self->window, " Last seen: Never\n"); + wprintw(self->window, gettext(" Last seen: Never\n")); } } } @@ -1026,7 +1032,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, "Key: "); + wprintw(self->window, gettext("Key: ")); wattroff(self->window, A_BOLD); int i; @@ -1065,9 +1071,9 @@ static void friendlist_onAv(ToxWindow *self, ToxAv *av, int call_index) } else { char nick[TOX_MAX_NAME_LENGTH]; get_nick_truncate(m, nick, Friends.list[id].num); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Audio action from: %s!", nick); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Audio action from: %s!"), nick); - const char *errmsg = "* Warning: Too many windows are open."; + const char *errmsg = gettext("* Warning: Too many windows are open."); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); @@ -1117,9 +1123,9 @@ ToxWindow new_friendlist(void) Help *help = calloc(1, sizeof(Help)); if (help == NULL) - exit_toxic_err("failed in new_friendlist", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_friendlist"), FATALERR_MEMORY); ret.help = help; - strcpy(ret.name, "contacts"); + strcpy(ret.name, gettext("contacts")); return ret; } diff --git a/src/global_commands.c b/src/global_commands.c index fc7e3b8..50e0eb2 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -46,19 +52,19 @@ extern FriendRequests FrndRequests; void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } @@ -66,10 +72,10 @@ void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ uint32_t friendnum = tox_friend_add_norequest(m, FrndRequests.request[req].key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to add friend (error %d\n)", err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to add friend (error %d)\n"), err); return; } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Friend request accepted."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request accepted.")); on_friendadded(m, friendnum, true); } @@ -96,42 +102,42 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg switch (err) { case TOX_ERR_FRIEND_ADD_TOO_LONG: - errmsg = "Message is too long."; + errmsg = gettext("Message is too long."); break; case TOX_ERR_FRIEND_ADD_NO_MESSAGE: - errmsg = "Please add a message to your request."; + errmsg = gettext("Please add a message to your request."); break; case TOX_ERR_FRIEND_ADD_OWN_KEY: - errmsg = "That appears to be your own ID."; + errmsg = gettext("That appears to be your own ID."); break; case TOX_ERR_FRIEND_ADD_ALREADY_SENT: - errmsg = "Friend request has already been sent."; + errmsg = gettext("Friend request has already been sent."); break; case TOX_ERR_FRIEND_ADD_BAD_CHECKSUM: - errmsg = "Bad checksum in address."; + errmsg = gettext("Bad checksum in address."); break; case TOX_ERR_FRIEND_ADD_SET_NEW_NOSPAM: - errmsg = "Nospam was different."; + errmsg = gettext("Nospam was different."); break; case TOX_ERR_FRIEND_ADD_MALLOC: - errmsg = "Core memory allocation failed."; + errmsg = gettext("Core memory allocation failed."); break; case TOX_ERR_FRIEND_ADD_OK: - errmsg = "Friend request sent."; + errmsg = gettext("Friend request sent."); on_friendadded(m, f_num, true); break; case TOX_ERR_FRIEND_ADD_NULL: /* fallthrough */ default: - errmsg = "Faile to add friend: Unknown error."; + errmsg = gettext("Failed to add friend: Unknown error."); break; } @@ -141,7 +147,7 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Tox ID or address required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Tox ID or address required.")); return; } @@ -150,7 +156,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc > 1) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Message must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Message must be enclosed in quotes.")); return; } @@ -166,7 +172,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX size_t n_len = tox_self_get_name_size(m); selfname[n_len] = '\0'; - snprintf(msg, sizeof(msg), "Hello, my name is %s. Care to Tox?", selfname); + snprintf(msg, sizeof(msg), gettext("Hello, my name is %s. Care to Tox?"), selfname); } char id_bin[TOX_ADDRESS_SIZE] = {0}; @@ -184,7 +190,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX xx[2] = '\0'; if (sscanf(xx, "%02x", &x) != 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid Tox ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid Tox ID.")); return; } @@ -201,12 +207,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ { if (argc < 2 || strlen(argv[1]) < 3) { avatar_unset(m); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar is not set."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar is not set.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Path must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Path must be enclosed in quotes.")); return; } @@ -216,7 +222,7 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ int len = strlen(path) - 1; if (len <= 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid path."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid path.")); return; } @@ -226,12 +232,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (avatar_set(m, path, len) == -1) { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, - "Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes.", + gettext("Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes."), MAX_AVATAR_FILE_SIZE); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar set to '%s'", filename); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar set to '%s'"), filename); } void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -243,7 +249,7 @@ void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc != 3) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Require: "); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Require: ")); return; } @@ -252,7 +258,7 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) const char *key = argv[3]; if (atoi(port) == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid port."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid port.")); return; } @@ -265,15 +271,15 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) switch (err) { case TOX_ERR_BOOTSTRAP_BAD_HOST: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid IP."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid IP.")); break; case TOX_ERR_BOOTSTRAP_BAD_PORT: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid port."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid port.")); break; case TOX_ERR_BOOTSTRAP_NULL: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed.")); break; default: break; @@ -283,19 +289,19 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } @@ -315,12 +321,12 @@ void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); return; } if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please specify group type: text | audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please specify group type: %s"), "text|audio"); return; } @@ -331,7 +337,7 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg else if (!strcasecmp(argv[1], "text")) type = TOX_GROUPCHAT_TYPE_TEXT; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Valid group types are: text | audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Valid group types are: %s"), "text|audio"); return; } @@ -345,17 +351,17 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); tox_del_groupchat(m, groupnum); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat [%d] created.", groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat [%d] created."), groupnum); } void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -365,9 +371,9 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc == 0) { if (log->log_on) - msg = "Logging for this window is ON. Type \"/log off\" to disable."; + msg = gettext("Logging for this window is ON. Type \"/log off\" to disable."); else - msg = "Logging for this window is OFF. Type \"/log on\" to enable."; + msg = gettext("Logging for this window is OFF. Type \"/log on\" to enable."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; @@ -388,7 +394,7 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_enable(self->name, myid, NULL, log, LOG_GROUP); } - msg = "Logging enabled"; + msg = gettext("Logging enabled"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } else if (!strcmp(swch, "0") || !strcmp(swch, "off")) { @@ -397,13 +403,13 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_disable(log); - msg = "Logging disabled"; + msg = gettext("Logging disabled"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } - msg = "Invalid option. Use \"/log on\" and \"/log off\" to toggle logging."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); + msg = gettext("Invalid option. Use \"%s\" to toggle logging."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg, "/log on|off"); } void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -426,7 +432,7 @@ void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); return; } @@ -443,7 +449,7 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA } if (!valid_nick(nick)) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid name."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid name.")); return; } @@ -459,12 +465,12 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_note(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); return; } @@ -490,7 +496,7 @@ void cmd_quit(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_requests(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (FrndRequests.num_requests == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend requests."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend requests.")); return; } @@ -527,8 +533,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (argc >= 2) { have_note = true; } else if (argc < 1) { - errmsg = "Require a status. Statuses are: online, busy and away."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); + errmsg = gettext("Require a status. Statuses are: %s."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); goto finish; } @@ -542,8 +548,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ else if (!strcasecmp(status_str, "busy")) status = TOX_USER_STATUS_BUSY; else { - errmsg = "Invalid status. Valid statuses are: online, busy and away."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); + errmsg = gettext("Invalid status. Valid statuses are: %s."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); goto finish; } @@ -552,7 +558,7 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (have_note) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); goto finish; } diff --git a/src/group_commands.c b/src/group_commands.c index fb73a0b..2589370 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -37,16 +43,16 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg if (tlen != -1) { title[tlen] = '\0'; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is set to: %s", title); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is set to: %s"), title); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is not set"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is not set")); } return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title must be enclosed in quotes.")); return; } @@ -56,7 +62,7 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg title[len] = '\0'; if (tox_group_set_title(m, self->num, (uint8_t *) title, len) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set title."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set title.")); return; } @@ -71,9 +77,9 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg size_t sn_len = tox_self_get_name_size(m); selfnick[sn_len] = '\0'; - line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); + line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); + snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); write_to_log(tmp_event, selfnick, self->chatwin->log, true); } diff --git a/src/groupchat.c b/src/groupchat.c index 57885c9..1c8f990 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -31,6 +31,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef AUDIO #ifdef __APPLE__ #include @@ -134,7 +140,7 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type) if (groupchats[i].peer_names == NULL || groupchats[i].oldpeer_names == NULL || groupchats[i].peer_name_lengths == NULL || groupchats[i].oldpeer_name_lengths == NULL) - exit_toxic_err("failed in init_groupchat_win", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in init_groupchat_win"), FATALERR_MEMORY); memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, sizeof(UNKNOWN_NAME)); groupchats[i].oldpeer_name_lengths[0] = (uint16_t) strlen(UNKNOWN_NAME); @@ -142,7 +148,7 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type) #ifdef AUDIO if (type == TOX_GROUPCHAT_TYPE_AV) if (group_audio_open_out_device(i) == -1) - fprintf(stderr, "Group Audio failed to init\n"); + fprintf(stderr, gettext("Group Audio failed to init\n")); #endif /* AUDIO */ set_active_window(groupchats[i].chatwin); @@ -328,10 +334,10 @@ static void groupchat_onGroupTitleChange(ToxWindow *self, Tox *m, int groupnum, char nick[TOX_MAX_NAME_LENGTH]; get_group_nick_truncate(m, nick, peernum, groupnum); - line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); + line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); + snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); write_to_log(tmp_event, nick, ctx->log, true); } @@ -353,7 +359,7 @@ static void copy_peernames(int gnum, uint8_t peerlist[][TOX_MAX_NAME_LENGTH], ui if (groupchats[gnum].peer_names == NULL || groupchats[gnum].oldpeer_names == NULL || groupchats[gnum].peer_name_lengths == NULL || groupchats[gnum].oldpeer_name_lengths == NULL) { - exit_toxic_err("failed in copy_peernames", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in copy_peernames"), FATALERR_MEMORY); } uint16_t u_len = strlen(UNKNOWN_NAME); @@ -410,7 +416,7 @@ void *group_add_wait(void *data) pthread_mutex_unlock(&Winthread.lock); } - const char *event = "has joined the room"; + const char *event = gettext("has joined the room"); char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); @@ -508,7 +514,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu break; case TOX_CHAT_CHANGE_PEER_DEL: - event = "has left the room"; + event = gettext("has left the room"); line_info_add(self, timefrmt, (char *) oldpeername, NULL, DISCONNECTION, 0, RED, event); if (groupchats[self->num].side_pos > 0) @@ -525,11 +531,11 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu if (strcmp((char *) oldpeername, DEFAULT_TOX_NAME) == 0) return; - event = " is now known as "; + event = gettext(" is now known as "); line_info_add(self, timefrmt, (char *) oldpeername, (char *) peername, NAME_CHANGE, 0, 0, event); char tmp_event[TOXIC_MAX_NAME_LENGTH * 2 + 32]; - snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", (char *) peername); + snprintf(tmp_event, sizeof(tmp_event), gettext("is now known as %s"), (char *) peername); write_to_log(tmp_event, (char *) oldpeername, ctx->log, true); break; } @@ -540,12 +546,12 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu static void send_group_action(ToxWindow *self, ChatContext *ctx, Tox *m, char *action) { if (action == NULL) { - wprintw(ctx->history, "Invalid syntax.\n"); + wprintw(ctx->history, gettext("Invalid syntax.\n")); return; } if (tox_group_action_send(m, self->num, (uint8_t *) action, strlen(action)) == -1) { - const char *errmsg = " * Failed to send action."; + const char *errmsg = gettext(" * Failed to send action."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -632,7 +638,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) } } else if (!string_is_empty(line)) { if (tox_group_message_send(m, self->num, (uint8_t *) line, strlen(line)) == -1) { - const char *errmsg = " * Failed to send message."; + const char *errmsg = gettext(" * Failed to send message."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -669,7 +675,7 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m) wmove(ctx->sidebar, 0, 1); wattron(ctx->sidebar, A_BOLD); - wprintw(ctx->sidebar, "Peers: %d\n", num_peers); + wprintw(ctx->sidebar, gettext("Peers: %d\n"), num_peers); wattroff(ctx->sidebar, A_BOLD); mvwaddch(ctx->sidebar, 1, 0, ACS_LTEE); @@ -719,7 +725,7 @@ static void groupchat_onInit(ToxWindow *self, Tox *m) ctx->log = calloc(1, sizeof(struct chatlog)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err("failed in groupchat_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in groupchat_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -804,7 +810,7 @@ static int group_audio_write(int peernum, int groupnum, const int16_t *pcm, unsi alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_PROCESSED, &processed); alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_QUEUED, &queued); - fprintf(stderr, "source: %d, queued: %d, processed: %d\n", groupchats[groupnum].audio.source, queued, processed); + fprintf(stderr, gettext("source: %d, queued: %d, processed: %d\n"), groupchats[groupnum].audio.source, queued, processed); if (processed) { ALuint bufids[processed]; @@ -843,13 +849,13 @@ static void groupchat_onWriteDevice(ToxWindow *self, Tox *m, int groupnum, int p return; if (groupchats[groupnum].audio.dvhandle == NULL) - fprintf(stderr, "dvhandle is null)\n"); + fprintf(stderr, gettext("dvhandle is null)\n")); if (groupchats[groupnum].audio.dvctx == NULL) - fprintf(stderr, "ctx is null\n"); + fprintf(stderr, gettext("ctx is null\n")); int ret = group_audio_write(peernum, groupnum, pcm, samples, channels, sample_rate); - fprintf(stderr, "write: %d\n", ret); + fprintf(stderr, gettext("write: %d\n"), ret); } #endif /* AUDIO */ @@ -873,13 +879,13 @@ ToxWindow new_group_chat(Tox *m, int groupnum) ret.onWriteDevice = &groupchat_onWriteDevice; #endif - snprintf(ret.name, sizeof(ret.name), "Group %d", groupnum); + snprintf(ret.name, sizeof(ret.name), gettext("Group %d"), groupnum); ChatContext *chatwin = calloc(1, sizeof(ChatContext)); Help *help = calloc(1, sizeof(Help)); if (chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_group_chat", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_group_chat"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.help = help; diff --git a/src/help.c b/src/help.c index 8989c11..0838433 100644 --- a/src/help.c +++ b/src/help.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "windows.h" #include "toxic.h" #include "help.h" @@ -139,32 +145,50 @@ static void help_draw_global(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Global Commands:\n"); + wprintw(win, gettext("Global Commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /add : Add contact with optional message\n"); - wprintw(win, " /accept : Accept friend request\n"); - wprintw(win, " /avatar : Set an avatar (leave path empty to unset)\n"); - wprintw(win, " /decline : Decline friend request\n"); - wprintw(win, " /requests : List pending friend requests\n"); - wprintw(win, " /connect : Manually connect to a DHT node\n"); - wprintw(win, " /status : Set status with optional note\n"); - wprintw(win, " /note : Set a personal note\n"); - wprintw(win, " /nick : Set your nickname\n"); - wprintw(win, " /log or : Enable/disable logging\n"); - wprintw(win, " /group : Create a group chat where type: text | audio\n"); - wprintw(win, " /myid : Print your Tox ID\n"); - wprintw(win, " /clear : Clear window history\n"); - wprintw(win, " /close : Close the current chat window\n"); - wprintw(win, " /quit or /exit : Exit Toxic\n"); + wprintw(win, " /add : "); + wprintw(win, gettext("Add contact with optional message\n")); + wprintw(win, " /accept : "); + wprintw(win, gettext("Accept friend request\n")); + wprintw(win, " /avatar : "); + wprintw(win, gettext("Set an avatar (leave path empty to unset)\n")); + wprintw(win, " /decline : "); + wprintw(win, gettext("Decline friend request\n")); + wprintw(win, " /requests : "); + wprintw(win, gettext("List pending friend requests\n")); + wprintw(win, " /connect : "); + wprintw(win, gettext("Manually connect to a DHT node\n")); + wprintw(win, " /status : "); + wprintw(win, gettext("Set status with optional note\n")); + wprintw(win, " /note : "); + wprintw(win, gettext("Set a personal note\n")); + wprintw(win, " /nick : "); + wprintw(win, gettext("Set your nickname\n")); + wprintw(win, " /log or : "); + wprintw(win, gettext("Enable/disable logging\n")); + wprintw(win, " /group : "); + wprintw(win, gettext("Create a group chat where type: text | audio\n")); + wprintw(win, " /myid : "); + wprintw(win, gettext("Print your Tox ID\n")); + wprintw(win, " /clear : "); + wprintw(win, gettext("Clear window history\n")); + wprintw(win, " /close : "); + wprintw(win, gettext("Close the current chat window\n")); + wprintw(win, " /quit or /exit : "); + wprintw(win, gettext("Exit Toxic\n")); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, "\n Audio:\n"); + wprintw(win, gettext("\n Audio:\n")); wattroff(win, A_BOLD); - wprintw(win, " /lsdev : List devices where type: in|out\n"); - wprintw(win, " /sdev : Set active device\n"); + wprintw(win, " /lsdev : "); + wprintw(win, gettext("List devices where type:")); + wprintw(win, " in|out\n"); + wprintw(win, " /sdev : "); + wprintw(win, gettext("Set active device\n")); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -180,27 +204,40 @@ static void help_draw_chat(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Chat Commands:\n"); + wprintw(win, gettext("Chat Commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /invite : Invite contact to a group chat\n"); - wprintw(win, " /join : Join a pending group chat\n"); - wprintw(win, " /sendfile : Send a file\n"); - wprintw(win, " /savefile : Receive a file\n"); - wprintw(win, " /cancel : Cancel file transfer where type: in|out\n"); + wprintw(win, " /invite : "); + wprintw(win, gettext("Invite contact to a group chat\n")); + wprintw(win, " /join : "); + wprintw(win, gettext("Join a pending group chat\n")); + wprintw(win, " /sendfile : "); + wprintw(win, gettext("Send a file\n")); + wprintw(win, " /savefile : "); + wprintw(win, gettext("Receive a file\n")); + wprintw(win, " /cancel : "); + wprintw(win, gettext("Cancel file transfer where type:")); + wprintw(win, " in|out\n"); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, "\n Audio:\n"); + wprintw(win, gettext("\n Audio:\n")); wattroff(win, A_BOLD); - wprintw(win, " /call : Audio call\n"); - wprintw(win, " /answer : Answer incoming call\n"); - wprintw(win, " /reject : Reject incoming call\n"); - wprintw(win, " /hangup : Hangup active call\n"); - wprintw(win, " /sdev : Change active device\n"); - wprintw(win, " /mute : Mute active device if in call\n"); - wprintw(win, " /sense : VAD sensitivity threshold\n"); + wprintw(win, " /call : "); + wprintw(win, gettext("Audio call\n")); + wprintw(win, " /answer : "); + wprintw(win, gettext("Answer incoming call\n")); + wprintw(win, " /reject : "); + wprintw(win, gettext("Reject incoming call\n")); + wprintw(win, " /hangup : "); + wprintw(win, gettext("Hangup active call\n")); + wprintw(win, " /sdev : "); + wprintw(win, gettext("Change active device\n")); + wprintw(win, " /mute : "); + wprintw(win, gettext("Mute active device if in call\n")); + wprintw(win, " /sense : "); + wprintw(win, gettext("VAD sensitivity threshold\n")); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -216,16 +253,22 @@ static void help_draw_keys(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Key bindings:\n"); + wprintw(win, gettext("Key bindings:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " Ctrl+O and Ctrl+P : Navigate through the tabs\n"); - wprintw(win, " Page Up and Page Down : Scroll window history one line\n"); - wprintw(win, " Ctrl+F and Ctrl+V : Scroll window history half a page\n"); - wprintw(win, " Ctrl+H : Move to the bottom of window history\n"); - wprintw(win, " Ctrl+[ and Ctrl+] : Scroll peer list in groupchats\n"); - wprintw(win, " Ctrl+B : Toggle the groupchat peerlist\n\n"); - wprintw(win, " (Note: Custom keybindings override these defaults.)\n\n"); + wprintw(win, " Ctrl+O -- Ctrl+P : "); + wprintw(win, gettext("Navigate through the tabs\n")); + wprintw(win, " Page Up -- Page Down : "); + wprintw(win, gettext("Scroll window history one line\n")); + wprintw(win, " Ctrl+F -- Ctrl+V : "); + wprintw(win, gettext("Scroll window history half a page\n")); + wprintw(win, " Ctrl+H : "); + wprintw(win, gettext("Move to the bottom of window history\n")); + wprintw(win, " Ctrl+[ -- Ctrl+] : "); + wprintw(win, gettext("Scroll peer list in groupchats\n")); + wprintw(win, " Ctrl+B : "); + wprintw(win, gettext("Toggle the groupchat peerlist\n\n")); + wprintw(win, gettext(" (Note: Custom keybindings override these defaults.)\n\n")); help_draw_bottom_menu(win); @@ -240,10 +283,11 @@ static void help_draw_group(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Group commands:\n"); + wprintw(win, gettext("Group commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /title : Set group title (show current title if no msg)\n\n"); + wprintw(win, " /title : "); + wprintw(win, gettext("Set group title (show current title if no msg)\n\n")); help_draw_bottom_menu(win); @@ -258,14 +302,15 @@ static void help_draw_contacts(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Friendlist controls:\n"); + wprintw(win, gettext("Friendlist controls:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " Up and Down arrows : Scroll through list\n"); - wprintw(win, " Right and Left arrows : Switch between friendlist and blocked list\n"); - wprintw(win, " Enter : Open a chat window with selected contact\n"); - wprintw(win, " Delete : Permanently delete a contact\n"); - wprintw(win, " B : Block or unblock a contact\n"); + wprintw(win, gettext(" Up and Down arrows : Scroll through list\n")); + wprintw(win, gettext(" Right and Left arrows : Switch between friendlist and blocked list\n")); + wprintw(win, gettext(" Enter : Open a chat window with selected contact\n")); + wprintw(win, gettext(" Delete : Permanently delete a contact\n")); + wprintw(win, " B : "); + wprintw(win, gettext("Block or unblock a contact\n")); help_draw_bottom_menu(win); diff --git a/src/line_info.c b/src/line_info.c index b645e8f..12eea6d 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -41,7 +47,7 @@ void line_info_init(struct history *hst) hst->line_root = calloc(1, sizeof(struct line_info)); if (hst->line_root == NULL) - exit_toxic_err("failed in line_info_init", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in line_info_init"), FATALERR_MEMORY); hst->line_start = hst->line_root; hst->line_end = hst->line_start; @@ -141,7 +147,7 @@ void line_info_add(ToxWindow *self, const char *timestr, const char *name1, cons struct line_info *new_line = calloc(1, sizeof(struct line_info)); if (new_line == NULL) - exit_toxic_err("failed in line_info_add", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in line_info_add"), FATALERR_MEMORY); char frmt_msg[MAX_LINE_INFO_MSG_SIZE] = {0}; diff --git a/src/log.c b/src/log.c index f04c83d..a3331ef 100644 --- a/src/log.c +++ b/src/log.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "configdir.h" #include "toxic.h" #include "windows.h" @@ -180,17 +186,17 @@ void load_chat_history(ToxWindow *self, struct chatlog *log) char *hstbuf = malloc(sz); if (hstbuf == NULL) - exit_toxic_err("failed in load_chat_history", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_chat_history"), FATALERR_MEMORY); if (fseek(log->file, 0L, SEEK_SET) == -1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); return; } if (fread(hstbuf, sz, 1, log->file) != 1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); return; } diff --git a/src/message_queue.c b/src/message_queue.c index 70ccadb..996e4eb 100644 --- a/src/message_queue.c +++ b/src/message_queue.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "message_queue.h" @@ -47,7 +53,7 @@ void cqueue_add(struct chat_queue *q, const char *msg, size_t len, uint8_t type, struct cqueue_msg *new_m = malloc(sizeof(struct cqueue_msg)); if (new_m == NULL) - exit_toxic_err("failed in cqueue_message", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in cqueue_message"), FATALERR_MEMORY); snprintf(new_m->message, sizeof(new_m->message), "%s", msg); new_m->len = len; diff --git a/src/misc_tools.c b/src/misc_tools.c index 0d0a749..65114a1 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -28,6 +28,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -231,7 +237,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *path = strdup(pathname); if (path == NULL) - exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); while (len >= 0 && pathname[len] == '/') path[len--] = '\0'; @@ -239,7 +245,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *finalname = strdup(path); if (finalname == NULL) - exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); const char *basenm = strrchr(path, '/'); diff --git a/src/prompt.c b/src/prompt.c index 8377125..355d0d3 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -28,6 +28,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "prompt.h" @@ -130,7 +136,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms tox_self_set_status_message(m, (uint8_t *) statusmsg, len, &err); if (err != TOX_ERR_SET_INFO_OK) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set note (error %d)\n", err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set note (error %d)\n"), err); } /* Updates own status in prompt statusbar */ @@ -262,19 +268,19 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) if (statusbar->connection != TOX_CONNECTION_NONE) { int colour = MAGENTA; - const char *status_text = "ERROR"; + const char *status_text = gettext("ERROR"); switch (statusbar->status) { case TOX_USER_STATUS_NONE: - status_text = "Online"; + status_text = gettext("Online"); colour = GREEN; break; case TOX_USER_STATUS_AWAY: - status_text = "Away"; + status_text = gettext("Away"); colour = YELLOW; break; case TOX_USER_STATUS_BUSY: - status_text = "Busy"; + status_text = gettext("Busy"); colour = RED; break; } @@ -287,7 +293,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); } else { - wprintw(statusbar->topline, " [Offline]"); + wprintw(statusbar->topline, gettext(" [Offline]")); wattron(statusbar->topline, A_BOLD); wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); @@ -351,28 +357,28 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, uint32_t friendnu const char *msg; if (connection_status != TOX_CONNECTION_NONE && Friends.list[friendnum].connection_status == TOX_CONNECTION_NONE) { - msg = "has come online"; + msg = gettext("has come online"); line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - "%s has come online", nick ); + gettext("%s has come online"), nick ); else box_notify(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", "%s has come online", nick ); + "Toxic", gettext("%s has come online"), nick ); } else if (connection_status == TOX_CONNECTION_NONE) { - msg = "has gone offline"; + msg = gettext("has gone offline"); line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - "%s has gone offline", nick ); + gettext("%s has gone offline"), nick ); else box_notify(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", "%s has gone offline", nick ); + "Toxic", gettext("%s has gone offline"), nick ); } } @@ -383,18 +389,18 @@ static void prompt_onFriendRequest(ToxWindow *self, Tox *m, const char *key, con char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, "Friend request with the message '%s'", data); - write_to_log("Friend request with the message '%s'", "", ctx->log, true); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request with the message '%s'"), data); + write_to_log(gettext("Friend request with the message '%s'"), "", ctx->log, true); int n = add_friend_request(key, data); if (n == -1) { - const char *errmsg = "Friend request queue is full. Discarding request."; + const char *errmsg = gettext("Friend request queue is full. Discarding request."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/accept %d\" or \"/decline %d\"", n, n); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s %d\" or \"%s %d\""), "/accept", n, "/decline", n); sound_notify(self, generic_message, NT_WNDALERT_1 | NT_NOTIFWND, NULL); } @@ -423,8 +429,8 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m) nick[n_len] = '\0'; statusmsg[s_len] = '\0'; - if (s_len == 0 || !strncmp(statusmsg, "Toxing on Toxic", strlen("Toxing on Toxic"))) { - snprintf(statusmsg, sizeof(statusmsg), "Toxing on Toxic"); + if (s_len == 0 || !strncmp(statusmsg, gettext("Toxing on Toxic"), strlen(gettext("Toxing on Toxic")))) { + snprintf(statusmsg, sizeof(statusmsg), gettext("Toxing on Toxic")); s_len = strlen(statusmsg); statusmsg[s_len] = '\0'; } @@ -446,10 +452,10 @@ static void print_welcome_msg(ToxWindow *self) line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, BLUE, " |_| \\___/_/\\_\\___\\____| v." TOXICVER); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); - const char *msg = "Welcome to Toxic, a free, open source Tox-based instant messenging client."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); - msg = "Type \"/help\" for assistance. Further help may be found via the man page."; + const char *msg = gettext("Welcome to Toxic, a free, open source Tox-based instant messenging client."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); + msg = gettext("Type \"%s\" for assistance. Further help may be found via the man page."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg, "/help"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); } @@ -467,7 +473,7 @@ static void prompt_onInit(ToxWindow *self, Tox *m) ctx->hst = calloc(1, sizeof(struct history)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err("failed in prompt_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in prompt_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -505,7 +511,7 @@ ToxWindow new_prompt(void) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_prompt", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_prompt"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/toxic.c b/src/toxic.c index 9d14328..31154eb 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -40,6 +40,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include #include @@ -103,7 +109,7 @@ static void catch_SIGSEGV(int sig) { freopen("/dev/tty", "w", stderr); // make sure stderr is enabled since we may have disabled it endwin(); - fprintf(stderr, "Caught SIGSEGV: Aborting toxic session.\n"); + fprintf(stderr, gettext("Caught SIGSEGV: Aborting toxic session.\n")); exit(EXIT_FAILURE); } @@ -152,7 +158,7 @@ void exit_toxic_err(const char *errmsg, int errcode) { freopen("/dev/tty", "w", stderr); endwin(); - fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg); + fprintf(stderr, gettext("Toxic session aborted with error code %d (%s)\n"), errcode, errmsg); exit(EXIT_FAILURE); } @@ -162,12 +168,16 @@ static void init_term(void) if (!arg_opts.default_locale) { if (setlocale(LC_ALL, "") == NULL) - exit_toxic_err("Could not set your locale, please check your locale settings or " - "disable unicode support with the -d flag.", FATALERR_LOCALE_NOT_SET); + exit_toxic_err(gettext("Could not set your locale, please check your locale settings or " + "disable unicode support with the -d flag."), FATALERR_LOCALE_NOT_SET); } #endif +#ifndef NO_GETTEXT + textdomain("toxic"); +#endif + initscr(); cbreak(); keypad(stdscr, 1); @@ -218,12 +228,12 @@ static void queue_init_message(const char *msg, ...) char **new_msgs = realloc(init_messages.msgs, sizeof(char *) * init_messages.num); if (new_msgs == NULL) - exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); new_msgs[i] = malloc(MAX_STR_SIZE); if (new_msgs[i] == NULL) - exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); snprintf(new_msgs[i], MAX_STR_SIZE, "%s", frmt_msg); init_messages.msgs = new_msgs; @@ -315,14 +325,14 @@ int init_connection_helper(Tox *m, int line) tox_bootstrap(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, "Failed to bootstrap %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, gettext("Failed to bootstrap %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); return -1; } tox_add_tcp_relay(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, "Failed to add TCP relay %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, gettext("Failed to add TCP relay %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); return -1; } @@ -453,7 +463,7 @@ static void first_time_encrypt(const char *msg) bool valid_password = false; char passconfirm[MAX_PASSWORD_LEN + 1] = {0}; - printf("Enter a new password (must be at least %d characters) ", MIN_PASSWORD_LEN); + printf(gettext("Enter a new password (must be at least %d characters) "), MIN_PASSWORD_LEN); while (valid_password == false) { len = password_prompt(user_password.pass, sizeof(user_password.pass)); @@ -463,12 +473,12 @@ static void first_time_encrypt(const char *msg) exit(0); if (string_is_empty(passconfirm) && (len < MIN_PASSWORD_LEN || len > MAX_PASSWORD_LEN)) { - printf("Password must be between %d and %d characters long. ", MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); + printf(gettext("Password must be between %d and %d characters long. "), MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); continue; } if (string_is_empty(passconfirm)) { - printf("Enter password again "); + printf(gettext("Enter password again ")); snprintf(passconfirm, sizeof(passconfirm), "%s", user_password.pass); continue; } @@ -476,14 +486,14 @@ static void first_time_encrypt(const char *msg) if (strcmp(user_password.pass, passconfirm) != 0) { memset(passconfirm, 0, sizeof(passconfirm)); memset(user_password.pass, 0, sizeof(user_password.pass)); - printf("Passwords don't match. Try again. "); + printf(gettext("Passwords don't match. Try again. ")); continue; } valid_password = true; } - queue_init_message("Data file '%s' is encrypted", DATA_FILE); + queue_init_message(gettext("Data file '%s' is encrypted"), DATA_FILE); memset(passconfirm, 0, sizeof(passconfirm)); user_password.data_is_encrypted = true; } @@ -520,7 +530,7 @@ int store_data(Tox *m, const char *path) (uint8_t *) enc_data, &err); if (err != TOX_ERR_ENCRYPTION_OK) { - fprintf(stderr, "tox_pass_encrypt() failed with error %d\n", err); + fprintf(stderr, gettext("tox_pass_encrypt() failed with error %d\n"), err); fclose(fp); return -1; } @@ -571,7 +581,7 @@ static void init_tox_options(struct Tox_Options *tox_opts) tox_opts->proxy_type = arg_opts.proxy_type; if (!tox_opts->ipv6_enabled) - queue_init_message("Forcing IPv4 connection"); + queue_init_message(gettext("Forcing IPv4 connection")); if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { tox_opts->proxy_port = arg_opts.proxy_port; @@ -579,16 +589,16 @@ static void init_tox_options(struct Tox_Options *tox_opts) const char *ps = tox_opts->proxy_type == TOX_PROXY_TYPE_SOCKS5 ? "SOCKS5" : "HTTP"; char tmp[48]; - snprintf(tmp, sizeof(tmp), "Using %s proxy %s : %d", ps, arg_opts.proxy_address, arg_opts.proxy_port); + snprintf(tmp, sizeof(tmp), gettext("Using %s proxy %s : %d"), ps, arg_opts.proxy_address, arg_opts.proxy_port); queue_init_message("%s", tmp); } if (!tox_opts->udp_enabled) { - queue_init_message("UDP disabled"); + queue_init_message(gettext("UDP disabled")); } else if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { - const char *msg = "WARNING: Using a proxy without disabling UDP may leak your real IP address."; + const char *msg = gettext("WARNING: Using a proxy without disabling UDP may leak your real IP address."); queue_init_message("%s", msg); - msg = "Use the -t option to disable UDP."; + msg = gettext("Use the -t option to disable UDP."); queue_init_message("%s", msg); } } @@ -607,14 +617,14 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (len == 0) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } char data[len]; if (fread(data, sizeof(data), 1, fp) != 1) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } bool is_encrypted = tox_is_data_encrypted((uint8_t *) data); @@ -622,13 +632,13 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW /* attempt to encrypt an already encrypted data file */ if (arg_opts.encrypt_data && is_encrypted) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_ENCRYPT); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_ENCRYPT); } if (arg_opts.unencrypt_data && is_encrypted) - queue_init_message("Data file '%s' has been unencrypted", data_path); + queue_init_message(gettext("Data file '%s' has been unencrypted"), data_path); else if (arg_opts.unencrypt_data) - queue_init_message("Warning: passed --unencrypt-data option with unencrypted data file '%s'", data_path); + queue_init_message(gettext("Warning: passed --unencrypt-data option with unencrypted data file '%s'"), data_path); if (is_encrypted) { if (!arg_opts.unencrypt_data) @@ -636,7 +646,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW size_t pwlen = 0; system("clear"); // TODO: is this portable? - printf("Enter password (q to quit) "); + printf(gettext("Enter password (\"%s\" to quit) "), "q"); size_t plain_len = len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH; char plain[plain_len]; @@ -653,7 +663,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (pwlen < MIN_PASSWORD_LEN) { system("clear"); sleep(1); - printf("Invalid password. Try again. "); + printf(gettext("Invalid password. Try again. ")); continue; } @@ -677,10 +687,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW } else if (pwerr == TOX_ERR_DECRYPTION_FAILED) { system("clear"); sleep(1); - printf("Invalid password. Try again. "); + printf(gettext("Invalid password. Try again. ")); } else { fclose(fp); - exit_toxic_err("tox_pass_decrypt() failed", pwerr); + exit_toxic_err(gettext("tox_pass_decrypt() failed"), pwerr); } } } else { /* data is not encrypted */ @@ -699,7 +709,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW fclose(fp); } else { /* Data file does not/should not exist */ if (file_exists(data_path)) - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); tox_opts->savedata_type = TOX_SAVEDATA_TYPE_NONE; @@ -709,7 +719,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW return NULL; if (store_data(m, data_path) == -1) - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } return m; @@ -724,23 +734,23 @@ static Tox *load_toxic(char *data_path) Tox *m = load_tox(data_path, &tox_opts, &new_err); if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { - queue_init_message("Falling back to ipv4"); + queue_init_message(gettext("Falling back to ipv4")); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); } if (!m) - exit_toxic_err("tox_new returned fatal error", new_err); + exit_toxic_err(gettext("tox_new returned fatal error"), new_err); if (new_err != TOX_ERR_NEW_OK) - queue_init_message("tox_new returned non-fatal error %d", new_err); + queue_init_message(gettext("tox_new returned non-fatal error %d"), new_err); init_tox_callbacks(m); load_friendlist(m); load_blocklist(BLOCK_FILE); if (tox_self_get_name_size(m) == 0) - tox_self_set_name(m, (uint8_t *) "Toxic User", strlen("Toxic User"), NULL); + tox_self_set_name(m, (uint8_t *) gettext("Toxic User"), strlen(gettext("Toxic User")), NULL); return m; } @@ -766,7 +776,7 @@ static void do_bootstrap(Tox *m) conn_err = init_connection(m); if (conn_err != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Auto-connect failed with error code %d", conn_err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Auto-connect failed with error code %d"), conn_err); } static void do_toxic(Tox *m, ToxWindow *prompt) @@ -847,21 +857,35 @@ void *thread_audio(void *data) static void print_usage(void) { - fprintf(stderr, "usage: toxic [OPTION] [FILE ...]\n"); - fprintf(stderr, " -4, --ipv4 Force IPv4 connection\n"); - fprintf(stderr, " -b, --debug Enable stderr for debugging\n"); - fprintf(stderr, " -c, --config Use specified config file\n"); - fprintf(stderr, " -d, --default-locale Use default POSIX locale\n"); - fprintf(stderr, " -e, --encrypt-data Encrypt an unencrypted data file\n"); - fprintf(stderr, " -f, --file Use specified data file\n"); - fprintf(stderr, " -h, --help Show this message and exit\n"); - fprintf(stderr, " -n, --nodes Use specified DHTnodes file\n"); - fprintf(stderr, " -o, --noconnect Do not connect to the DHT network\n"); - fprintf(stderr, " -p, --SOCKS5-proxy Use SOCKS5 proxy: Requires [IP] [port]\n"); - fprintf(stderr, " -P, --HTTP-proxy Use HTTP proxy: Requires [IP] [port]\n"); - fprintf(stderr, " -r, --dnslist Use specified DNSservers file\n"); - fprintf(stderr, " -t, --force-tcp Force TCP connection (use this with proxies)\n"); - fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n"); + fprintf(stderr, gettext("usage: toxic [OPTION] [FILE ...]\n")); + fprintf(stderr, " -4, --ipv4 "); + fprintf(stderr, gettext("Force IPv4 connection\n")); + fprintf(stderr, " -b, --debug "); + fprintf(stderr, gettext("Enable stderr for debugging\n")); + fprintf(stderr, " -c, --config "); + fprintf(stderr, gettext("Use specified config file\n")); + fprintf(stderr, " -d, --default-locale "); + fprintf(stderr, gettext("Use default POSIX locale\n")); + fprintf(stderr, " -e, --encrypt-data "); + fprintf(stderr, gettext("Encrypt an unencrypted data file\n")); + fprintf(stderr, " -f, --file "); + fprintf(stderr, gettext("Use specified data file\n")); + fprintf(stderr, " -h, --help "); + fprintf(stderr, gettext("Show this message and exit\n")); + fprintf(stderr, " -n, --nodes "); + fprintf(stderr, gettext("Use specified DHTnodes file\n")); + fprintf(stderr, " -o, --noconnect "); + fprintf(stderr, gettext("Do not connect to the DHT network\n")); + fprintf(stderr, " -p, --SOCKS5-proxy "); + fprintf(stderr, gettext("Use SOCKS5 proxy: Requires [IP] [port]\n")); + fprintf(stderr, " -P, --HTTP-proxy "); + fprintf(stderr, gettext("Use HTTP proxy: Requires [IP] [port]\n")); + fprintf(stderr, " -r, --dnslist "); + fprintf(stderr, gettext("Use specified DNSservers file\n")); + fprintf(stderr, " -t, --force-tcp "); + fprintf(stderr, gettext("Force TCP connection (use this with proxies)\n")); + fprintf(stderr, " -u, --unencrypt-data "); + fprintf(stderr, gettext("Unencrypt an encrypted data file\n")); } static void set_default_opts(void) @@ -905,20 +929,20 @@ static void parse_args(int argc, char *argv[]) case 'b': arg_opts.debug = 1; - queue_init_message("stderr enabled"); + queue_init_message(gettext("stderr enabled")); break; case 'c': snprintf(arg_opts.config_path, sizeof(arg_opts.config_path), "%s", optarg); if (!file_exists(arg_opts.config_path)) - queue_init_message("Config file not found"); + queue_init_message(gettext("Config file not found")); break; case 'd': arg_opts.default_locale = 1; - queue_init_message("Using default POSIX locale"); + queue_init_message(gettext("Using default POSIX locale")); break; case 'e': @@ -931,12 +955,12 @@ static void parse_args(int argc, char *argv[]) BLOCK_FILE = malloc(strlen(optarg) + strlen("-blocklist") + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in parse_args", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in parse_args"), FATALERR_MEMORY); strcpy(BLOCK_FILE, optarg); strcat(BLOCK_FILE, "-blocklist"); - queue_init_message("Using '%s' data file", DATA_FILE); + queue_init_message(gettext("Using '%s' data file"), DATA_FILE); break; @@ -944,13 +968,13 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.nodes_path, sizeof(arg_opts.nodes_path), "%s", optarg); if (!file_exists(arg_opts.nodes_path)) - queue_init_message("DHTnodes file not found"); + queue_init_message(gettext("DHTnodes file not found")); break; case 'o': arg_opts.no_connect = 1; - queue_init_message("DHT disabled"); + queue_init_message(gettext("DHT disabled")); break; case 'p': @@ -958,7 +982,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err("Proxy error", FATALERR_PROXY); + exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -968,7 +992,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err("Proxy error", FATALERR_PROXY); + exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -977,7 +1001,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.dns_path, sizeof(arg_opts.dns_path), "%s", optarg); if (!file_exists(arg_opts.dns_path)) - queue_init_message("DNSservers file not found"); + queue_init_message(gettext("DNSservers file not found")); break; @@ -1012,13 +1036,13 @@ static int init_default_data_files(void) BLOCK_FILE = strdup(BLOCKNAME); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); } else { DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(DATANAME) + 1); BLOCK_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(BLOCKNAME) + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); strcpy(DATA_FILE, user_config_dir); strcat(DATA_FILE, CONFIGDIR); @@ -1074,7 +1098,7 @@ int main(int argc, char *argv[]) if (arg_opts.encrypt_data && arg_opts.unencrypt_data) { arg_opts.encrypt_data = 0; arg_opts.unencrypt_data = 0; - queue_init_message("Warning: Using --unencrypt-data and --encrypt-data simultaneously has no effect"); + queue_init_message(gettext("Warning: Using \"%s\" and \"%s\" simultaneously has no effect"), "--unencrypt-data", "--encrypt-data"); } /* Make sure all written files are read/writeable only by the current user. */ @@ -1087,23 +1111,23 @@ int main(int argc, char *argv[]) last_bootstrap_time = get_unix_time(); if (!datafile_exists && !arg_opts.unencrypt_data) - first_time_encrypt("Creating new data file. Would you like to encrypt it? Y/n (q to quit)"); + first_time_encrypt(gettext("Creating new data file. Would you like to encrypt it? Y/n (q to quit)")); else if (arg_opts.encrypt_data) - first_time_encrypt("Encrypt existing data file? Y/n (q to quit)"); + first_time_encrypt(gettext("Encrypt existing data file? Y/n (q to quit)")); /* init user_settings struct and load settings from conf file */ user_settings = calloc(1, sizeof(struct user_settings)); if (user_settings == NULL) - exit_toxic_err("failed in main", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in main"), FATALERR_MEMORY); const char *p = arg_opts.config_path[0] ? arg_opts.config_path : NULL; int settings_err = settings_load(user_settings, p); #ifdef X11 if (init_xtra(DnD_callback) == -1) - queue_init_message("X failed to initialize"); + queue_init_message(gettext("X failed to initialize")); #endif Tox *m = load_toxic(DATA_FILE); @@ -1119,14 +1143,14 @@ int main(int argc, char *argv[]) /* thread for ncurses stuff */ if (pthread_mutex_init(&Winthread.lock, NULL) != 0) - exit_toxic_err("failed in main", FATALERR_MUTEX_INIT); + exit_toxic_err(gettext("failed in main"), FATALERR_MUTEX_INIT); if (pthread_create(&Winthread.tid, NULL, thread_winref, (void *) m) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); /* thread for message queue */ if (pthread_create(&cqueue_thread.tid, NULL, thread_cqueue, (void *) m) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); #ifdef AUDIO @@ -1134,14 +1158,14 @@ int main(int argc, char *argv[]) /* audio thread */ if (pthread_create(&audio_thread.tid, NULL, thread_audio, (void *) av) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); set_primary_device(input, user_settings->audio_in_dev); set_primary_device(output, user_settings->audio_out_dev); #elif SOUND_NOTIFY if ( init_devices() == de_InternalError ) - queue_init_message("Failed to init audio devices"); + queue_init_message(gettext("Failed to init audio devices")); #endif /* AUDIO */ @@ -1150,16 +1174,16 @@ int main(int argc, char *argv[]) const char *msg; if (config_err) { - msg = "Unable to determine configuration directory. Defaulting to 'data' for data file..."; + msg = gettext("Unable to determine configuration directory. Defaulting to 'data' for data file..."); queue_init_message("%s", msg); } if (settings_err == -1) - queue_init_message("Failed to load user settings"); + queue_init_message(gettext("Failed to load user settings")); /* screen/tmux auto-away timer */ if (init_mplex_away_timer(m) == -1) - queue_init_message("Failed to init mplex auto-away."); + queue_init_message(gettext("Failed to init mplex auto-away.")); print_init_messages(prompt); cleanup_init_messages(); @@ -1182,7 +1206,7 @@ int main(int argc, char *argv[]) if (timed_out(last_save, cur_time, AUTOSAVE_FREQ)) { pthread_mutex_lock(&Winthread.lock); if (store_data(m, DATA_FILE) != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "WARNING: Failed to save to data file"); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("WARNING: Failed to save to data file")); pthread_mutex_unlock(&Winthread.lock); last_save = cur_time; diff --git a/src/toxic.h b/src/toxic.h index 6129fab..0adb759 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -40,8 +40,8 @@ #include -#define UNKNOWN_NAME "Anonymous" -#define DEFAULT_TOX_NAME "Tox User" /* should always be the same as toxcore's default name */ +#define UNKNOWN_NAME gettext("Anonymous") +#define DEFAULT_TOX_NAME gettext("Tox User") /* should always be the same as toxcore's default name */ #define MAX_STR_SIZE TOX_MAX_MESSAGE_LENGTH /* must be >= TOX_MAX_MESSAGE_LENGTH */ #define MAX_CMDNAME_SIZE 64 diff --git a/src/windows.c b/src/windows.c index de41a31..4075371 100644 --- a/src/windows.c +++ b/src/windows.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "friendlist.h" #include "prompt.h" #include "toxic.h" @@ -359,7 +365,7 @@ void set_next_window(int ch) return; if (active_window == inf) /* infinite loop check */ - exit_toxic_err("failed in set_next_window", FATALERR_INFLOOP); + exit_toxic_err(gettext("failed in set_next_window"), FATALERR_INFLOOP); } } @@ -381,7 +387,7 @@ ToxWindow *init_windows(Tox *m) int n_prompt = add_window(m, new_prompt()); if (n_prompt == -1 || add_window(m, new_friendlist()) == -1) - exit_toxic_err("failed in init_windows", FATALERR_WININIT); + exit_toxic_err(gettext("failed in init_windows"), FATALERR_WININIT); prompt = &windows[n_prompt]; active_window = prompt; diff --git a/translations/en.mo b/translations/en.mo new file mode 100644 index 0000000000000000000000000000000000000000..568b7c36e9ce8476974e819892c4bcf7bf981402 GIT binary patch literal 28476 zcmeI4dwiT#na5u)6$mYqYs>v@Av7&bn%dCqg5b9qmB?ASx!?(qu_^1M^wSx0)_4|raBqC!3I!>4)P5%3l`7k(0+2fqX_ zf`5ct;Dx7q-Zpq0JQscko($)l;dv*)7AXIEcsAS(o8appuk_yJ_;+wV{tv-p;l1z# z_z+Y%zksUGA-?C$hI63GIobJ}oqq*9hVZrU6xa(@-adF7d?h>+-T*t`9dI3d3O2*` z1)e7nTm~1y0#yDtL)GVlF8;Gn^?v{!4K8-R z_e~IydN)Cu>V3h5{{SlgQ}8JGJE-^0q7iDxG5pbcRzn|dhRUCFe52znu!ZpZpxW_k zcr-lxEbE^S={m2?`L{uu;$rzhY%_2 z?}BQ_?eHA0|ApbsB`lK(SM>0h$gw&P4F z|Ao$f1yuQEsQhn%8V7ekrTZ3?KKu%*zh*75?P-RJ-|QGd>BVcI+VOta2mcwW{Nrep znwNz>ydFwUw?Rbb zeHoI~d(!bFIvzNP_kAciJp~Vk zhmctMHyf&)7N~l4LbY=roD1IyRgasY?95$I^8F^%dwva-{;(Cc{AKWH{GE=MLcKq5 z{t2k|TnknHryc(V&cXjMRQjJf{~sKWSZVuZ9+cj6L8T8IBX}(SS3uS0%~0jv>3APh ze|!&0Z=QkD+j(@(QE&yE1v{bSu?gxud!WjBB~-iK1l7+sLfP3zpvpadwUx&zsDA8$ z>X!mky0=2r_Zv{55p7S ze?Yb8Id~$RbDq`nv!KR*H`M#K!Y()pRo<fb*?AD*$s*7IVh`VB#~YcJIM z-waVr?;oM${}?V0ES{ab}9{|2afeF$oteGaz6pF+w1#0zZvYA88uhAKA;CD+%% zUE2YzaO50{|P9$9Cjgd3_KPZ{fG1LUkbZn4l4a^P~+@=cryGgRJyrqZT(wd zKmOHF@4F7F{vUyo`{$wb;U`dXIdYwCZ!=VT)A2N}hfwu<1w0kL3+g?ecJW__%J(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Mfn~~h!p8b(sy>G3 zP=iZBwZO)8%jEuCHm+Nm{|Srv|5%vokf?{bQ+>ci&Bk@h I7r$=#e>0i$^8f$< literal 0 HcmV?d00001 diff --git a/translations/en.po b/translations/en.po new file mode 100644 index 0000000..d30b394 --- /dev/null +++ b/translations/en.po @@ -0,0 +1,1602 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Toxic 0.6.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-05-28 15:47+0200\n" +"PO-Revision-Date: 2015-05-26 11:37+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../src/audio_call.c:133 +msgid "Failed to init devices" +msgstr "Failed to init devices" + +#: ../src/audio_call.c:195 ../src/audio_call.c:201 +msgid "Could not prepare transmission" +msgstr "Could not prepare transmission" + +#: ../src/audio_call.c:217 +msgid "Failed to open input device!" +msgstr "Failed to open input device!" + +#: ../src/audio_call.c:222 +msgid "Failed to register input handler!" +msgstr "Failed to register input handler!" + +#: ../src/audio_call.c:226 +msgid "Failed to open output device!" +msgstr "Failed to open output device!" + +#: ../src/audio_call.c:284 ../src/audio_call.c:303 +msgid "Error starting transmission!" +msgstr "Error starting transmission!" + +#: ../src/audio_call.c:357 ../src/audio_call.c:392 ../src/audio_call.c:423 +#: ../src/audio_call.c:454 +msgid "Unknown arguments." +msgstr "Unknown arguments." + +#: ../src/audio_call.c:362 ../src/audio_call.c:397 ../src/audio_call.c:428 +#: ../src/audio_call.c:459 +msgid "Audio not supported!" +msgstr "Audio not supported!" + +#: ../src/audio_call.c:367 +msgid "Friend is offline." +msgstr "Friend is offline." + +#: ../src/audio_call.c:374 +msgid "Already in a call!" +msgstr "Already in a call!" + +#: ../src/audio_call.c:375 ../src/audio_call.c:406 ../src/audio_call.c:437 +#: ../src/audio_call.c:479 +msgid "Internal error!" +msgstr "Internal error!" + +#: ../src/audio_call.c:380 +#, c-format +msgid "Calling... idx: %d" +msgstr "Calling... idx: %d" + +#: ../src/audio_call.c:404 +msgid "Cannot answer in invalid state!" +msgstr "Cannot answer in invalid state!" + +#: ../src/audio_call.c:405 ../src/audio_call.c:436 +msgid "No incoming call!" +msgstr "No incoming call!" + +#: ../src/audio_call.c:432 +msgid "Why not?" +msgstr "Why not?" + +#: ../src/audio_call.c:435 +msgid "Cannot reject in invalid state!" +msgstr "Cannot reject in invalid state!" + +#: ../src/audio_call.c:467 +msgid "Only those who appreciate small things know the beauty that is life" +msgstr "Only those who appreciate small things know the beauty that is life" + +#: ../src/audio_call.c:471 ../src/chat.c:653 +msgid "Call canceled!" +msgstr "Call canceled!" + +#: ../src/audio_call.c:477 +msgid "Cannot hangup in invalid state!" +msgstr "Cannot hangup in invalid state!" + +#: ../src/audio_call.c:478 +msgid "No call!" +msgstr "No call!" + +#: ../src/audio_call.c:494 ../src/audio_call.c:526 ../src/audio_call.c:570 +#: ../src/audio_call.c:643 +msgid "Type must be specified!" +msgstr "Type must be specified!" + +#: ../src/audio_call.c:495 +msgid "Only one argument allowed!" +msgstr "Only one argument allowed!" + +#: ../src/audio_call.c:509 ../src/audio_call.c:542 ../src/audio_call.c:586 +#: ../src/audio_call.c:658 +#, c-format +msgid "Invalid type: %s" +msgstr "Invalid type: %s" + +#: ../src/audio_call.c:527 ../src/audio_call.c:571 +msgid "Must have id!" +msgstr "Must have id!" + +#: ../src/audio_call.c:528 ../src/audio_call.c:572 ../src/audio_call.c:644 +#: ../src/audio_call.c:690 +msgid "Only two arguments allowed!" +msgstr "Only two arguments allowed!" + +#: ../src/audio_call.c:551 ../src/audio_call.c:595 ../src/audio_call.c:699 +msgid "Invalid input" +msgstr "Invalid input" + +#: ../src/audio_call.c:556 ../src/audio_call.c:600 +msgid "Invalid selection!" +msgstr "Invalid selection!" + +#: ../src/audio_call.c:689 +msgid "Must have value!" +msgstr "Must have value!" + +#: ../src/audio_call.c:728 +msgid "Not interested anymore" +msgstr "Not interested anymore" + +#: ../src/audio_call.c:731 +msgid "Not interested" +msgstr "Not interested" + +#: ../src/autocomplete.c:126 +msgid "failed in complete_line" +msgstr "failed in complete_line" + +#: ../src/avatars.c:68 +#, c-format +msgid "tox_file_send failed for friendnumber %d (error %d)\n" +msgstr "tox_file_send failed for friendnumber %d (error %d)\n" + +#: ../src/avatars.c:212 +#, c-format +msgid "tox_file_send_chunk failed in avatar callback (error %d)\n" +msgstr "tox_file_send_chunk failed in avatar callback (error %d)\n" + +#: ../src/chat.c:56 +msgid "yes" +msgstr "yes" + +#: ../src/chat.c:57 +msgid "no" +msgstr "no" + +#: ../src/chat.c:223 ../src/prompt.c:360 +msgid "has come online" +msgstr "has come online" + +#: ../src/chat.c:234 ../src/prompt.c:372 +msgid "has gone offline" +msgstr "has gone offline" + +#: ../src/chat.c:319 +#, c-format +msgid "File '%s' successfully sent." +msgstr "File '%s' successfully sent." + +#: ../src/chat.c:326 +#, c-format +msgid "File transfer for '%s' failed: Null file pointer." +msgstr "File transfer for '%s' failed: Null file pointer." + +#: ../src/chat.c:333 +#, c-format +msgid "File transfer for '%s' failed: Seek fail." +msgstr "File transfer for '%s' failed: Seek fail." + +#: ../src/chat.c:345 +#, c-format +msgid "File transfer for '%s' failed: Read fail." +msgstr "File transfer for '%s' failed: Read fail." + +#: ../src/chat.c:354 +#, c-format +msgid "tox_file_send_chunk failed in chat callback (error %d)\n" +msgstr "tox_file_send_chunk failed in chat callback (error %d)\n" + +#: ../src/chat.c:377 +#, c-format +msgid "File '%s' successfully received." +msgstr "File '%s' successfully received." + +#: ../src/chat.c:384 +#, c-format +msgid "File transfer for '%s' failed: Invalid file pointer." +msgstr "File transfer for '%s' failed: Invalid file pointer." + +#: ../src/chat.c:390 +#, c-format +msgid "File transfer for '%s' failed: Write fail." +msgstr "File transfer for '%s' failed: Write fail." + +#: ../src/chat.c:416 +#, c-format +msgid "File transfer [%d] for '%s' accepted." +msgstr "File transfer [%d] for '%s' accepted." + +#: ../src/chat.c:434 +#, c-format +msgid "File transfer for '%s' was aborted." +msgstr "File transfer for '%s' was aborted." + +#: ../src/chat.c:450 ../src/chat_commands.c:309 +msgid "File transfer failed: Too many concurrent file transfers." +msgstr "File transfer failed: Too many concurrent file transfers." + +#: ../src/chat.c:456 +#, c-format +msgid "File transfer request for '%s' (%s)" +msgstr "File transfer request for '%s' (%s)" + +#: ../src/chat.c:471 +msgid "File transfer faield: File path too long." +msgstr "File transfer faield: File path too long." + +#: ../src/chat.c:497 +msgid "File transfer failed: invalid file path." +msgstr "File transfer failed: invalid file path." + +#: ../src/chat.c:502 +#, c-format +msgid "Type '%s %d' to accept the file transfer." +msgstr "Type '%s %d' to accept the file transfer." + +#: ../src/chat.c:515 ../src/chat.c:518 +#, c-format +msgid "Incoming file: %s" +msgstr "Incoming file: %s" + +#: ../src/chat.c:533 +msgid "Failed in chat_onGroupInvite" +msgstr "Failed in chat_onGroupInvite" + +#: ../src/chat.c:547 ../src/chat.c:549 +msgid "invites you to join group chat" +msgstr "invites you to join group chat" + +#: ../src/chat.c:551 +#, c-format +msgid "%s has invited you to a group chat." +msgstr "%s has invited you to a group chat." + +#: ../src/chat.c:552 +#, c-format +msgid "Type \"%s\" to join the chat." +msgstr "Type \"%s\" to join the chat." + +#: ../src/chat.c:566 +#, c-format +msgid "Incoming audio call! Type: \"%s\" or \"%s\"" +msgstr "Incoming audio call! Type: \"%s\" or \"%s\"" + +#: ../src/chat.c:573 ../src/chat.c:575 +msgid "Incoming audio call!" +msgstr "Incoming audio call!" + +#: ../src/chat.c:583 +#, c-format +msgid "Ringing...type \"%s\" to cancel it." +msgstr "Ringing...type \"%s\" to cancel it." + +#: ../src/chat.c:598 ../src/chat.c:639 +#, c-format +msgid "Call started! Type: \"%s\" to end it." +msgstr "Call started! Type: \"%s\" to end it." + +#: ../src/chat.c:612 ../src/chat.c:680 +msgid "Call ended!" +msgstr "Call ended!" + +#: ../src/chat.c:625 +msgid "Error!" +msgstr "Error!" + +#: ../src/chat.c:666 +msgid "Rejected!" +msgstr "Rejected!" + +#: ../src/chat.c:693 +msgid "No answer!" +msgstr "No answer!" + +#: ../src/chat.c:707 +msgid "Peer disconnected; call ended!" +msgstr "Peer disconnected; call ended!" + +#: ../src/chat.c:769 +msgid " Call Active\n" +msgstr " Call Active\n" + +#: ../src/chat.c:773 +msgid " Duration: " +msgstr " Duration: " + +#: ../src/chat.c:778 +msgid " In muted: " +msgstr " In muted: " + +#: ../src/chat.c:783 +msgid " Out muted: " +msgstr " Out muted: " + +#: ../src/chat.c:788 +msgid " VAD level: " +msgstr " VAD level: " + +#: ../src/chat.c:1080 +msgid "failed in chat_onInit" +msgstr "failed in chat_onInit" + +#: ../src/chat.c:1152 +msgid "failed in new_chat" +msgstr "failed in new_chat" + +#: ../src/chat_commands.c:48 +#, c-format +msgid "Requires type %s and the file ID." +msgstr "Requires type %s and the file ID." + +#: ../src/chat_commands.c:57 ../src/chat_commands.c:74 +#: ../src/chat_commands.c:79 +msgid "Invalid file ID." +msgstr "Invalid file ID." + +#: ../src/chat_commands.c:69 +#, c-format +msgid "Type must be '%s' or '%s'." +msgstr "Type must be '%s' or '%s'." + +#: ../src/chat_commands.c:83 +#, c-format +msgid "File transfer for '%s' aborted." +msgstr "File transfer for '%s' aborted." + +#: ../src/chat_commands.c:90 +msgid "Group number required." +msgstr "Group number required." + +#: ../src/chat_commands.c:97 +msgid "Invalid group number." +msgstr "Invalid group number." + +#: ../src/chat_commands.c:102 +msgid "Failed to invite contact to group." +msgstr "Failed to invite contact to group." + +#: ../src/chat_commands.c:106 +#, c-format +msgid "Invited contact to Group %d." +msgstr "Invited contact to Group %d." + +#: ../src/chat_commands.c:112 ../src/global_commands.c:324 +msgid " * Warning: Too many windows are open." +msgstr " * Warning: Too many windows are open." + +#: ../src/chat_commands.c:121 +msgid "No pending group chat invite." +msgstr "No pending group chat invite." + +#: ../src/chat_commands.c:136 ../src/global_commands.c:354 +msgid "Group chat instance failed to initialize." +msgstr "Group chat instance failed to initialize." + +#: ../src/chat_commands.c:141 ../src/global_commands.c:359 +msgid "Group chat window failed to initialize." +msgstr "Group chat window failed to initialize." + +#: ../src/chat_commands.c:151 +msgid "File ID required." +msgstr "File ID required." + +#: ../src/chat_commands.c:158 ../src/chat_commands.c:165 +#: ../src/chat_commands.c:170 +msgid "No pending file transfers with that ID." +msgstr "No pending file transfers with that ID." + +#: ../src/chat_commands.c:175 +msgid "File transfer failed: Invalid file path." +msgstr "File transfer failed: Invalid file path." + +#: ../src/chat_commands.c:186 +#, c-format +msgid "Saving file [%d] as: '%s'" +msgstr "Saving file [%d] as: '%s'" + +#: ../src/chat_commands.c:201 +msgid "File transfer failed: Friend not found." +msgstr "File transfer failed: Friend not found." + +#: ../src/chat_commands.c:205 +msgid "File transfer failed: Friend is not online." +msgstr "File transfer failed: Friend is not online." + +#: ../src/chat_commands.c:209 +msgid "File transfer failed: Invalid filenumber." +msgstr "File transfer failed: Invalid filenumber." + +#: ../src/chat_commands.c:213 +msgid "File transfer failed: Connection error." +msgstr "File transfer failed: Connection error." + +#: ../src/chat_commands.c:217 +#, c-format +msgid "File transfer failed (error %d)\n" +msgstr "File transfer failed (error %d)\n" + +#: ../src/chat_commands.c:227 +msgid "File path required." +msgstr "File path required." + +#: ../src/chat_commands.c:232 +msgid "File path must be enclosed in quotes." +msgstr "File path must be enclosed in quotes." + +#: ../src/chat_commands.c:243 +msgid "File path exceeds character limit." +msgstr "File path exceeds character limit." + +#: ../src/chat_commands.c:250 +msgid "File not found." +msgstr "File not found." + +#: ../src/chat_commands.c:257 +msgid "Invalid file." +msgstr "Invalid file." + +#: ../src/chat_commands.c:290 +#, c-format +msgid "Sending file [%d]: '%s' (%s)" +msgstr "Sending file [%d]: '%s' (%s)" + +#: ../src/chat_commands.c:297 +msgid "File transfer failed: Invalid friend." +msgstr "File transfer failed: Invalid friend." + +#: ../src/chat_commands.c:301 +msgid "File transfer failed: Friend is offline." +msgstr "File transfer failed: Friend is offline." + +#: ../src/chat_commands.c:305 +msgid "File transfer failed: Filename is too long." +msgstr "File transfer failed: Filename is too long." + +#: ../src/chat_commands.c:313 +msgid "File transfer failed." +msgstr "File transfer failed." + +#: ../src/configdir.c:125 ../src/toxic.c:1039 ../src/toxic.c:1045 +msgid "failed in load_data_structures" +msgstr "failed in load_data_structures" + +#: ../src/dns.c:155 +#, c-format +msgid "User lookup failed: %s" +msgstr "User lookup failed: %s" + +#: ../src/dns.c:181 +msgid "dn_expand failed." +msgstr "dn_expand failed." + +#: ../src/dns.c:186 ../src/dns.c:209 +msgid "DNS reply was too short." +msgstr "DNS reply was too short." + +#: ../src/dns.c:192 +msgid "Broken DNS reply." +msgstr "Broken DNS reply." + +#: ../src/dns.c:204 +msgid "Second dn_expand failed." +msgstr "Second dn_expand failed." + +#: ../src/dns.c:217 +msgid "RR overflow." +msgstr "RR overflow." + +#: ../src/dns.c:222 +msgid "DNS response failed." +msgstr "DNS response failed." + +#: ../src/dns.c:227 +msgid "No record found." +msgstr "No record found." + +#: ../src/dns.c:230 +msgid "Invalid DNS response." +msgstr "Invalid DNS response." + +#: ../src/dns.c:307 +msgid "Must be a Tox ID or an address in the form username@domain" +msgstr "Must be a Tox ID or an address in the form username@domain" + +#: ../src/dns.c:317 +msgid "Domain not found." +msgstr "Domain not found." + +#: ../src/dns.c:324 +msgid "Core failed to create DNS object." +msgstr "Core failed to create DNS object." + +#: ../src/dns.c:335 +msgid "Core failed to generate DNS3 string." +msgstr "Core failed to generate DNS3 string." + +#: ../src/dns.c:349 +msgid "DNS query failed." +msgstr "DNS query failed." + +#: ../src/dns.c:364 +msgid "Bad DNS3 TXT response." +msgstr "Bad DNS3 TXT response." + +#: ../src/dns.c:372 +msgid "Core failed to decrypt DNS response." +msgstr "Core failed to decrypt DNS response." + +#: ../src/dns.c:388 +msgid "DNS lookups are disabled." +msgstr "DNS lookups are disabled." + +#: ../src/dns.c:393 +msgid "Please wait for previous user lookup to finish." +msgstr "Please wait for previous user lookup to finish." + +#: ../src/dns.c:403 +#, c-format +msgid "" +"DNS server list failed to load with error code %d. Falling back to hard-" +"coded list." +msgstr "" +"DNS server list failed to load with error code %d. Falling back to hard-" +"coded list." + +#: ../src/dns.c:416 +msgid "Error: DNS thread attr failed to init" +msgstr "Error: DNS thread attr failed to init" + +#: ../src/dns.c:422 +msgid "Error: DNS thread attr failed to set" +msgstr "Error: DNS thread attr failed to set" + +#: ../src/dns.c:429 +msgid "Error: DNS thread failed to init" +msgstr "Error: DNS thread failed to init" + +#: ../src/execute.c:107 +msgid "failed in parse_command" +msgstr "failed in parse_command" + +#: ../src/execute.c:121 +msgid "Invalid argument. Did you forget a closing \"?" +msgstr "Invalid argument. Did you forget a closing \"?" + +#: ../src/execute.c:192 +msgid "Invalid command." +msgstr "Invalid command." + +#: ../src/friendlist.c:93 +msgid "failed in realloc_friends" +msgstr "failed in realloc_friends" + +#: ../src/friendlist.c:113 +msgid "failed in realloc_blocklist" +msgstr "failed in realloc_blocklist" + +#: ../src/friendlist.c:141 +msgid "Failed in save_blocklist" +msgstr "Failed in save_blocklist" + +#: ../src/friendlist.c:208 +msgid "Failed in load_blocklist" +msgstr "Failed in load_blocklist" + +#: ../src/friendlist.c:331 ../src/friendlist.c:766 ../src/friendlist.c:1076 +msgid "* Warning: Too many windows are open." +msgstr "* Warning: Too many windows are open." + +#: ../src/friendlist.c:346 +#, c-format +msgid "avatar_send failed for friend %d\n" +msgstr "avatar_send failed for friend %d\n" + +#: ../src/friendlist.c:421 +#, c-format +msgid "tox_friend_get_public_key failed (error %d)\n" +msgstr "tox_friend_get_public_key failed (error %d)\n" + +#: ../src/friendlist.c:500 +#, c-format +msgid "* File transfer from %s failed: too many windows are open." +msgstr "* File transfer from %s failed: too many windows are open." + +#: ../src/friendlist.c:523 +#, c-format +msgid "* Group chat invite from %s failed: too many windows are open." +msgstr "* Group chat invite from %s failed: too many windows are open." + +#: ../src/friendlist.c:546 +#, c-format +msgid "tox_friend_delete failed with error %d\n" +msgstr "tox_friend_delete failed with error %d\n" + +#: ../src/friendlist.c:626 +msgid "Delete contact " +msgstr "Delete contact " + +#: ../src/friendlist.c:707 +#, c-format +msgid "Failed to unblock friend (error %d)\n" +msgstr "Failed to unblock friend (error %d)\n" + +#: ../src/friendlist.c:803 +msgid " Blocked: " +msgstr " Blocked: " + +#: ../src/friendlist.c:855 ../src/friendlist.c:1035 +msgid "Key: " +msgstr "Key: " + +#: ../src/friendlist.c:881 +msgid " Press the" +msgstr " Press the" + +#: ../src/friendlist.c:885 +msgid "" +"key for help\n" +"\n" +msgstr "" +"key for help\n" +"\n" + +#: ../src/friendlist.c:897 +msgid " Online: " +msgstr " Online: " + +#: ../src/friendlist.c:1011 +#, c-format +msgid " Last seen: Today %s\n" +msgstr " Last seen: Today %s\n" + +#: ../src/friendlist.c:1015 +#, c-format +msgid " Last seen: Yesterday %s\n" +msgstr " Last seen: Yesterday %s\n" + +#: ../src/friendlist.c:1019 +#, c-format +msgid " Last seen: %d days ago\n" +msgstr " Last seen: %d days ago\n" + +#: ../src/friendlist.c:1023 +msgid " Last seen: Never\n" +msgstr " Last seen: Never\n" + +#: ../src/friendlist.c:1074 +#, c-format +msgid "Audio action from: %s!" +msgstr "Audio action from: %s!" + +#: ../src/friendlist.c:1126 +msgid "failed in new_friendlist" +msgstr "failed in new_friendlist" + +#: ../src/friendlist.c:1129 +msgid "contacts" +msgstr "contacts" + +#: ../src/global_commands.c:55 ../src/global_commands.c:292 +msgid "Request ID required." +msgstr "Request ID required." + +#: ../src/global_commands.c:62 ../src/global_commands.c:67 +#: ../src/global_commands.c:299 ../src/global_commands.c:304 +msgid "No pending friend request with that ID." +msgstr "No pending friend request with that ID." + +#: ../src/global_commands.c:75 +#, fuzzy, c-format +#| msgid "" +#| "Failed to add friend (error %d\n" +#| ")" +msgid "Failed to add friend (error %d)\n" +msgstr "" +"Failed to add friend (error %d\n" +")" + +#: ../src/global_commands.c:78 +msgid "Friend request accepted." +msgstr "Friend request accepted." + +#: ../src/global_commands.c:105 +msgid "Message is too long." +msgstr "Message is too long." + +#: ../src/global_commands.c:109 +msgid "Please add a message to your request." +msgstr "Please add a message to your request." + +#: ../src/global_commands.c:113 +msgid "That appears to be your own ID." +msgstr "That appears to be your own ID." + +#: ../src/global_commands.c:117 +msgid "Friend request has already been sent." +msgstr "Friend request has already been sent." + +#: ../src/global_commands.c:121 +msgid "Bad checksum in address." +msgstr "Bad checksum in address." + +#: ../src/global_commands.c:125 +msgid "Nospam was different." +msgstr "Nospam was different." + +#: ../src/global_commands.c:129 +msgid "Core memory allocation failed." +msgstr "Core memory allocation failed." + +#: ../src/global_commands.c:133 +msgid "Friend request sent." +msgstr "Friend request sent." + +#: ../src/global_commands.c:140 +msgid "Failed to add friend: Unknown error." +msgstr "Failed to add friend: Unknown error." + +#: ../src/global_commands.c:150 +msgid "Tox ID or address required." +msgstr "Tox ID or address required." + +#: ../src/global_commands.c:159 +msgid "Message must be enclosed in quotes." +msgstr "Message must be enclosed in quotes." + +#: ../src/global_commands.c:175 +#, c-format +msgid "Hello, my name is %s. Care to Tox?" +msgstr "Hello, my name is %s. Care to Tox?" + +#: ../src/global_commands.c:193 +msgid "Invalid Tox ID." +msgstr "Invalid Tox ID." + +#: ../src/global_commands.c:210 +msgid "Avatar is not set." +msgstr "Avatar is not set." + +#: ../src/global_commands.c:215 +msgid "Path must be enclosed in quotes." +msgstr "Path must be enclosed in quotes." + +#: ../src/global_commands.c:225 +msgid "Invalid path." +msgstr "Invalid path." + +#: ../src/global_commands.c:235 +#, c-format +msgid "" +"Failed to set avatar. Avatars must be in PNG format and may not exceed %d " +"bytes." +msgstr "" +"Failed to set avatar. Avatars must be in PNG format and may not exceed %d " +"bytes." + +#: ../src/global_commands.c:240 +#, c-format +msgid "Avatar set to '%s'" +msgstr "Avatar set to '%s'" + +#: ../src/global_commands.c:252 +msgid "Require: " +msgstr "Require: " + +#: ../src/global_commands.c:261 +msgid "Invalid port." +msgstr "Invalid port." + +#: ../src/global_commands.c:274 +msgid "Bootstrap failed: Invalid IP." +msgstr "Bootstrap failed: Invalid IP." + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "Bootstrap failed: Invalid port." + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "Bootstrap failed." + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "Please specify group type: %s" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "Valid group types are: %s" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "Group chat [%d] created." + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "Logging for this window is ON. Type \"/log off\" to disable." + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "Logging for this window is OFF. Type \"/log on\" to enable." + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "Logging enabled" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "Logging disabled" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "Invalid option. Use \"%s\" to toggle logging." + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "Input required." + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "Invalid name." + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "Note must be enclosed in quotes." + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "No pending friend requests." + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "Require a status. Statuses are: %s." + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "Invalid status. Valid statuses are: %s." + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "Title is set to: %s" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "Title is not set" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "Title must be enclosed in quotes." + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "Failed to set title." + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr " set the group title to: %s" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "set title to %s" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "failed in init_groupchat_win" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "Group Audio failed to init\n" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "failed in copy_peernames" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "has joined the room" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "has left the room" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr " is now known as " + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "is now known as %s" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "Invalid syntax.\n" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr " * Failed to send action." + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr " * Failed to send message." + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "Peers: %d\n" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "failed in groupchat_onInit" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "source: %d, queued: %d, processed: %d\n" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "dvhandle is null)\n" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "ctx is null\n" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "write: %d\n" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "Group %d" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "failed in new_group_chat" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "Global Commands:\n" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "Add contact with optional message\n" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "Accept friend request\n" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "Set an avatar (leave path empty to unset)\n" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "Decline friend request\n" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "List pending friend requests\n" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "Manually connect to a DHT node\n" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "Set status with optional note\n" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "Set a personal note\n" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "Set your nickname\n" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "Enable/disable logging\n" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "Create a group chat where type: text | audio\n" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "Print your Tox ID\n" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "Clear window history\n" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "Close the current chat window\n" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "Exit Toxic\n" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" +"\n" +" Audio:\n" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "List devices where type:" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "Set active device\n" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "Chat Commands:\n" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "Invite contact to a group chat\n" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "Join a pending group chat\n" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "Send a file\n" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "Receive a file\n" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "Cancel file transfer where type:" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "Audio call\n" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "Answer incoming call\n" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "Reject incoming call\n" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "Hangup active call\n" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "Change active device\n" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "Mute active device if in call\n" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "VAD sensitivity threshold\n" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "Key bindings:\n" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "Navigate through the tabs\n" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "Scroll window history one line\n" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "Scroll window history half a page\n" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "Move to the bottom of window history\n" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "Scroll peer list in groupchats\n" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" +"Toggle the groupchat peerlist\n" +"\n" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "Group commands:\n" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" +"Set group title (show current title if no msg)\n" +"\n" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "Friendlist controls:\n" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr " Up and Down arrows : Scroll through list\n" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" +" Enter : Open a chat window with selected contact\n" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr " Delete : Permanently delete a contact\n" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "Block or unblock a contact\n" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "failed in line_info_init" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "failed in line_info_add" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "failed in load_chat_history" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr " * Failed to read log file" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "failed in cqueue_message" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "failed in get_file_name" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "Failed to set note (error %d)\n" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "ERROR" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "Online" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "Away" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "Busy" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr " [Offline]" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "%s has come online" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "%s has gone offline" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "Friend request with the message '%s'" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "Friend request queue is full. Discarding request." + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "Type \"%s %d\" or \"%s %d\"" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "Toxing on Toxic" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" +"Type \"%s\" for assistance. Further help may be found via the man page." + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "failed in prompt_onInit" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "failed in new_prompt" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "Caught SIGSEGV: Aborting toxic session.\n" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "Toxic session aborted with error code %d (%s)\n" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "Failed in queue_init_message" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "Failed to bootstrap %s:%d\n" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "Failed to add TCP relay %s:%d\n" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "Enter a new password (must be at least %d characters) " + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "Password must be between %d and %d characters long. " + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "Enter password again " + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "Passwords don't match. Try again. " + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "Data file '%s' is encrypted" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "tox_pass_encrypt() failed with error %d\n" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "Forcing IPv4 connection" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "Using %s proxy %s : %d" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "UDP disabled" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "Use the -t option to disable UDP." + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "failed in load_toxic" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "Data file '%s' has been unencrypted" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" +"Warning: passed --unencrypt-data option with unencrypted data file '%s'" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "Enter password (\"%s\" to quit) " + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "Invalid password. Try again. " + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "tox_pass_decrypt() failed" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "Falling back to ipv4" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "tox_new returned fatal error" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "tox_new returned non-fatal error %d" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "Toxic User" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "Auto-connect failed with error code %d" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "usage: toxic [OPTION] [FILE ...]\n" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "Force IPv4 connection\n" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "Enable stderr for debugging\n" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "Use specified config file\n" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "Use default POSIX locale\n" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "Encrypt an unencrypted data file\n" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "Use specified data file\n" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "Show this message and exit\n" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "Use specified DHTnodes file\n" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "Do not connect to the DHT network\n" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "Use SOCKS5 proxy: Requires [IP] [port]\n" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "Use HTTP proxy: Requires [IP] [port]\n" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "Use specified DNSservers file\n" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "Force TCP connection (use this with proxies)\n" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "Unencrypt an encrypted data file\n" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "stderr enabled" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "Config file not found" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "Using default POSIX locale" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "failed in parse_args" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "Using '%s' data file" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "DHTnodes file not found" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "DHT disabled" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "Proxy error" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "DNSservers file not found" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "Encrypt existing data file? Y/n (q to quit)" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "failed in main" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "X failed to initialize" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "Failed to init audio devices" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "Failed to load user settings" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "Failed to init mplex auto-away." + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "WARNING: Failed to save to data file" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "" + +#: ../src/toxic.h:44 +#, fuzzy +#| msgid "Toxic User" +msgid "Tox User" +msgstr "Toxic User" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "failed in set_next_window" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "failed in init_windows" diff --git a/translations/it.mo b/translations/it.mo new file mode 100644 index 0000000000000000000000000000000000000000..a7aaff16b0085e79ff2c15ad3b6dfc55088ae8ba GIT binary patch literal 30657 zcmb8237j2Oo$pIgkY-)uW} z!yCtCaCr#m;Kq#NiaO|fD&jIDE)$3JuEYe3zPf@gsA5N$Sb|O!IQvy!DGSC zfX@cM0jmBZp!#u$Z|fZc9?tz~?tU3~4EN`Qr-GY6wKD-82e!fIfUf`t!1sZdf)9Z` zVDA#o(~!4<-Cz||{g;7y?_Hq!^A1qu{ti^XzXBc)eiziZeg&%D$uuHd4n6~12ddr% zP~*G~R6kpw`h5ooNxip$4AuLTd;Wb;^?wB(2|f<$y$3TGjptbY(R)^dJ~#xb{*4Y_ z>F{sCr9A%vsB!!nJPJJYx%U2KkSX(4xcgy{p?Fo0|GZlq-V3VSmmU5BjJQ7%BKCoM z!HwWOpyuac@I>$lQ1f^UMACTA0Y!(kpy;;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strap failed: Invalid IP." +msgstr "Bootstrap fallito: IP non valido." + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "Bootstrap fallito: porta non valida." + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "Bootstrap fallito." + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "Specifica il tipo di chat di gruppo: %s" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "I tipi di chat di gruppo permessi sono: %s" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "Chat di gruppo [%d] creata." + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "" +"La cronologia chat per questa finestra è ON. Usa \"/log off\" per " +"disabilitarla." + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "" +"La cronologia chat per questa finestra è OFF. Usa \"/log on\" per abilitarla." + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "Cronologia chat abilitata" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "Cronologia chat disabilitata" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "Opzione non valida. Usa \"%s\" per impostare la cronologia chat." + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "Input richiesto." + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "Nome non valido." + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "Il messaggio di stato deve essere tra virgolette." + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "Nessuna richiesta d'amicizia in sospeso." + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "Richiede uno stato. Gli stati sono: %s." + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "Stato non valido. Gli stati disponibilit sono: %s." + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "Titolo impostato a: \"%s\"" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "Titolo non impostato" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "Il titolo deve essere tra virgolette." + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "Errore nell'impostare il titolo." + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr " ha impostato il titolo a: \"%s\"" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "ha impostato il titolo a \"%s\"" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "errore in \"init_groupchat_win\"" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "Inizializzazione fallita delle chat di gruppo audio\n" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "errore in \"copy_peernames\"" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "è entrato nella chat" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "ha lasciato la chat" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr " è ora conosciuto come " + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "è ora conosciuto come %s" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "Sintassi non valida.\n" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr " * Errore nell'inviare l'azione." + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr " * Errore nell'inviare il messaggio." + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "Utenti: %d\n" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "errore in \"groupchat_onInit\"" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "sorgente: %d, coda: %d, processati: %d\n" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "\"dvhandle\" è null)\n" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "\"ctx\" è null\n" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "scritto: %d\n" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "Chat di gruppo %d" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "errore in \"new_group_chat\"" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "Comandi Globali:\n" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "Aggiungi contatto con un messaggio opzionale\n" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "Accetta richiesta d'amicizia\n" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "Imposta un avatar (lascia vuoto per resettare)\n" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "Rifiuta richiesta d'amicizia\n" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "Mostra le richieste d'amicizia in sospeso\n" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "Connettiti manualmente ad un nodo DHT\n" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "Imposta lo stato con un messaggio opzionale\n" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "Imposta il messaggio di stato\n" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "Imposta il nickname\n" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "Abilita/disabilita cronologia chat\n" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "Crea una caht di gruppo di tipo: text|audio\n" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "Mostra il tuo Tox ID\n" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "Pulisce la cronologia della finestra\n" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "Chiude la fiestra di chat corrente\n" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "Esce da Toxic\n" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" +"\n" +" Audio:\n" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "Mostra i dispositivi di tipo:" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "Imposta il device attivo\n" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "Comandi Chat:\n" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "Invita un contatto ad una chat di gruppo\n" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "Unisciti ad una chat di gruppo a cui sei stato invitato\n" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "Invia un file\n" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "Accetta la ricezione di un file\n" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "Annulla trasferimento file di tipo:" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "Chiamata audio\n" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "Rispondi ad una chiamata\n" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "Rifiuta una chiamata\n" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "Termina una chiamata attiva\n" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "Cambia il dispositivo attivo\n" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "Disabilita il dispositivo attivo mentre sei in una chiamata\n" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "Sensibilità VAD\n" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "Mappatura tasti:\n" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "Naviga tra le schede\n" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "Scorri la cronologia della finestra di una riga\n" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "Scorri la cronologia della finestra di metà pagina\n" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "Vai in fondo alla finestra\n" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "Scorre la lista utenti nelle chat di gruppo\n" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" +"Mostra/nasconde la lista degli utenti nelle chat di gruppo\n" +"\n" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" +" (Nota: mappature personalizzate sovrascrivono i defaults.)\n" +"\n" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "Comandi chat di gruppo:\n" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" +"Imposta il titolo (mostra il titolo corrente se non è specificato niente)\n" +"\n" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "Controllo lista contatti:\n" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr " Frecce Su e Giù : Scorri la lista\n" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" +" Frecce Destra e Sinistra : Cambia tra lista contatti e lista " +"bloccati\n" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" +" Invio : Apre una finestra di chat con il contatto " +"selezionato\n" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr "" +" Canc : Elimina un contatto definitivamente\n" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "Blocca o sblocca un contatto\n" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "errore in \"line_info_init\"" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "errore in \"line_info_add\"" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "errore in \"load_chat_history\"" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr " * Errore nel leggere il file della cronologia chat" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "errore in \"cqueue_message\"" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "errore in \"get_file_name\"" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "Errore nell'impostare il messaggio di stato (errore %d)\n" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "ERRORE" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "Online" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "Assente" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "Occupato" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr " [Offline]" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "%s si è connesso" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "%s si è disconnesso" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "Richiesta d'amicizia con il messaggio '%s'" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "Coda delle richieste d'amicizia piena. Richiesta scartata." + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "Scrivi \"%s %d\" o \"%s %d\"" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "Toxing on Toxic" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "Benvenuto in Toxic, un client gratis e open source per la rete Tox." + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" +"Usa \"%s\" per ricevere assistenza. Ulteriori aiuto può essere ottenuto " +"attraverso la pagina di manuale." + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "errore in \"prompt_onInit\"" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "errore in \"new_prompt\"" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "Ricevuto segnale SIGSEGV: chiudo sessione.\n" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "Sessio ciusa con errore %d (%s)\n" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" +"Impossibile impostare la localizzazione, controlla le impostazione o " +"disabilita il supporto unicode con l'opzione \"-d\"." + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "errore in \"queue_init_message\"" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "Bootstrap fallito %s:%d\n" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "Errore aggiungendo relay TCP %s:%d\n" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "Inserisci una nuova password (deve contenere almeno %d caratteri) " + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "La password deve essere lunga tra %d e %d caratteri. " + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "Reinserisci password " + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "Le passwords non corrispondono. Riprova. " + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "Il file dati '%s' è criptato" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "\"tox_pass_encrypt()\" fallita con errore %d\n" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "Forzata connessione IPv4" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "Uso %s proxy %s:%d" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "UDP disabilitato" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" +"ATTENZIONE: usare un proxy senza disabilitare UDP potrebbe portare alla " +"rivelazione del tuo vero IP." + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "Usa l'optione \"-t\" per disabilitare UDP." + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "errore in \"load_toxic\"" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "Il file di dati '%s' è stato decriptato" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" +"Attenzione: opzione \"--unencrypt-data\" usata con un file di dati non " +"criptato (%s)" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "Inserisci password (\"%s\" per uscire) " + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "Password errata. Riprova. " + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "\"tox_pass_decrypt()\" fallita" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "Ritorno a IPv4" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "\"tox_new\" ha ritornato un errore fatale" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "\"tox_new\" ha ritornato un errore non fatale %d" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "Utente Toxic" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "Connessione automatica fallita con errore %d" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "uso: toxic [OPZIONE] [FILE...]\n" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "Forza connessioni IPv4\n" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "Abilita stderr per il debugging\n" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "Usa il file di configurazione specificato\n" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "Usa localizzazione POSIX di default\n" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "Cripta un file di dati non criptato\n" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "Usa il file di dati specificato\n" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "Mostra questo messaggio ed esce\n" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "Usa il file DHTnodes specificato\n" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "Non si connette alla rete DHT\n" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "Usa proxy SOCKS5: richiede [IP] [porta]\n" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "Usa proxy HTTP: richiede [IP] [porta]\n" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "Usa il file DNSservers specificato\n" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "Forza connessioni TCP (usa questa opzione per i proxies)\n" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "Decripta un file di dati criptato\n" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "stderr abilitato" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "File di configurazione non trovato" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "Uso localizzazione POSIX di default" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "erorre in \"parse_args\"" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "Uso il file di dati '%s'" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "File DHTnodes non trovato" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "DHT disabilitato" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "Errore proxy" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "File DNSservers non trovato" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "Attenzione: usando \"%s\" e \"%s\" simultaneamente non avrà effetto" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "" +"Creazione di un nuovo file di dati. Vuoi criptarlo? Y/n (\"q\" per uscire)" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "Criptare il file di dati esistente? Y/n (\"q\" per uscire)" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "errore in \"main\"" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "Errore inizializzazione X" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "Inizializzazione dispositivi audio fallita" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" +"Impossibile determinare la directory delle configurazioni. Uso 'data' come " +"file di dati..." + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "Errore nel caricamento delle impostazioni utente" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "Errore nell'inizializzazione di mplex auto-away." + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "ATTENZIONE: salvataggio file di dati fallito" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "Anonimo" + +#: ../src/toxic.h:44 +msgid "Tox User" +msgstr "Utente Toxic" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "errore in \"set_next_window\"" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "errore in \"init_windows\"" diff --git a/translations/tools/create_mo.sh b/translations/tools/create_mo.sh new file mode 100755 index 0000000..b0de40c --- /dev/null +++ b/translations/tools/create_mo.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale (for example \"en\"): " + read loc +done + +cd .. + +if [ ! -e "$loc.po" ]; then + echo "File \"$loc.po\" not found" + echo "The translation file must exist" + exit 1 +else + msgfmt -c -o $loc.mo $loc.po +fi diff --git a/translations/tools/create_po.sh b/translations/tools/create_po.sh new file mode 100755 index 0000000..05b8747 --- /dev/null +++ b/translations/tools/create_po.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale to create (for example \"en\"): " + read loc +done + +cd .. + +if [ -e "$loc.po" ]; then + echo "File \"$loc.po\" found" + echo "The translation file must not exist" + exit 1 +else + msginit --no-translator -l $loc -o $loc.po -i toxic.pot + v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ") + sed -e '1,5{/^#/d;}' $loc.po > $loc.po.tmp && mv $loc.po.tmp $loc.po + sed -e 's/.*Project-Id-Version:.*/"Project-Id-Version: Toxic '"$v"'\\n"/' $loc.po > $loc.po.tmp && mv $loc.po.tmp $loc.po +fi diff --git a/translations/tools/update_po.sh b/translations/tools/update_po.sh new file mode 100755 index 0000000..ee352ff --- /dev/null +++ b/translations/tools/update_po.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale to update (for example \"en\"): " + read loc +done + +cd .. + +if [ ! -e "$loc.po" ]; then + echo "File \"$loc.po\" not found" + echo "The translation file must exist" + exit 1 +else + msgmerge -U --backup=none --previous $loc.po toxic.pot +fi diff --git a/translations/tools/update_pot.sh b/translations/tools/update_pot.sh new file mode 100755 index 0000000..c9acc2b --- /dev/null +++ b/translations/tools/update_pot.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd $(dirname $0)/.. +xgettext -d toxic -o toxic.pot ../src/* diff --git a/translations/toxic.pot b/translations/toxic.pot new file mode 100644 index 0000000..f7fa00d --- /dev/null +++ b/translations/toxic.pot @@ -0,0 +1,1574 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-05-28 15:47+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/audio_call.c:133 +msgid "Failed to init devices" +msgstr "" + +#: ../src/audio_call.c:195 ../src/audio_call.c:201 +msgid "Could not prepare transmission" +msgstr "" + +#: ../src/audio_call.c:217 +msgid "Failed to open input device!" +msgstr "" + +#: ../src/audio_call.c:222 +msgid "Failed to register input handler!" +msgstr "" + +#: ../src/audio_call.c:226 +msgid "Failed to open output device!" +msgstr "" + +#: ../src/audio_call.c:284 ../src/audio_call.c:303 +msgid "Error starting transmission!" +msgstr "" + +#: ../src/audio_call.c:357 ../src/audio_call.c:392 ../src/audio_call.c:423 +#: ../src/audio_call.c:454 +msgid "Unknown arguments." +msgstr "" + +#: ../src/audio_call.c:362 ../src/audio_call.c:397 ../src/audio_call.c:428 +#: ../src/audio_call.c:459 +msgid "Audio not supported!" +msgstr "" + +#: ../src/audio_call.c:367 +msgid "Friend is offline." +msgstr "" + +#: ../src/audio_call.c:374 +msgid "Already in a call!" +msgstr "" + +#: ../src/audio_call.c:375 ../src/audio_call.c:406 ../src/audio_call.c:437 +#: ../src/audio_call.c:479 +msgid "Internal error!" +msgstr "" + +#: ../src/audio_call.c:380 +#, c-format +msgid "Calling... idx: %d" +msgstr "" + +#: ../src/audio_call.c:404 +msgid "Cannot answer in invalid state!" +msgstr "" + +#: ../src/audio_call.c:405 ../src/audio_call.c:436 +msgid "No incoming call!" +msgstr "" + +#: ../src/audio_call.c:432 +msgid "Why not?" +msgstr "" + +#: ../src/audio_call.c:435 +msgid "Cannot reject in invalid state!" +msgstr "" + +#: ../src/audio_call.c:467 +msgid "Only those who appreciate small things know the beauty that is life" +msgstr "" + +#: ../src/audio_call.c:471 ../src/chat.c:653 +msgid "Call canceled!" +msgstr "" + +#: ../src/audio_call.c:477 +msgid "Cannot hangup in invalid state!" +msgstr "" + +#: ../src/audio_call.c:478 +msgid "No call!" +msgstr "" + +#: ../src/audio_call.c:494 ../src/audio_call.c:526 ../src/audio_call.c:570 +#: ../src/audio_call.c:643 +msgid "Type must be specified!" +msgstr "" + +#: ../src/audio_call.c:495 +msgid "Only one argument allowed!" +msgstr "" + +#: ../src/audio_call.c:509 ../src/audio_call.c:542 ../src/audio_call.c:586 +#: ../src/audio_call.c:658 +#, c-format +msgid "Invalid type: %s" +msgstr "" + +#: ../src/audio_call.c:527 ../src/audio_call.c:571 +msgid "Must have id!" +msgstr "" + +#: ../src/audio_call.c:528 ../src/audio_call.c:572 ../src/audio_call.c:644 +#: ../src/audio_call.c:690 +msgid "Only two arguments allowed!" +msgstr "" + +#: ../src/audio_call.c:551 ../src/audio_call.c:595 ../src/audio_call.c:699 +msgid "Invalid input" +msgstr "" + +#: ../src/audio_call.c:556 ../src/audio_call.c:600 +msgid "Invalid selection!" +msgstr "" + +#: ../src/audio_call.c:689 +msgid "Must have value!" +msgstr "" + +#: ../src/audio_call.c:728 +msgid "Not interested anymore" +msgstr "" + +#: ../src/audio_call.c:731 +msgid "Not interested" +msgstr "" + +#: ../src/autocomplete.c:126 +msgid "failed in complete_line" +msgstr "" + +#: ../src/avatars.c:68 +#, c-format +msgid "tox_file_send failed for friendnumber %d (error %d)\n" +msgstr "" + +#: ../src/avatars.c:212 +#, c-format +msgid "tox_file_send_chunk failed in avatar callback (error %d)\n" +msgstr "" + +#: ../src/chat.c:56 +msgid "yes" +msgstr "" + +#: ../src/chat.c:57 +msgid "no" +msgstr "" + +#: ../src/chat.c:223 ../src/prompt.c:360 +msgid "has come online" +msgstr "" + +#: ../src/chat.c:234 ../src/prompt.c:372 +msgid "has gone offline" +msgstr "" + +#: ../src/chat.c:319 +#, c-format +msgid "File '%s' successfully sent." +msgstr "" + +#: ../src/chat.c:326 +#, c-format +msgid "File transfer for '%s' failed: Null file pointer." +msgstr "" + +#: ../src/chat.c:333 +#, c-format +msgid "File transfer for '%s' failed: Seek fail." +msgstr "" + +#: ../src/chat.c:345 +#, c-format +msgid "File transfer for '%s' failed: Read fail." +msgstr "" + +#: ../src/chat.c:354 +#, c-format +msgid "tox_file_send_chunk failed in chat callback (error %d)\n" +msgstr "" + +#: ../src/chat.c:377 +#, c-format +msgid "File '%s' successfully received." +msgstr "" + +#: ../src/chat.c:384 +#, c-format +msgid "File transfer for '%s' failed: Invalid file pointer." +msgstr "" + +#: ../src/chat.c:390 +#, c-format +msgid "File transfer for '%s' failed: Write fail." +msgstr "" + +#: ../src/chat.c:416 +#, c-format +msgid "File transfer [%d] for '%s' accepted." +msgstr "" + +#: ../src/chat.c:434 +#, c-format +msgid "File transfer for '%s' was aborted." +msgstr "" + +#: ../src/chat.c:450 ../src/chat_commands.c:309 +msgid "File transfer failed: Too many concurrent file transfers." +msgstr "" + +#: ../src/chat.c:456 +#, c-format +msgid "File transfer request for '%s' (%s)" +msgstr "" + +#: ../src/chat.c:471 +msgid "File transfer faield: File path too long." +msgstr "" + +#: ../src/chat.c:497 +msgid "File transfer failed: invalid file path." +msgstr "" + +#: ../src/chat.c:502 +#, c-format +msgid "Type '%s %d' to accept the file transfer." +msgstr "" + +#: ../src/chat.c:515 ../src/chat.c:518 +#, c-format +msgid "Incoming file: %s" +msgstr "" + +#: ../src/chat.c:533 +msgid "Failed in chat_onGroupInvite" +msgstr "" + +#: ../src/chat.c:547 ../src/chat.c:549 +msgid "invites you to join group chat" +msgstr "" + +#: ../src/chat.c:551 +#, c-format +msgid "%s has invited you to a group chat." +msgstr "" + +#: ../src/chat.c:552 +#, c-format +msgid "Type \"%s\" to join the chat." +msgstr "" + +#: ../src/chat.c:566 +#, c-format +msgid "Incoming audio call! Type: \"%s\" or \"%s\"" +msgstr "" + +#: ../src/chat.c:573 ../src/chat.c:575 +msgid "Incoming audio call!" +msgstr "" + +#: ../src/chat.c:583 +#, c-format +msgid "Ringing...type \"%s\" to cancel it." +msgstr "" + +#: ../src/chat.c:598 ../src/chat.c:639 +#, c-format +msgid "Call started! Type: \"%s\" to end it." +msgstr "" + +#: ../src/chat.c:612 ../src/chat.c:680 +msgid "Call ended!" +msgstr "" + +#: ../src/chat.c:625 +msgid "Error!" +msgstr "" + +#: ../src/chat.c:666 +msgid "Rejected!" +msgstr "" + +#: ../src/chat.c:693 +msgid "No answer!" +msgstr "" + +#: ../src/chat.c:707 +msgid "Peer disconnected; call ended!" +msgstr "" + +#: ../src/chat.c:769 +msgid " Call Active\n" +msgstr "" + +#: ../src/chat.c:773 +msgid " Duration: " +msgstr "" + +#: ../src/chat.c:778 +msgid " In muted: " +msgstr "" + +#: ../src/chat.c:783 +msgid " Out muted: " +msgstr "" + +#: ../src/chat.c:788 +msgid " VAD level: " +msgstr "" + +#: ../src/chat.c:1080 +msgid "failed in chat_onInit" +msgstr "" + +#: ../src/chat.c:1152 +msgid "failed in new_chat" +msgstr "" + +#: ../src/chat_commands.c:48 +#, c-format +msgid "Requires type %s and the file ID." +msgstr "" + +#: ../src/chat_commands.c:57 ../src/chat_commands.c:74 +#: ../src/chat_commands.c:79 +msgid "Invalid file ID." +msgstr "" + +#: ../src/chat_commands.c:69 +#, c-format +msgid "Type must be '%s' or '%s'." +msgstr "" + +#: ../src/chat_commands.c:83 +#, c-format +msgid "File transfer for '%s' aborted." +msgstr "" + +#: ../src/chat_commands.c:90 +msgid "Group number required." +msgstr "" + +#: ../src/chat_commands.c:97 +msgid "Invalid group number." +msgstr "" + +#: ../src/chat_commands.c:102 +msgid "Failed to invite contact to group." +msgstr "" + +#: ../src/chat_commands.c:106 +#, c-format +msgid "Invited contact to Group %d." +msgstr "" + +#: ../src/chat_commands.c:112 ../src/global_commands.c:324 +msgid " * Warning: Too many windows are open." +msgstr "" + +#: ../src/chat_commands.c:121 +msgid "No pending group chat invite." +msgstr "" + +#: ../src/chat_commands.c:136 ../src/global_commands.c:354 +msgid "Group chat instance failed to initialize." +msgstr "" + +#: ../src/chat_commands.c:141 ../src/global_commands.c:359 +msgid "Group chat window failed to initialize." +msgstr "" + +#: ../src/chat_commands.c:151 +msgid "File ID required." +msgstr "" + +#: ../src/chat_commands.c:158 ../src/chat_commands.c:165 +#: ../src/chat_commands.c:170 +msgid "No pending file transfers with that ID." +msgstr "" + +#: ../src/chat_commands.c:175 +msgid "File transfer failed: Invalid file path." +msgstr "" + +#: ../src/chat_commands.c:186 +#, c-format +msgid "Saving file [%d] as: '%s'" +msgstr "" + +#: ../src/chat_commands.c:201 +msgid "File transfer failed: Friend not found." +msgstr "" + +#: ../src/chat_commands.c:205 +msgid "File transfer failed: Friend is not online." +msgstr "" + +#: ../src/chat_commands.c:209 +msgid "File transfer failed: Invalid filenumber." +msgstr "" + +#: ../src/chat_commands.c:213 +msgid "File transfer failed: Connection error." +msgstr "" + +#: ../src/chat_commands.c:217 +#, c-format +msgid "File transfer failed (error %d)\n" +msgstr "" + +#: ../src/chat_commands.c:227 +msgid "File path required." +msgstr "" + +#: ../src/chat_commands.c:232 +msgid "File path must be enclosed in quotes." +msgstr "" + +#: ../src/chat_commands.c:243 +msgid "File path exceeds character limit." +msgstr "" + +#: ../src/chat_commands.c:250 +msgid "File not found." +msgstr "" + +#: ../src/chat_commands.c:257 +msgid "Invalid file." +msgstr "" + +#: ../src/chat_commands.c:290 +#, c-format +msgid "Sending file [%d]: '%s' (%s)" +msgstr "" + +#: ../src/chat_commands.c:297 +msgid "File transfer failed: Invalid friend." +msgstr "" + +#: ../src/chat_commands.c:301 +msgid "File transfer failed: Friend is offline." +msgstr "" + +#: ../src/chat_commands.c:305 +msgid "File transfer failed: Filename is too long." +msgstr "" + +#: ../src/chat_commands.c:313 +msgid "File transfer failed." +msgstr "" + +#: ../src/configdir.c:125 ../src/toxic.c:1039 ../src/toxic.c:1045 +msgid "failed in load_data_structures" +msgstr "" + +#: ../src/dns.c:155 +#, c-format +msgid "User lookup failed: %s" +msgstr "" + +#: ../src/dns.c:181 +msgid "dn_expand failed." +msgstr "" + +#: ../src/dns.c:186 ../src/dns.c:209 +msgid "DNS reply was too short." +msgstr "" + +#: ../src/dns.c:192 +msgid "Broken DNS reply." +msgstr "" + +#: ../src/dns.c:204 +msgid "Second dn_expand failed." +msgstr "" + +#: ../src/dns.c:217 +msgid "RR overflow." +msgstr "" + +#: ../src/dns.c:222 +msgid "DNS response failed." +msgstr "" + +#: ../src/dns.c:227 +msgid "No record found." +msgstr "" + +#: ../src/dns.c:230 +msgid "Invalid DNS response." +msgstr "" + +#: ../src/dns.c:307 +msgid "Must be a Tox ID or an address in the form username@domain" +msgstr "" + +#: ../src/dns.c:317 +msgid "Domain not found." +msgstr "" + +#: ../src/dns.c:324 +msgid "Core failed to create DNS object." +msgstr "" + +#: ../src/dns.c:335 +msgid "Core failed to generate DNS3 string." +msgstr "" + +#: ../src/dns.c:349 +msgid "DNS query failed." +msgstr "" + +#: ../src/dns.c:364 +msgid "Bad DNS3 TXT response." +msgstr "" + +#: ../src/dns.c:372 +msgid "Core failed to decrypt DNS response." +msgstr "" + +#: ../src/dns.c:388 +msgid "DNS lookups are disabled." +msgstr "" + +#: ../src/dns.c:393 +msgid "Please wait for previous user lookup to finish." +msgstr "" + +#: ../src/dns.c:403 +#, c-format +msgid "" +"DNS server list failed to load with error code %d. Falling back to hard-" +"coded list." +msgstr "" + +#: ../src/dns.c:416 +msgid "Error: DNS thread attr failed to init" +msgstr "" + +#: ../src/dns.c:422 +msgid "Error: DNS thread attr failed to set" +msgstr "" + +#: ../src/dns.c:429 +msgid "Error: DNS thread failed to init" +msgstr "" + +#: ../src/execute.c:107 +msgid "failed in parse_command" +msgstr "" + +#: ../src/execute.c:121 +msgid "Invalid argument. Did you forget a closing \"?" +msgstr "" + +#: ../src/execute.c:192 +msgid "Invalid command." +msgstr "" + +#: ../src/friendlist.c:93 +msgid "failed in realloc_friends" +msgstr "" + +#: ../src/friendlist.c:113 +msgid "failed in realloc_blocklist" +msgstr "" + +#: ../src/friendlist.c:141 +msgid "Failed in save_blocklist" +msgstr "" + +#: ../src/friendlist.c:208 +msgid "Failed in load_blocklist" +msgstr "" + +#: ../src/friendlist.c:331 ../src/friendlist.c:766 ../src/friendlist.c:1076 +msgid "* Warning: Too many windows are open." +msgstr "" + +#: ../src/friendlist.c:346 +#, c-format +msgid "avatar_send failed for friend %d\n" +msgstr "" + +#: ../src/friendlist.c:421 +#, c-format +msgid "tox_friend_get_public_key failed (error %d)\n" +msgstr "" + +#: ../src/friendlist.c:500 +#, c-format +msgid "* File transfer from %s failed: too many windows are open." +msgstr "" + +#: ../src/friendlist.c:523 +#, c-format +msgid "* Group chat invite from %s failed: too many windows are open." +msgstr "" + +#: ../src/friendlist.c:546 +#, c-format +msgid "tox_friend_delete failed with error %d\n" +msgstr "" + +#: ../src/friendlist.c:626 +msgid "Delete contact " +msgstr "" + +#: ../src/friendlist.c:707 +#, c-format +msgid "Failed to unblock friend (error %d)\n" +msgstr "" + +#: ../src/friendlist.c:803 +msgid " Blocked: " +msgstr "" + +#: ../src/friendlist.c:855 ../src/friendlist.c:1035 +msgid "Key: " +msgstr "" + +#: ../src/friendlist.c:881 +msgid " Press the" +msgstr "" + +#: ../src/friendlist.c:885 +msgid "" +"key for help\n" +"\n" +msgstr "" + +#: ../src/friendlist.c:897 +msgid " Online: " +msgstr "" + +#: ../src/friendlist.c:1011 +#, c-format +msgid " Last seen: Today %s\n" +msgstr "" + +#: ../src/friendlist.c:1015 +#, c-format +msgid " Last seen: Yesterday %s\n" +msgstr "" + +#: ../src/friendlist.c:1019 +#, c-format +msgid " Last seen: %d days ago\n" +msgstr "" + +#: ../src/friendlist.c:1023 +msgid " Last seen: Never\n" +msgstr "" + +#: ../src/friendlist.c:1074 +#, c-format +msgid "Audio action from: %s!" +msgstr "" + +#: ../src/friendlist.c:1126 +msgid "failed in new_friendlist" +msgstr "" + +#: ../src/friendlist.c:1129 +msgid "contacts" +msgstr "" + +#: ../src/global_commands.c:55 ../src/global_commands.c:292 +msgid "Request ID required." +msgstr "" + +#: ../src/global_commands.c:62 ../src/global_commands.c:67 +#: ../src/global_commands.c:299 ../src/global_commands.c:304 +msgid "No pending friend request with that ID." +msgstr "" + +#: ../src/global_commands.c:75 +#, c-format +msgid "Failed to add friend (error %d)\n" +msgstr "" + +#: ../src/global_commands.c:78 +msgid "Friend request accepted." +msgstr "" + +#: ../src/global_commands.c:105 +msgid "Message is too long." +msgstr "" + +#: ../src/global_commands.c:109 +msgid "Please add a message to your request." +msgstr "" + +#: ../src/global_commands.c:113 +msgid "That appears to be your own ID." +msgstr "" + +#: ../src/global_commands.c:117 +msgid "Friend request has already been sent." +msgstr "" + +#: ../src/global_commands.c:121 +msgid "Bad checksum in address." +msgstr "" + +#: ../src/global_commands.c:125 +msgid "Nospam was different." +msgstr "" + +#: ../src/global_commands.c:129 +msgid "Core memory allocation failed." +msgstr "" + +#: ../src/global_commands.c:133 +msgid "Friend request sent." +msgstr "" + +#: ../src/global_commands.c:140 +msgid "Failed to add friend: Unknown error." +msgstr "" + +#: ../src/global_commands.c:150 +msgid "Tox ID or address required." +msgstr "" + +#: ../src/global_commands.c:159 +msgid "Message must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:175 +#, c-format +msgid "Hello, my name is %s. Care to Tox?" +msgstr "" + +#: ../src/global_commands.c:193 +msgid "Invalid Tox ID." +msgstr "" + +#: ../src/global_commands.c:210 +msgid "Avatar is not set." +msgstr "" + +#: ../src/global_commands.c:215 +msgid "Path must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:225 +msgid "Invalid path." +msgstr "" + +#: ../src/global_commands.c:235 +#, c-format +msgid "" +"Failed to set avatar. Avatars must be in PNG format and may not exceed %d " +"bytes." +msgstr "" + +#: ../src/global_commands.c:240 +#, c-format +msgid "Avatar set to '%s'" +msgstr "" + +#: ../src/global_commands.c:252 +msgid "Require: " +msgstr "" + +#: ../src/global_commands.c:261 +msgid "Invalid port." +msgstr "" + +#: ../src/global_commands.c:274 +msgid "Bootstrap failed: Invalid IP." +msgstr "" + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "" + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "" + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "" + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "" + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "" + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "" + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "" + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "" + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "" + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "" + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "" + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "" + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "" + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr "" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr "" + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr "" + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr "" + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr "" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr "" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr "" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr "" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "" + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "" + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "" + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "" + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "" + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "" + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "" + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "" + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "" + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "" + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "" + +#: ../src/toxic.h:44 +msgid "Tox User" +msgstr "" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "" From 51a1c660b4639765aff83f9ba75fae53d6bd51e7 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Mon, 25 May 2015 16:38:52 +0200 Subject: [PATCH 15/33] Add localization system (gettext) --- INSTALL.md | 53 +- cfg/checks/check_features.mk | 6 + cfg/global_vars.mk | 5 + cfg/systems/Darwin.mk | 6 + cfg/targets/help.mk | 1 + cfg/targets/install.mk | 11 + src/audio_call.c | 118 +-- src/autocomplete.c | 8 +- src/avatars.c | 10 +- src/chat.c | 101 +- src/chat_commands.c | 78 +- src/configdir.c | 8 +- src/dns.c | 52 +- src/execute.c | 12 +- src/friendlist.c | 60 +- src/global_commands.c | 112 ++- src/group_commands.c | 18 +- src/groupchat.c | 46 +- src/help.c | 143 ++- src/line_info.c | 10 +- src/log.c | 12 +- src/message_queue.c | 8 +- src/misc_tools.c | 10 +- src/prompt.c | 52 +- src/toxic.c | 176 ++-- src/toxic.h | 4 +- src/windows.c | 10 +- translations/en.mo | Bin 0 -> 28644 bytes translations/en.po | 1599 +++++++++++++++++++++++++++++ translations/it.mo | Bin 0 -> 30657 bytes translations/it.po | 1607 ++++++++++++++++++++++++++++++ translations/tools/create_mo.sh | 19 + translations/tools/create_po.sh | 23 + translations/tools/update_po.sh | 19 + translations/tools/update_pot.sh | 12 + translations/toxic.pot | 1574 +++++++++++++++++++++++++++++ 36 files changed, 5546 insertions(+), 437 deletions(-) create mode 100644 translations/en.mo create mode 100644 translations/en.po create mode 100644 translations/it.mo create mode 100644 translations/it.po create mode 100755 translations/tools/create_mo.sh create mode 100755 translations/tools/create_po.sh create mode 100755 translations/tools/update_po.sh create mode 100755 translations/tools/update_pot.sh create mode 100644 translations/toxic.pot diff --git a/INSTALL.md b/INSTALL.md index 4e96a30..49fbb8b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -3,6 +3,10 @@ * [OS X Notes](#deps_osx) * [Compiling](#compiling) * [Documentation](#docs) +* [Translating](#langs) + * [Create new translation 1: PO file](#new_lang_1) + * [Create new translation 2: MO file](#new_lang_2) + * [Update existing translation](#upd_lang) * [Notes](#notes) * [Compilation variables](#comp_vars) * [Packaging](#packaging) @@ -20,20 +24,23 @@ | [OpenALUT](http://openal.org) | SOUND NOTIFICATIONS | libalut-dev | | [LibNotify](https://developer.gnome.org/libnotify) | DESKTOP NOTIFICATIONS | libnotify-dev | | [AsciiDoc](http://asciidoc.org/index.html) | DOCUMENTATION1 | asciidoc | -1: see [Documentation](#docs) +| [Gettext](https://www.gnu.org/software/gettext) | LOCALIZATION2 | gettext | +1: see [Documentation](#docs)
+2: see [Translating](#langs)
#### OS X Notes Using [Homebrew](http://brew.sh): ``` -brew install openal-soft freealut libconfig +brew install openal-soft freealut libconfig gettext brew install https://raw.githubusercontent.com/Tox/homebrew-tox/master/Formula/libtoxcore.rb brew install https://raw.githubusercontent.com/Homebrew/homebrew-x11/master/libnotify.rb +brew link gettext ``` You can omit `libnotify` if you intend to build without desktop notifications enabled. - + ## Compiling ``` make PREFIX="/where/to/install" @@ -46,6 +53,45 @@ Run `make doc` in the build directory after editing the asciidoc files to regene **NOTE FOR DEVELOPERS**: asciidoc files and generated manpages will need to be commited together.
**NOTE FOR EVERYONE**: [asciidoc](http://asciidoc.org/index.html) (and this step) is only required for regenerating manpages when you modify them. +
+## Translating +Toxic uses gettext to localize some strings in various languages.
+These notes are for people who want help translating toxic in new languages (or improve an existing translation).
+The following example shows how to create/update german translation (de). + +
+#### Create new translation 1: PO file +To start a new translation, you can use the [provided script](translations/tools/create_po.sh): +``` +cd toxic-src/translations/tools +./create_po.sh +Insert locale to create (for example "en"): de +Created de.po. +``` +Now you can proceed to translate `toxic-src/translations/de.po`. + + +#### Create new translation 2: MO file +When you fully translated the PO file, you are ready to create the MO (Machine Object) file.
+Again you can use the [provided script](translations/tools/create_mo.sh) to achieve this: +``` +cd toxic-src/translations/tools +./create_mo.sh +Insert locale (for example "en"): de +``` + +
+#### Update existing translation +When the toxic sources are updated, you probably need to update your translation as well.
+To do so use the [provided script](translations/tools/update_po.sh) to update the PO file: +``` +cd toxic-src/translations/tools +./update_po.sh +Insert locale to update (for example "en"): de +..................................... done. +``` +Then you need to translate new/changed strings and after you fully updated the PO file, create the MO file as described [above](#new_lang_2). +
## Notes @@ -58,6 +104,7 @@ Run `make doc` in the build directory after editing the asciidoc files to regene * `DISABLE_AV=1` → build toxic without audio call support * `DISABLE_SOUND_NOTIFY=1` → build toxic without sound notifications support * `DISABLE_DESKTOP_NOTIFY=1` → build toxic without desktop notifications support + * `DISABLE_LOCALIZATION=1` → build toxic without localization support #### Packaging diff --git a/cfg/checks/check_features.mk b/cfg/checks/check_features.mk index 430d1af..d6bcc57 100644 --- a/cfg/checks/check_features.mk +++ b/cfg/checks/check_features.mk @@ -24,6 +24,12 @@ ifneq ($(DESK_NOTIFY), disabled) -include $(CHECKS_DIR)/desktop_notifications.mk endif +# Check if we want build localization support +LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) +ifneq ($(LOCALIZATION), enabled) + CFLAGS += -DNO_GETTEXT +endif + # Check if we can build Toxic CHECK_LIBS = $(shell pkg-config --exists $(LIBS) || echo -n "error") ifneq ($(CHECK_LIBS), error) diff --git a/cfg/global_vars.mk b/cfg/global_vars.mk index d5c7b57..5d4a14c 100644 --- a/cfg/global_vars.mk +++ b/cfg/global_vars.mk @@ -13,6 +13,7 @@ DOC_DIR = $(BASE_DIR)/doc SRC_DIR = $(BASE_DIR)/src SND_DIR = $(BASE_DIR)/sounds MISC_DIR = $(BASE_DIR)/misc +TRANSLATIONS_DIR = $(BASE_DIR)/translations # Project files MANFILES = toxic.1 toxic.conf.5 @@ -22,9 +23,13 @@ SNDFILES = ToxicContactOnline.wav ToxicContactOffline.wav ToxicError.wav SNDFILES += ToxicRecvMessage.wav ToxicOutgoingCall.wav ToxicIncomingCall.wav SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav +# Available languages (sorted alphabetically) +LANGS = en it + # Install directories PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic MANDIR = $(PREFIX)/share/man APPDIR = $(PREFIX)/share/applications +LOCALEDIR = ${PREFIX}/share/locale diff --git a/cfg/systems/Darwin.mk b/cfg/systems/Darwin.mk index f33a4be..b4c82ad 100644 --- a/cfg/systems/Darwin.mk +++ b/cfg/systems/Darwin.mk @@ -8,3 +8,9 @@ LIBS := $(filter-out ncursesw, $(LIBS)) # OS X ships a usable, recent version of ncurses, but calls it ncurses not ncursesw. LDFLAGS += -lncurses -lalut -ltoxav -ltoxcore -ltoxdns -lresolv -lconfig -ltoxencryptsave -g CFLAGS += -I/usr/local/opt/freealut/include/AL -I/usr/local/opt/glib/include/glib-2.0 -g + +# Check if we want build localization support +LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) +ifneq ($(LOCALIZATION), disabled) + LDFLAGS += -lintl +endif diff --git a/cfg/targets/help.mk b/cfg/targets/help.mk index fba1c8f..4946b00 100644 --- a/cfg/targets/help.mk +++ b/cfg/targets/help.mk @@ -14,6 +14,7 @@ help: @echo " DISABLE_AV: Set to \"1\" to force building without audio call support" @echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support" @echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support" + @echo " DISABLE_LOCALIZATION: Set to \"1\" to force building without localization support" @echo " USER_CFLAGS: Add custom flags to default CFLAGS" @echo " USER_LDFLAGS: Add custom flags to default LDFLAGS" @echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")" diff --git a/cfg/targets/install.mk b/cfg/targets/install.mk index 12050ff..3f9bf47 100644 --- a/cfg/targets/install.mk +++ b/cfg/targets/install.mk @@ -8,6 +8,17 @@ install: $(BUILD_DIR)/toxic @mkdir -p $(abspath $(DESTDIR)/$(APPDIR)) @install -m 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE)) + @if [ -z "$(DISABLE_LOCALIZATION)" -o "$(DISABLE_LOCALIZATION)" = "0" ]; then \ + echo "Installing translations" ; \ + for i in $(LANGS) ; do \ + if [ ! -e $(TRANSLATIONS_DIR)/$$i.mo ]; then \ + continue ; \ + fi ; \ + mkdir -p $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES) ; \ + install -m 0644 $(TRANSLATIONS_DIR)/$$i.mo $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES/toxic.mo) ; \ + done ; \ + fi + @echo "Installing data files" @mkdir -p $(abspath $(DESTDIR)/$(DATADIR)) @for f in $(DATAFILES) ; do \ diff --git a/src/audio_call.c b/src/audio_call.c index 54b865b..274b5bb 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -37,6 +37,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #include @@ -124,7 +130,7 @@ ToxAv *init_audio(ToxWindow *self, Tox *tox) } if ( init_devices(ASettins.av) == de_InternalError ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to init devices"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to init devices")); toxav_kill(ASettins.av); return ASettins.av = NULL; } @@ -167,7 +173,7 @@ void read_device_callback (const int16_t* captured, uint32_t size, void* data) uint8_t encoded_payload[RTP_PAYLOAD_SIZE]; int32_t payload_size = toxav_prepare_audio_frame(ASettins.av, call_index, encoded_payload, RTP_PAYLOAD_SIZE, captured, size); if ( payload_size <= 0 || toxav_send_audio(ASettins.av, call_index, encoded_payload, payload_size) < 0 ) { - /*fprintf(stderr, "Could not encode audio packet\n");*/ + /*fprintf(stderr, gettext("Could not encode audio packet\n"));*/ } } @@ -186,13 +192,13 @@ void write_device_callback(void *agent, int32_t call_index, const int16_t* PCM, int start_transmission(ToxWindow *self, Call *call) { if ( !self || !ASettins.av || self->call_idx == -1 ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); return -1; } /* Don't provide support for video */ if ( 0 != toxav_prepare_transmission(ASettins.av, self->call_idx, 0) ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); return -1; } @@ -208,16 +214,16 @@ int start_transmission(ToxWindow *self, Call *call) if ( open_primary_device(input, &call->in_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open input device!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open input device!")); if ( register_device_callback(self->call_idx, call->in_idx, read_device_callback, &self->call_idx, true) != de_None) /* Set VAD as true for all; TODO: Make it more dynamic */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to register input handler!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to register input handler!")); if ( open_primary_device(output, &call->out_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open output device!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open output device!")); call->has_output = 0; } @@ -275,7 +281,7 @@ void callback_recv_starting ( void* av, int32_t call_index, void* arg ) if (windows[i].onStarting != NULL && windows[i].call_idx == call_index) { windows[i].onStarting(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index])) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , "Error starting transmission!"); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , gettext("Error starting transmission!")); } return; } @@ -294,7 +300,7 @@ void callback_call_started ( void* av, int32_t call_index, void* arg ) if (windows[i].onStart != NULL && windows[i].call_idx == call_index) { windows[i].onStart(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index]) ) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, "Error starting transmission!"); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error starting transmission!")); return; } } @@ -348,30 +354,30 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } if (!self->stb->connection) { - error_str = "Friend is offline."; + error_str = gettext("Friend is offline."); goto on_error; } ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, &ASettins.cs, 30); if ( error != av_ErrorNone ) { - if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = "Already in a call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = gettext("Already in a call!"); + else error_str = gettext("Internal error!"); goto on_error; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Calling... idx: %d", self->call_idx); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Calling... idx: %d"), self->call_idx); return; on_error: @@ -383,21 +389,21 @@ void cmd_answer(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } ToxAvError error = toxav_answer(ASettins.av, self->call_idx, &ASettins.cs); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot answer in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot answer in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -414,21 +420,21 @@ void cmd_reject(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } - ToxAvError error = toxav_reject(ASettins.av, self->call_idx, "Why not?"); + ToxAvError error = toxav_reject(ASettins.av, self->call_idx, gettext("Why not?")); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot reject in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot reject in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -445,12 +451,12 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = "Unknown arguments."; + error_str = gettext("Unknown arguments."); goto on_error; } if ( !ASettins.av ) { - error_str = "Audio not supported!"; + error_str = gettext("Audio not supported!"); goto on_error; } @@ -458,19 +464,19 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (toxav_get_call_state(ASettins.av, self->call_idx) == av_CallInviting) { error = toxav_cancel(ASettins.av, self->call_idx, self->num, - "Only those who appreciate small things know the beauty that is life"); + gettext("Only those who appreciate small things know the beauty that is life")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); #endif - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); } else { error = toxav_hangup(ASettins.av, self->call_idx); } if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = "Cannot hangup in invalid state!"; - else if ( error == av_ErrorNoCall ) error_str = "No call!"; - else error_str = "Internal error!"; + if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot hangup in invalid state!"); + else if ( error == av_ErrorNoCall ) error_str = gettext("No call!"); + else error_str = gettext("Internal error!"); goto on_error; } @@ -485,8 +491,8 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else error_str = "Only one argument allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else error_str = gettext("Only one argument allowed!"); goto on_error; } @@ -500,7 +506,7 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -517,9 +523,9 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else if ( argc < 2 ) error_str = "Must have id!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else if ( argc < 2 ) error_str = gettext("Must have id!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -533,7 +539,7 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -542,12 +548,12 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } if ( set_primary_device(type, selection) == de_InvalidSelection ) { - error_str="Invalid selection!"; + error_str=gettext("Invalid selection!"); goto on_error; } @@ -561,9 +567,9 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else if ( argc < 2 ) error_str = "Must have id!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else if ( argc < 2 ) error_str = gettext("Must have id!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -577,7 +583,7 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -586,12 +592,12 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } if ( selection_valid(type, selection) == de_InvalidSelection ) { - error_str="Invalid selection!"; + error_str=gettext("Invalid selection!"); goto on_error; } @@ -634,8 +640,8 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Type must be specified!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Type must be specified!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -649,7 +655,7 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); return; } @@ -680,8 +686,8 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = "Must have value!"; - else error_str = "Only two arguments allowed!"; + if ( argc < 1 ) error_str = gettext("Must have value!"); + else error_str = gettext("Only two arguments allowed!"); goto on_error; } @@ -690,7 +696,7 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M float value = strtof(argv[1], &end); if ( *end ) { - error_str = "Invalid input"; + error_str = gettext("Invalid input"); goto on_error; } @@ -719,10 +725,10 @@ void stop_current_call(ToxWindow* self) toxav_hangup(ASettins.av, self->call_idx); break; case av_CallInviting: - toxav_cancel(ASettins.av, self->call_idx, 0, "Not interested anymore"); + toxav_cancel(ASettins.av, self->call_idx, 0, gettext("Not interested anymore")); break; case av_CallStarting: - toxav_reject(ASettins.av, self->call_idx, "Not interested"); + toxav_reject(ASettins.av, self->call_idx, gettext("Not interested")); break; default: break; diff --git a/src/autocomplete.c b/src/autocomplete.c index 8cf703c..c500a03 100644 --- a/src/autocomplete.c +++ b/src/autocomplete.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #include @@ -117,7 +123,7 @@ int complete_line(ToxWindow *self, const void *list, int n_items, int size) char *sub = malloc(strlen(ubuf) + 1); if (sub == NULL) - exit_toxic_err("failed in complete_line", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in complete_line"), FATALERR_MEMORY); if (!s && !dir_search) { strcpy(sub, tmp); diff --git a/src/avatars.c b/src/avatars.c index a17c3be..d9c621a 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "misc_tools.h" #include "file_transfers.h" #include "friendlist.h" @@ -59,7 +65,7 @@ int avatar_send(Tox *m, uint32_t friendnum) return 0; if (err != TOX_ERR_FILE_SEND_OK) { - fprintf(stderr, "tox_file_send failed for friendnumber %d (error %d)\n", friendnum, err); + fprintf(stderr, gettext("tox_file_send failed for friendnumber %d (error %d)\n"), friendnum, err); return -1; } @@ -203,7 +209,7 @@ void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, "tox_file_send_chunk failed in avatar callback (error %d)\n", err); + fprintf(stderr, gettext("tox_file_send_chunk failed in avatar callback (error %d)\n"), err); ft->position += send_length; } diff --git a/src/chat.c b/src/chat.c index 9eaed52..6dafd9e 100644 --- a/src/chat.c +++ b/src/chat.c @@ -31,6 +31,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "execute.h" @@ -47,6 +53,9 @@ #include "notify.h" #include "message_queue.h" +#define YES_STR gettext("yes") +#define NO_STR gettext("no") + #ifdef AUDIO #include "audio_call.h" #endif /* AUDIO */ @@ -211,7 +220,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C ? tox_friend_get_typing(m, num, NULL) : false; chat_resume_file_transfers(m, num); - msg = "has come online"; + msg = gettext("has come online"); line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); } else if (connection_status == TOX_CONNECTION_NONE) { @@ -222,7 +231,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C chat_stop_file_senders(m, num); - msg = "has gone offline"; + msg = gettext("has gone offline"); line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); } @@ -307,21 +316,21 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), "File '%s' successfully sent.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File '%s' successfully sent."), ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Null file pointer.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Null file pointer."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (ft->position != position) { if (fseek(ft->file, position, SEEK_SET) == -1) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Seek fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Seek fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -333,7 +342,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, size_t send_length = fread(send_data, 1, sizeof(send_data), ft->file); if (send_length != length) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Read fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Read fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -342,7 +351,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, "tox_file_send_chunk failed in chat callback (error %d)\n", err); + fprintf(stderr, gettext("tox_file_send_chunk failed in chat callback (error %d)\n"), err); ft->position += send_length; ft->bps += send_length; @@ -365,20 +374,20 @@ static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, ui char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), "File '%s' successfully received.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File '%s' successfully received."), ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Invalid file pointer.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Invalid file pointer."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (fwrite(data, length, 1, ft->file) != 1) { - snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Write fail.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Write fail."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -404,7 +413,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint /* transfer is accepted */ if (ft->state == FILE_TRANSFER_PENDING) { ft->state = FILE_TRANSFER_STARTED; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.", + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer [%d] for '%s' accepted."), ft->index, ft->file_name); char progline[MAX_STR_SIZE]; prep_prog_line(progline); @@ -422,7 +431,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint break; case TOX_FILE_CONTROL_CANCEL: - snprintf(msg, sizeof(msg), "File transfer for '%s' was aborted.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' was aborted."), ft->file_name); close_file_transfer(self, m, ft, -1, msg, notif_error); break; } @@ -438,13 +447,13 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (!ft) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Too many concurrent file transfers."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Too many concurrent file transfers.")); return; } char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), file_size); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer request for '%s' (%s)", filename, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer request for '%s' (%s)"), filename, sizestr); char file_path[MAX_STR_SIZE]; size_t path_len = name_length; @@ -459,7 +468,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (path_len >= sizeof(ft->file_path) || name_length >= sizeof(ft->file_name)) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer faield: File path too long."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer faield: File path too long.")); return; } @@ -485,12 +494,12 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (count > 999) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: invalid file path."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: invalid file path.")); return; } } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type '/savefile %d' to accept the file transfer.", ft->index); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type '%s %d' to accept the file transfer."), "/savefile", ft->index); ft->state = FILE_TRANSFER_PENDING; ft->direction = FILE_TRANSFER_RECV; @@ -503,10 +512,10 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (self->active_box != -1) box_notify2(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, self->active_box, - "Incoming file: %s", filename ); + gettext("Incoming file: %s"), filename ); else box_notify(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, &self->active_box, self->name, - "Incoming file: %s", filename ); + gettext("Incoming file: %s"), filename ); } static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, uint8_t type, const char *group_pub_key, @@ -521,7 +530,7 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui char *k = malloc(length); if (k == NULL) - exit_toxic_err("Failed in chat_onGroupInvite", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in chat_onGroupInvite"), FATALERR_MEMORY); memcpy(k, group_pub_key, length); Friends.list[friendnumber].group_invite.key = k; @@ -535,12 +544,12 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui get_nick_truncate(m, name, friendnumber); if (self->active_box != -1) - box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, "invites you to join group chat"); + box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, gettext("invites you to join group chat")); else - box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, "invites you to join group chat"); + box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, gettext("invites you to join group chat")); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s has invited you to a group chat.", name); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/join\" to join the chat."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("%s has invited you to a group chat."), name); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s\" to join the chat."), "/join"); } /* Av Stuff */ @@ -554,16 +563,16 @@ void chat_onInvite (ToxWindow *self, ToxAv *av, int call_index) /* call_index is set here and reset on call end */ self->call_idx = call_index; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Incoming audio call! Type: \"/answer\" or \"/reject\""); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Incoming audio call! Type: \"%s\" or \"%s\""), "/answer", "/reject"); if (self->ringing_sound == -1) sound_notify(self, call_incoming, NT_LOOP, &self->ringing_sound); if (self->active_box != -1) - box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, "Incoming audio call!"); + box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, gettext("Incoming audio call!")); else - box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, "Incoming audio call!"); + box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, gettext("Incoming audio call!")); } void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) @@ -571,7 +580,7 @@ void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) if ( !self || self->call_idx != call_index || self->num != toxav_get_peer_id(av, call_index, 0)) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ringing...type \"/hangup\" to cancel it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Ringing...type \"%s\" to cancel it."), "/hangup"); #ifdef SOUND_NOTIFY if (self->ringing_sound == -1) @@ -586,7 +595,7 @@ void chat_onStarting (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -600,7 +609,7 @@ void chat_onEnding (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -613,7 +622,7 @@ void chat_onError (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Error!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -627,7 +636,7 @@ void chat_onStart (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -641,7 +650,7 @@ void chat_onCancel (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -654,7 +663,7 @@ void chat_onReject (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Rejected!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Rejected!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -668,7 +677,7 @@ void chat_onEnd (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -681,7 +690,7 @@ void chat_onRequestTimeout (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No answer!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No answer!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -695,7 +704,7 @@ void chat_onPeerTimeout (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Peer disconnected; call ended!"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Peer disconnected; call ended!")); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -752,31 +761,31 @@ static void draw_infobox(ToxWindow *self) infobox->lastupdate = curtime; - const char *in_is_muted = infobox->in_is_muted ? "yes" : "no"; - const char *out_is_muted = infobox->out_is_muted ? "yes" : "no"; + const char *in_is_muted = infobox->in_is_muted ? YES_STR : NO_STR; + const char *out_is_muted = infobox->out_is_muted ? YES_STR : NO_STR; wmove(infobox->win, 1, 1); wattron(infobox->win, COLOR_PAIR(RED) | A_BOLD); - wprintw(infobox->win, " Call Active\n"); + wprintw(infobox->win, gettext(" Call Active\n")); wattroff(infobox->win, COLOR_PAIR(RED) | A_BOLD); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " Duration: "); + wprintw(infobox->win, gettext(" Duration: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", infobox->timestr); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " In muted: "); + wprintw(infobox->win, gettext(" In muted: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", in_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " Out muted: "); + wprintw(infobox->win, gettext(" Out muted: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", out_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, " VAD level: "); + wprintw(infobox->win, gettext(" VAD level: ")); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%.2f\n", infobox->vad_lvl); @@ -1068,7 +1077,7 @@ static void chat_onInit(ToxWindow *self, Tox *m) ctx->cqueue = calloc(1, sizeof(struct chat_queue)); if (ctx->log == NULL || ctx->hst == NULL || ctx->cqueue == NULL) - exit_toxic_err("failed in chat_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in chat_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -1140,7 +1149,7 @@ ToxWindow new_chat(Tox *m, uint32_t friendnum) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_chat", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_chat"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/chat_commands.c b/src/chat_commands.c index 3352f47..63218e5 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -23,6 +23,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -39,7 +45,7 @@ extern FriendsList Friends; void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 2) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Requires type in|out and the file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Requires type %s and the file ID."), "in|out"); return; } @@ -48,7 +54,7 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar int idx = atoi(argv[2]); if (idx >= MAX_FILES || idx < 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } @@ -60,50 +66,50 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar } else if (strcasecmp(inoutstr, "out") == 0) { ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_SEND); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type must be 'in' or 'out'."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type must be '%s' or '%s'."), "in", "out"); return; } if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } if (ft->state == FILE_TRANSFER_INACTIVE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); return; } - snprintf(msg, sizeof(msg), "File transfer for '%s' aborted.", ft->file_name); + snprintf(msg, sizeof(msg), gettext("File transfer for '%s' aborted."), ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, silent); } void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group number required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group number required.")); return; } int groupnum = atoi(argv[1]); if (groupnum == 0 && strcmp(argv[1], "0")) { /* atoi returns 0 value on invalid input */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid group number."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid group number.")); return; } if (tox_invite_friend(m, self->num, groupnum) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to invite contact to group."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to invite contact to group.")); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invited contact to Group %d.", groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invited contact to Group %d."), groupnum); } void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); return; } @@ -112,7 +118,7 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar uint8_t type = Friends.list[self->num].group_invite.type; if (!Friends.list[self->num].group_invite.pending) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending group chat invite."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending group chat invite.")); return; } @@ -127,12 +133,12 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); tox_del_groupchat(m, groupnum); return; } @@ -142,31 +148,31 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File ID required.")); return; } int idx = atoi(argv[1]); if ((idx == 0 && strcmp(argv[1], "0")) || idx >= MAX_FILES) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } struct FileTransfer *ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_RECV); if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } if (ft->state != FILE_TRANSFER_PENDING) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); return; } if ((ft->file = fopen(ft->file_path, "a")) == NULL) { - const char *msg = "File transfer failed: Invalid file path."; + const char *msg = gettext("File transfer failed: Invalid file path."); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -177,7 +183,7 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv if (err != TOX_ERR_FILE_CONTROL_OK) goto on_recv_error; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Saving file [%d] as: '%s'", idx, ft->file_path); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Saving file [%d] as: '%s'"), idx, ft->file_path); /* prep progress bar line */ char progline[MAX_STR_SIZE]; @@ -192,23 +198,23 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv on_recv_error: switch (err) { case TOX_ERR_FILE_CONTROL_FRIEND_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend not found."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend not found.")); return; case TOX_ERR_FILE_CONTROL_FRIEND_NOT_CONNECTED: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend is not online."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend is not online.")); return; case TOX_ERR_FILE_CONTROL_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Invalid filenumber."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Invalid filenumber.")); return; case TOX_ERR_FILE_CONTROL_SENDQ: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Connection error."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Connection error.")); return; default: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed (error %d)\n", err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed (error %d)\n"), err); return; } } @@ -218,12 +224,12 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv const char *errmsg = NULL; if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path required.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path must be enclosed in quotes.")); return; } @@ -234,21 +240,21 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv path[path_len] = '\0'; if (path_len >= MAX_STR_SIZE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path exceeds character limit."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path exceeds character limit.")); return; } FILE *file_to_send = fopen(path, "r"); if (file_to_send == NULL) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File not found."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File not found.")); return; } off_t filesize = file_size(path); if (filesize == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file.")); fclose(file_to_send); return; } @@ -281,30 +287,30 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), filesize); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Sending file [%d]: '%s' (%s)", filenum, file_name, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Sending file [%d]: '%s' (%s)"), filenum, file_name, sizestr); return; on_send_error: switch (err) { case TOX_ERR_FILE_SEND_FRIEND_NOT_FOUND: - errmsg = "File transfer failed: Invalid friend."; + errmsg = gettext("File transfer failed: Invalid friend."); break; case TOX_ERR_FILE_SEND_FRIEND_NOT_CONNECTED: - errmsg = "File transfer failed: Friend is offline."; + errmsg = gettext("File transfer failed: Friend is offline."); break; case TOX_ERR_FILE_SEND_NAME_TOO_LONG: - errmsg = "File transfer failed: Filename is too long."; + errmsg = gettext("File transfer failed: Filename is too long."); break; case TOX_ERR_FILE_SEND_TOO_MANY: - errmsg = "File transfer failed: Too many concurrent file transfers."; + errmsg = gettext("File transfer failed: Too many concurrent file transfers."); break; default: - errmsg = "File transfer failed."; + errmsg = gettext("File transfer failed."); break; } diff --git a/src/configdir.c b/src/configdir.c index 8a9f60c..a6fda82 100644 --- a/src/configdir.c +++ b/src/configdir.c @@ -29,6 +29,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "configdir.h" @@ -116,7 +122,7 @@ int create_user_config_dirs(char *path) char *logpath = malloc(strlen(path) + strlen(LOGDIR) + 1); if (fullpath == NULL || logpath == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); strcpy(fullpath, path); strcat(fullpath, CONFIGDIR); diff --git a/src/dns.c b/src/dns.c index ade723c..8a7a6f3 100644 --- a/src/dns.c +++ b/src/dns.c @@ -26,6 +26,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef __APPLE__ #include #else @@ -146,7 +152,7 @@ static int load_dns_domainlist(const char *path) static int dns_error(ToxWindow *self, const char *errmsg) { pthread_mutex_lock(&Winthread.lock); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "User lookup failed: %s", errmsg); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("User lookup failed: %s"), errmsg); pthread_mutex_unlock(&Winthread.lock); return -1; @@ -172,18 +178,18 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char int len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, "dn_expand failed."); + return dns_error(self, gettext("dn_expand failed.")); ans_pt += len; if (ans_pt > ans_end - 4) - return dns_error(self, "DNS reply was too short."); + return dns_error(self, gettext("DNS reply was too short.")); int type; GETSHORT(type, ans_pt); if (type != T_TXT) - return dns_error(self, "Broken DNS reply."); + return dns_error(self, gettext("Broken DNS reply.")); ans_pt += INT16SZ; /* class */ @@ -195,12 +201,12 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, "Second dn_expand failed."); + return dns_error(self, gettext("Second dn_expand failed.")); ans_pt += len; if (ans_pt > ans_end - 10) - return dns_error(self, "DNS reply was too short."); + return dns_error(self, gettext("DNS reply was too short.")); GETSHORT(type, ans_pt); ans_pt += INT16SZ; @@ -208,20 +214,20 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char GETSHORT(size, ans_pt); if (ans_pt + size < answer || ans_pt + size > ans_end) - return dns_error(self, "RR overflow."); + return dns_error(self, gettext("RR overflow.")); } while (type == T_CNAME); if (type != T_TXT) - return dns_error(self, "DNS response failed."); + return dns_error(self, gettext("DNS response failed.")); uint32_t txt_len = *ans_pt; if (!size || txt_len >= size || !txt_len) - return dns_error(self, "No record found."); + return dns_error(self, gettext("No record found.")); if (txt_len > MAX_DNS_REQST_SIZE) - return dns_error(self, "Invalid DNS response."); + return dns_error(self, gettext("Invalid DNS response.")); ans_pt++; ans_pt[txt_len] = '\0'; @@ -298,7 +304,7 @@ void *dns3_lookup_thread(void *data) int namelen = parse_addr(t_data.addr, name, inputdomain); if (namelen == -1) { - dns_error(self, "Must be a Tox ID or an address in the form username@domain"); + dns_error(self, gettext("Must be a Tox ID or an address in the form username@domain")); killdns_thread(NULL); } @@ -308,14 +314,14 @@ void *dns3_lookup_thread(void *data) int match = get_domain_match(DNS_pubkey, domain, inputdomain); if (match == -1) { - dns_error(self, "Domain not found."); + dns_error(self, gettext("Domain not found.")); killdns_thread(NULL); } void *dns_obj = tox_dns3_new((uint8_t *) DNS_pubkey); if (dns_obj == NULL) { - dns_error(self, "Core failed to create DNS object."); + dns_error(self, gettext("Core failed to create DNS object.")); killdns_thread(NULL); } @@ -326,7 +332,7 @@ void *dns3_lookup_thread(void *data) (uint8_t *) name, namelen); if (str_len == -1) { - dns_error(self, "Core failed to generate DNS3 string."); + dns_error(self, gettext("Core failed to generate DNS3 string.")); killdns_thread(dns_obj); } @@ -340,7 +346,7 @@ void *dns3_lookup_thread(void *data) int ans_len = res_query(d_string, C_IN, T_TXT, answer, sizeof(answer)); if (ans_len <= 0) { - dns_error(self, "DNS query failed."); + dns_error(self, gettext("DNS query failed.")); killdns_thread(dns_obj); } @@ -355,7 +361,7 @@ void *dns3_lookup_thread(void *data) /* extract the encrypted ID from TXT response */ if (strncmp(ans_id, TOX_DNS3_TXT_PREFIX, prfx_len) != 0) { - dns_error(self, "Bad DNS3 TXT response."); + dns_error(self, gettext("Bad DNS3 TXT response.")); killdns_thread(dns_obj); } @@ -363,7 +369,7 @@ void *dns3_lookup_thread(void *data) if (tox_decrypt_dns3_TXT(dns_obj, (uint8_t *) t_data.id_bin, (uint8_t *) encrypted_id, strlen(encrypted_id), request_id) == -1) { - dns_error(self, "Core failed to decrypt DNS response."); + dns_error(self, gettext("Core failed to decrypt DNS response.")); killdns_thread(dns_obj); } @@ -379,12 +385,12 @@ void *dns3_lookup_thread(void *data) void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, const char *msg) { if (arg_opts.proxy_type != TOX_PROXY_TYPE_NONE && arg_opts.force_tcp) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "DNS lookups are disabled."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("DNS lookups are disabled.")); return; } if (t_data.busy) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please wait for previous user lookup to finish."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please wait for previous user lookup to finish.")); return; } @@ -394,7 +400,7 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, int ret = load_dns_domainlist(path); if (ret < 0) { - const char *errmsg = "DNS server list failed to load with error code %d. Falling back to hard-coded list."; + const char *errmsg = gettext("DNS server list failed to load with error code %d. Falling back to hard-coded list."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, ret); } } @@ -407,20 +413,20 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, t_data.busy = 1; if (pthread_attr_init(&dns_thread.attr) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to init"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to init")); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_attr_setdetachstate(&dns_thread.attr, PTHREAD_CREATE_DETACHED) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to set"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to set")); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_create(&dns_thread.tid, &dns_thread.attr, dns3_lookup_thread, NULL) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread failed to init"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread failed to init")); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; diff --git a/src/execute.c b/src/execute.c index 9e83a83..81dfb70 100644 --- a/src/execute.c +++ b/src/execute.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "execute.h" @@ -98,7 +104,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a char *cmd = strdup(input); if (cmd == NULL) - exit_toxic_err("failed in parse_command", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in parse_command"), FATALERR_MEMORY); int num_args = 0; int i = 0; /* index of last char in an argument */ @@ -112,7 +118,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a i = char_find(1, cmd, '\"'); if (cmd[i] == '\0') { - const char *errmsg = "Invalid argument. Did you forget a closing \"?"; + const char *errmsg = gettext("Invalid argument. Did you forget a closing \"?"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); free(cmd); return -1; @@ -183,5 +189,5 @@ void execute(WINDOW *w, ToxWindow *self, Tox *m, const char *input, int mode) if (do_command(w, self, m, num_args, global_commands, args) == 0) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid command."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid command.")); } diff --git a/src/friendlist.c b/src/friendlist.c index c8df965..45af2b2 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -26,6 +26,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include #include "toxic.h" @@ -84,7 +90,7 @@ static void realloc_friends(int n) uint32_t *f_idx = realloc(Friends.index, n * sizeof(uint32_t)); if (f == NULL || f_idx == NULL) - exit_toxic_err("failed in realloc_friends", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in realloc_friends"), FATALERR_MEMORY); Friends.list = f; Friends.index = f_idx; @@ -104,7 +110,7 @@ static void realloc_blocklist(int n) uint32_t *b_idx = realloc(Blocked.index, n * sizeof(uint32_t)); if (b == NULL || b_idx == NULL) - exit_toxic_err("failed in realloc_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in realloc_blocklist"), FATALERR_MEMORY); Blocked.list = b; Blocked.index = b_idx; @@ -132,7 +138,7 @@ static int save_blocklist(char *path) char *data = malloc(len); if (data == NULL) - exit_toxic_err("Failed in save_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in save_blocklist"), FATALERR_MEMORY); int i; @@ -199,7 +205,7 @@ int load_blocklist(char *path) if (data == NULL) { fclose(fp); - exit_toxic_err("Failed in load_blocklist", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in load_blocklist"), FATALERR_MEMORY); } if (fread(data, len, 1, fp) != 1) { @@ -322,7 +328,7 @@ static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESS get_time_str(timefrmt, sizeof(timefrmt)); line_info_add(prompt, timefrmt, nick, NULL, IN_MSG, 0, 0, "%s", str); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "* Warning: Too many windows are open."); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("* Warning: Too many windows are open.")); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -337,7 +343,7 @@ static void friendlist_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, ++Friends.num_online; if (avatar_send(m, num) == -1) - fprintf(stderr, "avatar_send failed for friend %d\n", num); + fprintf(stderr, gettext("avatar_send failed for friend %d\n"), num); } Friends.list[num].connection_status = connection_status; @@ -412,7 +418,7 @@ void friendlist_onFriendAdded(ToxWindow *self, Tox *m, uint32_t num, bool sort) tox_friend_get_public_key(m, num, (uint8_t *) Friends.list[i].pub_key, &pkerr); if (pkerr != TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK) - fprintf(stderr, "tox_friend_get_public_key failed (error %d)\n", pkerr); + fprintf(stderr, gettext("tox_friend_get_public_key failed (error %d)\n"), pkerr); TOX_ERR_FRIEND_GET_LAST_ONLINE loerr; uint64_t t = tox_friend_get_last_online(m, num, &loerr); @@ -491,7 +497,7 @@ static void friendlist_onFileRecv(ToxWindow *self, Tox *m, uint32_t num, uint32_ get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - "* File transfer from %s failed: too many windows are open.", nick); + gettext("* File transfer from %s failed: too many windows are open."), nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -514,7 +520,7 @@ static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, uint8 get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - "* Group chat invite from %s failed: too many windows are open.", nick); + gettext("* Group chat invite from %s failed: too many windows are open."), nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -537,7 +543,7 @@ static void delete_friend(Tox *m, uint32_t f_num) { TOX_ERR_FRIEND_DELETE err; if (tox_friend_delete(m, f_num, &err) != true) { - fprintf(stderr, "tox_friend_delete failed with error %d\n", err); + fprintf(stderr, gettext("tox_friend_delete failed with error %d\n"), err); return; } @@ -617,7 +623,7 @@ static void draw_del_popup(void) wattroff(PendingDelete.popup, A_BOLD); wmove(PendingDelete.popup, 1, 1); - wprintw(PendingDelete.popup, "Delete contact "); + wprintw(PendingDelete.popup, gettext("Delete contact ")); wattron(PendingDelete.popup, A_BOLD); if (blocklist_view == 0) @@ -698,7 +704,7 @@ static void unblock_friend(Tox *m, uint32_t bnum) uint32_t friendnum = tox_friend_add_norequest(m, (uint8_t *) Blocked.list[bnum].pub_key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to unblock friend (error %d)\n", err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to unblock friend (error %d)\n"), err); return; } @@ -757,7 +763,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) Friends.list[f].chatwin = add_window(m, new_chat(m, Friends.list[f].num)); set_active_window(Friends.list[f].chatwin); } else { - const char *msg = "* Warning: Too many windows are open."; + const char *msg = gettext("* Warning: Too many windows are open."); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, msg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -794,7 +800,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) { wattron(self->window, A_BOLD); - wprintw(self->window, " Blocked: "); + wprintw(self->window, gettext(" Blocked: ")); wattroff(self->window, A_BOLD); wprintw(self->window, "%d\n\n", Blocked.num_blocked); @@ -846,7 +852,7 @@ static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, "Key: "); + wprintw(self->window, gettext("Key: ")); wattroff(self->window, A_BOLD); int i; @@ -872,11 +878,11 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) bool fix_statuses = x2 != self->x; /* true if window max x value has changed */ wattron(self->window, COLOR_PAIR(CYAN)); - wprintw(self->window, " Press the"); + wprintw(self->window, gettext(" Press the")); wattron(self->window, A_BOLD); wprintw(self->window, " h "); wattroff(self->window, A_BOLD); - wprintw(self->window, "key for help\n\n"); + wprintw(self->window, gettext("key for help\n\n")); wattroff(self->window, COLOR_PAIR(CYAN)); if (blocklist_view == 1) { @@ -888,7 +894,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) struct tm cur_loc_tm = *localtime((const time_t *) &cur_time); wattron(self->window, A_BOLD); - wprintw(self->window, " Online: "); + wprintw(self->window, gettext(" Online: ")); wattroff(self->window, A_BOLD); wprintw(self->window, "%d/%d \n\n", Friends.num_online, Friends.num_friends); @@ -1002,19 +1008,19 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) switch (day_dist) { case 0: - wprintw(self->window, " Last seen: Today %s\n", hourmin); + wprintw(self->window, gettext(" Last seen: Today %s\n"), hourmin); break; case 1: - wprintw(self->window, " Last seen: Yesterday %s\n", hourmin); + wprintw(self->window, gettext(" Last seen: Yesterday %s\n"), hourmin); break; default: - wprintw(self->window, " Last seen: %d days ago\n", day_dist); + wprintw(self->window, gettext(" Last seen: %d days ago\n"), day_dist); break; } } else { - wprintw(self->window, " Last seen: Never\n"); + wprintw(self->window, gettext(" Last seen: Never\n")); } } } @@ -1026,7 +1032,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, "Key: "); + wprintw(self->window, gettext("Key: ")); wattroff(self->window, A_BOLD); int i; @@ -1065,9 +1071,9 @@ static void friendlist_onAv(ToxWindow *self, ToxAv *av, int call_index) } else { char nick[TOX_MAX_NAME_LENGTH]; get_nick_truncate(m, nick, Friends.list[id].num); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Audio action from: %s!", nick); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Audio action from: %s!"), nick); - const char *errmsg = "* Warning: Too many windows are open."; + const char *errmsg = gettext("* Warning: Too many windows are open."); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); @@ -1117,9 +1123,9 @@ ToxWindow new_friendlist(void) Help *help = calloc(1, sizeof(Help)); if (help == NULL) - exit_toxic_err("failed in new_friendlist", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_friendlist"), FATALERR_MEMORY); ret.help = help; - strcpy(ret.name, "contacts"); + strcpy(ret.name, gettext("contacts")); return ret; } diff --git a/src/global_commands.c b/src/global_commands.c index fc7e3b8..50e0eb2 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -24,6 +24,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -46,19 +52,19 @@ extern FriendRequests FrndRequests; void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } @@ -66,10 +72,10 @@ void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ uint32_t friendnum = tox_friend_add_norequest(m, FrndRequests.request[req].key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to add friend (error %d\n)", err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to add friend (error %d)\n"), err); return; } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Friend request accepted."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request accepted.")); on_friendadded(m, friendnum, true); } @@ -96,42 +102,42 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg switch (err) { case TOX_ERR_FRIEND_ADD_TOO_LONG: - errmsg = "Message is too long."; + errmsg = gettext("Message is too long."); break; case TOX_ERR_FRIEND_ADD_NO_MESSAGE: - errmsg = "Please add a message to your request."; + errmsg = gettext("Please add a message to your request."); break; case TOX_ERR_FRIEND_ADD_OWN_KEY: - errmsg = "That appears to be your own ID."; + errmsg = gettext("That appears to be your own ID."); break; case TOX_ERR_FRIEND_ADD_ALREADY_SENT: - errmsg = "Friend request has already been sent."; + errmsg = gettext("Friend request has already been sent."); break; case TOX_ERR_FRIEND_ADD_BAD_CHECKSUM: - errmsg = "Bad checksum in address."; + errmsg = gettext("Bad checksum in address."); break; case TOX_ERR_FRIEND_ADD_SET_NEW_NOSPAM: - errmsg = "Nospam was different."; + errmsg = gettext("Nospam was different."); break; case TOX_ERR_FRIEND_ADD_MALLOC: - errmsg = "Core memory allocation failed."; + errmsg = gettext("Core memory allocation failed."); break; case TOX_ERR_FRIEND_ADD_OK: - errmsg = "Friend request sent."; + errmsg = gettext("Friend request sent."); on_friendadded(m, f_num, true); break; case TOX_ERR_FRIEND_ADD_NULL: /* fallthrough */ default: - errmsg = "Faile to add friend: Unknown error."; + errmsg = gettext("Failed to add friend: Unknown error."); break; } @@ -141,7 +147,7 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Tox ID or address required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Tox ID or address required.")); return; } @@ -150,7 +156,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc > 1) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Message must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Message must be enclosed in quotes.")); return; } @@ -166,7 +172,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX size_t n_len = tox_self_get_name_size(m); selfname[n_len] = '\0'; - snprintf(msg, sizeof(msg), "Hello, my name is %s. Care to Tox?", selfname); + snprintf(msg, sizeof(msg), gettext("Hello, my name is %s. Care to Tox?"), selfname); } char id_bin[TOX_ADDRESS_SIZE] = {0}; @@ -184,7 +190,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX xx[2] = '\0'; if (sscanf(xx, "%02x", &x) != 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid Tox ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid Tox ID.")); return; } @@ -201,12 +207,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ { if (argc < 2 || strlen(argv[1]) < 3) { avatar_unset(m); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar is not set."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar is not set.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Path must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Path must be enclosed in quotes.")); return; } @@ -216,7 +222,7 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ int len = strlen(path) - 1; if (len <= 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid path."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid path.")); return; } @@ -226,12 +232,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (avatar_set(m, path, len) == -1) { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, - "Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes.", + gettext("Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes."), MAX_AVATAR_FILE_SIZE); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar set to '%s'", filename); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar set to '%s'"), filename); } void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -243,7 +249,7 @@ void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc != 3) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Require: "); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Require: ")); return; } @@ -252,7 +258,7 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) const char *key = argv[3]; if (atoi(port) == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid port."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid port.")); return; } @@ -265,15 +271,15 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) switch (err) { case TOX_ERR_BOOTSTRAP_BAD_HOST: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid IP."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid IP.")); break; case TOX_ERR_BOOTSTRAP_BAD_PORT: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid port."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid port.")); break; case TOX_ERR_BOOTSTRAP_NULL: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed.")); break; default: break; @@ -283,19 +289,19 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); return; } @@ -315,12 +321,12 @@ void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); return; } if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please specify group type: text | audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please specify group type: %s"), "text|audio"); return; } @@ -331,7 +337,7 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg else if (!strcasecmp(argv[1], "text")) type = TOX_GROUPCHAT_TYPE_TEXT; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Valid group types are: text | audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Valid group types are: %s"), "text|audio"); return; } @@ -345,17 +351,17 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); tox_del_groupchat(m, groupnum); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat [%d] created.", groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat [%d] created."), groupnum); } void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -365,9 +371,9 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc == 0) { if (log->log_on) - msg = "Logging for this window is ON. Type \"/log off\" to disable."; + msg = gettext("Logging for this window is ON. Type \"/log off\" to disable."); else - msg = "Logging for this window is OFF. Type \"/log on\" to enable."; + msg = gettext("Logging for this window is OFF. Type \"/log on\" to enable."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; @@ -388,7 +394,7 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_enable(self->name, myid, NULL, log, LOG_GROUP); } - msg = "Logging enabled"; + msg = gettext("Logging enabled"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } else if (!strcmp(swch, "0") || !strcmp(swch, "off")) { @@ -397,13 +403,13 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_disable(log); - msg = "Logging disabled"; + msg = gettext("Logging disabled"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } - msg = "Invalid option. Use \"/log on\" and \"/log off\" to toggle logging."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); + msg = gettext("Invalid option. Use \"%s\" to toggle logging."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg, "/log on|off"); } void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -426,7 +432,7 @@ void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); return; } @@ -443,7 +449,7 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA } if (!valid_nick(nick)) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid name."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid name.")); return; } @@ -459,12 +465,12 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_note(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); return; } @@ -490,7 +496,7 @@ void cmd_quit(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_requests(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (FrndRequests.num_requests == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend requests."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend requests.")); return; } @@ -527,8 +533,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (argc >= 2) { have_note = true; } else if (argc < 1) { - errmsg = "Require a status. Statuses are: online, busy and away."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); + errmsg = gettext("Require a status. Statuses are: %s."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); goto finish; } @@ -542,8 +548,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ else if (!strcasecmp(status_str, "busy")) status = TOX_USER_STATUS_BUSY; else { - errmsg = "Invalid status. Valid statuses are: online, busy and away."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); + errmsg = gettext("Invalid status. Valid statuses are: %s."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); goto finish; } @@ -552,7 +558,7 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (have_note) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); goto finish; } diff --git a/src/group_commands.c b/src/group_commands.c index fb73a0b..2589370 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -37,16 +43,16 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg if (tlen != -1) { title[tlen] = '\0'; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is set to: %s", title); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is set to: %s"), title); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is not set"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is not set")); } return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title must be enclosed in quotes."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title must be enclosed in quotes.")); return; } @@ -56,7 +62,7 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg title[len] = '\0'; if (tox_group_set_title(m, self->num, (uint8_t *) title, len) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set title."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set title.")); return; } @@ -71,9 +77,9 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg size_t sn_len = tox_self_get_name_size(m); selfnick[sn_len] = '\0'; - line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); + line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); + snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); write_to_log(tmp_event, selfnick, self->chatwin->log, true); } diff --git a/src/groupchat.c b/src/groupchat.c index 57885c9..1c8f990 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -31,6 +31,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #ifdef AUDIO #ifdef __APPLE__ #include @@ -134,7 +140,7 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type) if (groupchats[i].peer_names == NULL || groupchats[i].oldpeer_names == NULL || groupchats[i].peer_name_lengths == NULL || groupchats[i].oldpeer_name_lengths == NULL) - exit_toxic_err("failed in init_groupchat_win", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in init_groupchat_win"), FATALERR_MEMORY); memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, sizeof(UNKNOWN_NAME)); groupchats[i].oldpeer_name_lengths[0] = (uint16_t) strlen(UNKNOWN_NAME); @@ -142,7 +148,7 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type) #ifdef AUDIO if (type == TOX_GROUPCHAT_TYPE_AV) if (group_audio_open_out_device(i) == -1) - fprintf(stderr, "Group Audio failed to init\n"); + fprintf(stderr, gettext("Group Audio failed to init\n")); #endif /* AUDIO */ set_active_window(groupchats[i].chatwin); @@ -328,10 +334,10 @@ static void groupchat_onGroupTitleChange(ToxWindow *self, Tox *m, int groupnum, char nick[TOX_MAX_NAME_LENGTH]; get_group_nick_truncate(m, nick, peernum, groupnum); - line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); + line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); + snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); write_to_log(tmp_event, nick, ctx->log, true); } @@ -353,7 +359,7 @@ static void copy_peernames(int gnum, uint8_t peerlist[][TOX_MAX_NAME_LENGTH], ui if (groupchats[gnum].peer_names == NULL || groupchats[gnum].oldpeer_names == NULL || groupchats[gnum].peer_name_lengths == NULL || groupchats[gnum].oldpeer_name_lengths == NULL) { - exit_toxic_err("failed in copy_peernames", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in copy_peernames"), FATALERR_MEMORY); } uint16_t u_len = strlen(UNKNOWN_NAME); @@ -410,7 +416,7 @@ void *group_add_wait(void *data) pthread_mutex_unlock(&Winthread.lock); } - const char *event = "has joined the room"; + const char *event = gettext("has joined the room"); char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); @@ -508,7 +514,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu break; case TOX_CHAT_CHANGE_PEER_DEL: - event = "has left the room"; + event = gettext("has left the room"); line_info_add(self, timefrmt, (char *) oldpeername, NULL, DISCONNECTION, 0, RED, event); if (groupchats[self->num].side_pos > 0) @@ -525,11 +531,11 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu if (strcmp((char *) oldpeername, DEFAULT_TOX_NAME) == 0) return; - event = " is now known as "; + event = gettext(" is now known as "); line_info_add(self, timefrmt, (char *) oldpeername, (char *) peername, NAME_CHANGE, 0, 0, event); char tmp_event[TOXIC_MAX_NAME_LENGTH * 2 + 32]; - snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", (char *) peername); + snprintf(tmp_event, sizeof(tmp_event), gettext("is now known as %s"), (char *) peername); write_to_log(tmp_event, (char *) oldpeername, ctx->log, true); break; } @@ -540,12 +546,12 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu static void send_group_action(ToxWindow *self, ChatContext *ctx, Tox *m, char *action) { if (action == NULL) { - wprintw(ctx->history, "Invalid syntax.\n"); + wprintw(ctx->history, gettext("Invalid syntax.\n")); return; } if (tox_group_action_send(m, self->num, (uint8_t *) action, strlen(action)) == -1) { - const char *errmsg = " * Failed to send action."; + const char *errmsg = gettext(" * Failed to send action."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -632,7 +638,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) } } else if (!string_is_empty(line)) { if (tox_group_message_send(m, self->num, (uint8_t *) line, strlen(line)) == -1) { - const char *errmsg = " * Failed to send message."; + const char *errmsg = gettext(" * Failed to send message."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -669,7 +675,7 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m) wmove(ctx->sidebar, 0, 1); wattron(ctx->sidebar, A_BOLD); - wprintw(ctx->sidebar, "Peers: %d\n", num_peers); + wprintw(ctx->sidebar, gettext("Peers: %d\n"), num_peers); wattroff(ctx->sidebar, A_BOLD); mvwaddch(ctx->sidebar, 1, 0, ACS_LTEE); @@ -719,7 +725,7 @@ static void groupchat_onInit(ToxWindow *self, Tox *m) ctx->log = calloc(1, sizeof(struct chatlog)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err("failed in groupchat_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in groupchat_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -804,7 +810,7 @@ static int group_audio_write(int peernum, int groupnum, const int16_t *pcm, unsi alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_PROCESSED, &processed); alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_QUEUED, &queued); - fprintf(stderr, "source: %d, queued: %d, processed: %d\n", groupchats[groupnum].audio.source, queued, processed); + fprintf(stderr, gettext("source: %d, queued: %d, processed: %d\n"), groupchats[groupnum].audio.source, queued, processed); if (processed) { ALuint bufids[processed]; @@ -843,13 +849,13 @@ static void groupchat_onWriteDevice(ToxWindow *self, Tox *m, int groupnum, int p return; if (groupchats[groupnum].audio.dvhandle == NULL) - fprintf(stderr, "dvhandle is null)\n"); + fprintf(stderr, gettext("dvhandle is null)\n")); if (groupchats[groupnum].audio.dvctx == NULL) - fprintf(stderr, "ctx is null\n"); + fprintf(stderr, gettext("ctx is null\n")); int ret = group_audio_write(peernum, groupnum, pcm, samples, channels, sample_rate); - fprintf(stderr, "write: %d\n", ret); + fprintf(stderr, gettext("write: %d\n"), ret); } #endif /* AUDIO */ @@ -873,13 +879,13 @@ ToxWindow new_group_chat(Tox *m, int groupnum) ret.onWriteDevice = &groupchat_onWriteDevice; #endif - snprintf(ret.name, sizeof(ret.name), "Group %d", groupnum); + snprintf(ret.name, sizeof(ret.name), gettext("Group %d"), groupnum); ChatContext *chatwin = calloc(1, sizeof(ChatContext)); Help *help = calloc(1, sizeof(Help)); if (chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_group_chat", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_group_chat"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.help = help; diff --git a/src/help.c b/src/help.c index 8989c11..0838433 100644 --- a/src/help.c +++ b/src/help.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "windows.h" #include "toxic.h" #include "help.h" @@ -139,32 +145,50 @@ static void help_draw_global(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Global Commands:\n"); + wprintw(win, gettext("Global Commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /add : Add contact with optional message\n"); - wprintw(win, " /accept : Accept friend request\n"); - wprintw(win, " /avatar : Set an avatar (leave path empty to unset)\n"); - wprintw(win, " /decline : Decline friend request\n"); - wprintw(win, " /requests : List pending friend requests\n"); - wprintw(win, " /connect : Manually connect to a DHT node\n"); - wprintw(win, " /status : Set status with optional note\n"); - wprintw(win, " /note : Set a personal note\n"); - wprintw(win, " /nick : Set your nickname\n"); - wprintw(win, " /log or : Enable/disable logging\n"); - wprintw(win, " /group : Create a group chat where type: text | audio\n"); - wprintw(win, " /myid : Print your Tox ID\n"); - wprintw(win, " /clear : Clear window history\n"); - wprintw(win, " /close : Close the current chat window\n"); - wprintw(win, " /quit or /exit : Exit Toxic\n"); + wprintw(win, " /add : "); + wprintw(win, gettext("Add contact with optional message\n")); + wprintw(win, " /accept : "); + wprintw(win, gettext("Accept friend request\n")); + wprintw(win, " /avatar : "); + wprintw(win, gettext("Set an avatar (leave path empty to unset)\n")); + wprintw(win, " /decline : "); + wprintw(win, gettext("Decline friend request\n")); + wprintw(win, " /requests : "); + wprintw(win, gettext("List pending friend requests\n")); + wprintw(win, " /connect : "); + wprintw(win, gettext("Manually connect to a DHT node\n")); + wprintw(win, " /status : "); + wprintw(win, gettext("Set status with optional note\n")); + wprintw(win, " /note : "); + wprintw(win, gettext("Set a personal note\n")); + wprintw(win, " /nick : "); + wprintw(win, gettext("Set your nickname\n")); + wprintw(win, " /log or : "); + wprintw(win, gettext("Enable/disable logging\n")); + wprintw(win, " /group : "); + wprintw(win, gettext("Create a group chat where type: text | audio\n")); + wprintw(win, " /myid : "); + wprintw(win, gettext("Print your Tox ID\n")); + wprintw(win, " /clear : "); + wprintw(win, gettext("Clear window history\n")); + wprintw(win, " /close : "); + wprintw(win, gettext("Close the current chat window\n")); + wprintw(win, " /quit or /exit : "); + wprintw(win, gettext("Exit Toxic\n")); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, "\n Audio:\n"); + wprintw(win, gettext("\n Audio:\n")); wattroff(win, A_BOLD); - wprintw(win, " /lsdev : List devices where type: in|out\n"); - wprintw(win, " /sdev : Set active device\n"); + wprintw(win, " /lsdev : "); + wprintw(win, gettext("List devices where type:")); + wprintw(win, " in|out\n"); + wprintw(win, " /sdev : "); + wprintw(win, gettext("Set active device\n")); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -180,27 +204,40 @@ static void help_draw_chat(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Chat Commands:\n"); + wprintw(win, gettext("Chat Commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /invite : Invite contact to a group chat\n"); - wprintw(win, " /join : Join a pending group chat\n"); - wprintw(win, " /sendfile : Send a file\n"); - wprintw(win, " /savefile : Receive a file\n"); - wprintw(win, " /cancel : Cancel file transfer where type: in|out\n"); + wprintw(win, " /invite : "); + wprintw(win, gettext("Invite contact to a group chat\n")); + wprintw(win, " /join : "); + wprintw(win, gettext("Join a pending group chat\n")); + wprintw(win, " /sendfile : "); + wprintw(win, gettext("Send a file\n")); + wprintw(win, " /savefile : "); + wprintw(win, gettext("Receive a file\n")); + wprintw(win, " /cancel : "); + wprintw(win, gettext("Cancel file transfer where type:")); + wprintw(win, " in|out\n"); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, "\n Audio:\n"); + wprintw(win, gettext("\n Audio:\n")); wattroff(win, A_BOLD); - wprintw(win, " /call : Audio call\n"); - wprintw(win, " /answer : Answer incoming call\n"); - wprintw(win, " /reject : Reject incoming call\n"); - wprintw(win, " /hangup : Hangup active call\n"); - wprintw(win, " /sdev : Change active device\n"); - wprintw(win, " /mute : Mute active device if in call\n"); - wprintw(win, " /sense : VAD sensitivity threshold\n"); + wprintw(win, " /call : "); + wprintw(win, gettext("Audio call\n")); + wprintw(win, " /answer : "); + wprintw(win, gettext("Answer incoming call\n")); + wprintw(win, " /reject : "); + wprintw(win, gettext("Reject incoming call\n")); + wprintw(win, " /hangup : "); + wprintw(win, gettext("Hangup active call\n")); + wprintw(win, " /sdev : "); + wprintw(win, gettext("Change active device\n")); + wprintw(win, " /mute : "); + wprintw(win, gettext("Mute active device if in call\n")); + wprintw(win, " /sense : "); + wprintw(win, gettext("VAD sensitivity threshold\n")); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -216,16 +253,22 @@ static void help_draw_keys(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Key bindings:\n"); + wprintw(win, gettext("Key bindings:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " Ctrl+O and Ctrl+P : Navigate through the tabs\n"); - wprintw(win, " Page Up and Page Down : Scroll window history one line\n"); - wprintw(win, " Ctrl+F and Ctrl+V : Scroll window history half a page\n"); - wprintw(win, " Ctrl+H : Move to the bottom of window history\n"); - wprintw(win, " Ctrl+[ and Ctrl+] : Scroll peer list in groupchats\n"); - wprintw(win, " Ctrl+B : Toggle the groupchat peerlist\n\n"); - wprintw(win, " (Note: Custom keybindings override these defaults.)\n\n"); + wprintw(win, " Ctrl+O -- Ctrl+P : "); + wprintw(win, gettext("Navigate through the tabs\n")); + wprintw(win, " Page Up -- Page Down : "); + wprintw(win, gettext("Scroll window history one line\n")); + wprintw(win, " Ctrl+F -- Ctrl+V : "); + wprintw(win, gettext("Scroll window history half a page\n")); + wprintw(win, " Ctrl+H : "); + wprintw(win, gettext("Move to the bottom of window history\n")); + wprintw(win, " Ctrl+[ -- Ctrl+] : "); + wprintw(win, gettext("Scroll peer list in groupchats\n")); + wprintw(win, " Ctrl+B : "); + wprintw(win, gettext("Toggle the groupchat peerlist\n\n")); + wprintw(win, gettext(" (Note: Custom keybindings override these defaults.)\n\n")); help_draw_bottom_menu(win); @@ -240,10 +283,11 @@ static void help_draw_group(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Group commands:\n"); + wprintw(win, gettext("Group commands:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /title : Set group title (show current title if no msg)\n\n"); + wprintw(win, " /title : "); + wprintw(win, gettext("Set group title (show current title if no msg)\n\n")); help_draw_bottom_menu(win); @@ -258,14 +302,15 @@ static void help_draw_contacts(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, "Friendlist controls:\n"); + wprintw(win, gettext("Friendlist controls:\n")); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " Up and Down arrows : Scroll through list\n"); - wprintw(win, " Right and Left arrows : Switch between friendlist and blocked list\n"); - wprintw(win, " Enter : Open a chat window with selected contact\n"); - wprintw(win, " Delete : Permanently delete a contact\n"); - wprintw(win, " B : Block or unblock a contact\n"); + wprintw(win, gettext(" Up and Down arrows : Scroll through list\n")); + wprintw(win, gettext(" Right and Left arrows : Switch between friendlist and blocked list\n")); + wprintw(win, gettext(" Enter : Open a chat window with selected contact\n")); + wprintw(win, gettext(" Delete : Permanently delete a contact\n")); + wprintw(win, " B : "); + wprintw(win, gettext("Block or unblock a contact\n")); help_draw_bottom_menu(win); diff --git a/src/line_info.c b/src/line_info.c index b645e8f..12eea6d 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -41,7 +47,7 @@ void line_info_init(struct history *hst) hst->line_root = calloc(1, sizeof(struct line_info)); if (hst->line_root == NULL) - exit_toxic_err("failed in line_info_init", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in line_info_init"), FATALERR_MEMORY); hst->line_start = hst->line_root; hst->line_end = hst->line_start; @@ -141,7 +147,7 @@ void line_info_add(ToxWindow *self, const char *timestr, const char *name1, cons struct line_info *new_line = calloc(1, sizeof(struct line_info)); if (new_line == NULL) - exit_toxic_err("failed in line_info_add", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in line_info_add"), FATALERR_MEMORY); char frmt_msg[MAX_LINE_INFO_MSG_SIZE] = {0}; diff --git a/src/log.c b/src/log.c index f04c83d..a3331ef 100644 --- a/src/log.c +++ b/src/log.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "configdir.h" #include "toxic.h" #include "windows.h" @@ -180,17 +186,17 @@ void load_chat_history(ToxWindow *self, struct chatlog *log) char *hstbuf = malloc(sz); if (hstbuf == NULL) - exit_toxic_err("failed in load_chat_history", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_chat_history"), FATALERR_MEMORY); if (fseek(log->file, 0L, SEEK_SET) == -1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); return; } if (fread(hstbuf, sz, 1, log->file) != 1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); return; } diff --git a/src/message_queue.c b/src/message_queue.c index 70ccadb..996e4eb 100644 --- a/src/message_queue.c +++ b/src/message_queue.c @@ -22,6 +22,12 @@ #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "message_queue.h" @@ -47,7 +53,7 @@ void cqueue_add(struct chat_queue *q, const char *msg, size_t len, uint8_t type, struct cqueue_msg *new_m = malloc(sizeof(struct cqueue_msg)); if (new_m == NULL) - exit_toxic_err("failed in cqueue_message", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in cqueue_message"), FATALERR_MEMORY); snprintf(new_m->message, sizeof(new_m->message), "%s", msg); new_m->len = len; diff --git a/src/misc_tools.c b/src/misc_tools.c index 0d0a749..65114a1 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -28,6 +28,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -231,7 +237,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *path = strdup(pathname); if (path == NULL) - exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); while (len >= 0 && pathname[len] == '/') path[len--] = '\0'; @@ -239,7 +245,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *finalname = strdup(path); if (finalname == NULL) - exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); const char *basenm = strrchr(path, '/'); diff --git a/src/prompt.c b/src/prompt.c index 8377125..355d0d3 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -28,6 +28,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "toxic.h" #include "windows.h" #include "prompt.h" @@ -130,7 +136,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms tox_self_set_status_message(m, (uint8_t *) statusmsg, len, &err); if (err != TOX_ERR_SET_INFO_OK) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set note (error %d)\n", err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set note (error %d)\n"), err); } /* Updates own status in prompt statusbar */ @@ -262,19 +268,19 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) if (statusbar->connection != TOX_CONNECTION_NONE) { int colour = MAGENTA; - const char *status_text = "ERROR"; + const char *status_text = gettext("ERROR"); switch (statusbar->status) { case TOX_USER_STATUS_NONE: - status_text = "Online"; + status_text = gettext("Online"); colour = GREEN; break; case TOX_USER_STATUS_AWAY: - status_text = "Away"; + status_text = gettext("Away"); colour = YELLOW; break; case TOX_USER_STATUS_BUSY: - status_text = "Busy"; + status_text = gettext("Busy"); colour = RED; break; } @@ -287,7 +293,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); } else { - wprintw(statusbar->topline, " [Offline]"); + wprintw(statusbar->topline, gettext(" [Offline]")); wattron(statusbar->topline, A_BOLD); wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); @@ -351,28 +357,28 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, uint32_t friendnu const char *msg; if (connection_status != TOX_CONNECTION_NONE && Friends.list[friendnum].connection_status == TOX_CONNECTION_NONE) { - msg = "has come online"; + msg = gettext("has come online"); line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - "%s has come online", nick ); + gettext("%s has come online"), nick ); else box_notify(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", "%s has come online", nick ); + "Toxic", gettext("%s has come online"), nick ); } else if (connection_status == TOX_CONNECTION_NONE) { - msg = "has gone offline"; + msg = gettext("has gone offline"); line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - "%s has gone offline", nick ); + gettext("%s has gone offline"), nick ); else box_notify(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", "%s has gone offline", nick ); + "Toxic", gettext("%s has gone offline"), nick ); } } @@ -383,18 +389,18 @@ static void prompt_onFriendRequest(ToxWindow *self, Tox *m, const char *key, con char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, "Friend request with the message '%s'", data); - write_to_log("Friend request with the message '%s'", "", ctx->log, true); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request with the message '%s'"), data); + write_to_log(gettext("Friend request with the message '%s'"), "", ctx->log, true); int n = add_friend_request(key, data); if (n == -1) { - const char *errmsg = "Friend request queue is full. Discarding request."; + const char *errmsg = gettext("Friend request queue is full. Discarding request."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/accept %d\" or \"/decline %d\"", n, n); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s %d\" or \"%s %d\""), "/accept", n, "/decline", n); sound_notify(self, generic_message, NT_WNDALERT_1 | NT_NOTIFWND, NULL); } @@ -423,8 +429,8 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m) nick[n_len] = '\0'; statusmsg[s_len] = '\0'; - if (s_len == 0 || !strncmp(statusmsg, "Toxing on Toxic", strlen("Toxing on Toxic"))) { - snprintf(statusmsg, sizeof(statusmsg), "Toxing on Toxic"); + if (s_len == 0 || !strncmp(statusmsg, gettext("Toxing on Toxic"), strlen(gettext("Toxing on Toxic")))) { + snprintf(statusmsg, sizeof(statusmsg), gettext("Toxing on Toxic")); s_len = strlen(statusmsg); statusmsg[s_len] = '\0'; } @@ -446,10 +452,10 @@ static void print_welcome_msg(ToxWindow *self) line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, BLUE, " |_| \\___/_/\\_\\___\\____| v." TOXICVER); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); - const char *msg = "Welcome to Toxic, a free, open source Tox-based instant messenging client."; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); - msg = "Type \"/help\" for assistance. Further help may be found via the man page."; + const char *msg = gettext("Welcome to Toxic, a free, open source Tox-based instant messenging client."); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); + msg = gettext("Type \"%s\" for assistance. Further help may be found via the man page."); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg, "/help"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); } @@ -467,7 +473,7 @@ static void prompt_onInit(ToxWindow *self, Tox *m) ctx->hst = calloc(1, sizeof(struct history)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err("failed in prompt_onInit", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in prompt_onInit"), FATALERR_MEMORY); line_info_init(ctx->hst); @@ -505,7 +511,7 @@ ToxWindow new_prompt(void) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err("failed in new_prompt", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in new_prompt"), FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/toxic.c b/src/toxic.c index 9d14328..31154eb 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -40,6 +40,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include #include @@ -103,7 +109,7 @@ static void catch_SIGSEGV(int sig) { freopen("/dev/tty", "w", stderr); // make sure stderr is enabled since we may have disabled it endwin(); - fprintf(stderr, "Caught SIGSEGV: Aborting toxic session.\n"); + fprintf(stderr, gettext("Caught SIGSEGV: Aborting toxic session.\n")); exit(EXIT_FAILURE); } @@ -152,7 +158,7 @@ void exit_toxic_err(const char *errmsg, int errcode) { freopen("/dev/tty", "w", stderr); endwin(); - fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg); + fprintf(stderr, gettext("Toxic session aborted with error code %d (%s)\n"), errcode, errmsg); exit(EXIT_FAILURE); } @@ -162,12 +168,16 @@ static void init_term(void) if (!arg_opts.default_locale) { if (setlocale(LC_ALL, "") == NULL) - exit_toxic_err("Could not set your locale, please check your locale settings or " - "disable unicode support with the -d flag.", FATALERR_LOCALE_NOT_SET); + exit_toxic_err(gettext("Could not set your locale, please check your locale settings or " + "disable unicode support with the -d flag."), FATALERR_LOCALE_NOT_SET); } #endif +#ifndef NO_GETTEXT + textdomain("toxic"); +#endif + initscr(); cbreak(); keypad(stdscr, 1); @@ -218,12 +228,12 @@ static void queue_init_message(const char *msg, ...) char **new_msgs = realloc(init_messages.msgs, sizeof(char *) * init_messages.num); if (new_msgs == NULL) - exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); new_msgs[i] = malloc(MAX_STR_SIZE); if (new_msgs[i] == NULL) - exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); + exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); snprintf(new_msgs[i], MAX_STR_SIZE, "%s", frmt_msg); init_messages.msgs = new_msgs; @@ -315,14 +325,14 @@ int init_connection_helper(Tox *m, int line) tox_bootstrap(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, "Failed to bootstrap %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, gettext("Failed to bootstrap %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); return -1; } tox_add_tcp_relay(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, "Failed to add TCP relay %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, gettext("Failed to add TCP relay %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); return -1; } @@ -453,7 +463,7 @@ static void first_time_encrypt(const char *msg) bool valid_password = false; char passconfirm[MAX_PASSWORD_LEN + 1] = {0}; - printf("Enter a new password (must be at least %d characters) ", MIN_PASSWORD_LEN); + printf(gettext("Enter a new password (must be at least %d characters) "), MIN_PASSWORD_LEN); while (valid_password == false) { len = password_prompt(user_password.pass, sizeof(user_password.pass)); @@ -463,12 +473,12 @@ static void first_time_encrypt(const char *msg) exit(0); if (string_is_empty(passconfirm) && (len < MIN_PASSWORD_LEN || len > MAX_PASSWORD_LEN)) { - printf("Password must be between %d and %d characters long. ", MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); + printf(gettext("Password must be between %d and %d characters long. "), MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); continue; } if (string_is_empty(passconfirm)) { - printf("Enter password again "); + printf(gettext("Enter password again ")); snprintf(passconfirm, sizeof(passconfirm), "%s", user_password.pass); continue; } @@ -476,14 +486,14 @@ static void first_time_encrypt(const char *msg) if (strcmp(user_password.pass, passconfirm) != 0) { memset(passconfirm, 0, sizeof(passconfirm)); memset(user_password.pass, 0, sizeof(user_password.pass)); - printf("Passwords don't match. Try again. "); + printf(gettext("Passwords don't match. Try again. ")); continue; } valid_password = true; } - queue_init_message("Data file '%s' is encrypted", DATA_FILE); + queue_init_message(gettext("Data file '%s' is encrypted"), DATA_FILE); memset(passconfirm, 0, sizeof(passconfirm)); user_password.data_is_encrypted = true; } @@ -520,7 +530,7 @@ int store_data(Tox *m, const char *path) (uint8_t *) enc_data, &err); if (err != TOX_ERR_ENCRYPTION_OK) { - fprintf(stderr, "tox_pass_encrypt() failed with error %d\n", err); + fprintf(stderr, gettext("tox_pass_encrypt() failed with error %d\n"), err); fclose(fp); return -1; } @@ -571,7 +581,7 @@ static void init_tox_options(struct Tox_Options *tox_opts) tox_opts->proxy_type = arg_opts.proxy_type; if (!tox_opts->ipv6_enabled) - queue_init_message("Forcing IPv4 connection"); + queue_init_message(gettext("Forcing IPv4 connection")); if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { tox_opts->proxy_port = arg_opts.proxy_port; @@ -579,16 +589,16 @@ static void init_tox_options(struct Tox_Options *tox_opts) const char *ps = tox_opts->proxy_type == TOX_PROXY_TYPE_SOCKS5 ? "SOCKS5" : "HTTP"; char tmp[48]; - snprintf(tmp, sizeof(tmp), "Using %s proxy %s : %d", ps, arg_opts.proxy_address, arg_opts.proxy_port); + snprintf(tmp, sizeof(tmp), gettext("Using %s proxy %s : %d"), ps, arg_opts.proxy_address, arg_opts.proxy_port); queue_init_message("%s", tmp); } if (!tox_opts->udp_enabled) { - queue_init_message("UDP disabled"); + queue_init_message(gettext("UDP disabled")); } else if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { - const char *msg = "WARNING: Using a proxy without disabling UDP may leak your real IP address."; + const char *msg = gettext("WARNING: Using a proxy without disabling UDP may leak your real IP address."); queue_init_message("%s", msg); - msg = "Use the -t option to disable UDP."; + msg = gettext("Use the -t option to disable UDP."); queue_init_message("%s", msg); } } @@ -607,14 +617,14 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (len == 0) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } char data[len]; if (fread(data, sizeof(data), 1, fp) != 1) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } bool is_encrypted = tox_is_data_encrypted((uint8_t *) data); @@ -622,13 +632,13 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW /* attempt to encrypt an already encrypted data file */ if (arg_opts.encrypt_data && is_encrypted) { fclose(fp); - exit_toxic_err("failed in load_toxic", FATALERR_ENCRYPT); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_ENCRYPT); } if (arg_opts.unencrypt_data && is_encrypted) - queue_init_message("Data file '%s' has been unencrypted", data_path); + queue_init_message(gettext("Data file '%s' has been unencrypted"), data_path); else if (arg_opts.unencrypt_data) - queue_init_message("Warning: passed --unencrypt-data option with unencrypted data file '%s'", data_path); + queue_init_message(gettext("Warning: passed --unencrypt-data option with unencrypted data file '%s'"), data_path); if (is_encrypted) { if (!arg_opts.unencrypt_data) @@ -636,7 +646,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW size_t pwlen = 0; system("clear"); // TODO: is this portable? - printf("Enter password (q to quit) "); + printf(gettext("Enter password (\"%s\" to quit) "), "q"); size_t plain_len = len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH; char plain[plain_len]; @@ -653,7 +663,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (pwlen < MIN_PASSWORD_LEN) { system("clear"); sleep(1); - printf("Invalid password. Try again. "); + printf(gettext("Invalid password. Try again. ")); continue; } @@ -677,10 +687,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW } else if (pwerr == TOX_ERR_DECRYPTION_FAILED) { system("clear"); sleep(1); - printf("Invalid password. Try again. "); + printf(gettext("Invalid password. Try again. ")); } else { fclose(fp); - exit_toxic_err("tox_pass_decrypt() failed", pwerr); + exit_toxic_err(gettext("tox_pass_decrypt() failed"), pwerr); } } } else { /* data is not encrypted */ @@ -699,7 +709,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW fclose(fp); } else { /* Data file does not/should not exist */ if (file_exists(data_path)) - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); tox_opts->savedata_type = TOX_SAVEDATA_TYPE_NONE; @@ -709,7 +719,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW return NULL; if (store_data(m, data_path) == -1) - exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); + exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); } return m; @@ -724,23 +734,23 @@ static Tox *load_toxic(char *data_path) Tox *m = load_tox(data_path, &tox_opts, &new_err); if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { - queue_init_message("Falling back to ipv4"); + queue_init_message(gettext("Falling back to ipv4")); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); } if (!m) - exit_toxic_err("tox_new returned fatal error", new_err); + exit_toxic_err(gettext("tox_new returned fatal error"), new_err); if (new_err != TOX_ERR_NEW_OK) - queue_init_message("tox_new returned non-fatal error %d", new_err); + queue_init_message(gettext("tox_new returned non-fatal error %d"), new_err); init_tox_callbacks(m); load_friendlist(m); load_blocklist(BLOCK_FILE); if (tox_self_get_name_size(m) == 0) - tox_self_set_name(m, (uint8_t *) "Toxic User", strlen("Toxic User"), NULL); + tox_self_set_name(m, (uint8_t *) gettext("Toxic User"), strlen(gettext("Toxic User")), NULL); return m; } @@ -766,7 +776,7 @@ static void do_bootstrap(Tox *m) conn_err = init_connection(m); if (conn_err != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Auto-connect failed with error code %d", conn_err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Auto-connect failed with error code %d"), conn_err); } static void do_toxic(Tox *m, ToxWindow *prompt) @@ -847,21 +857,35 @@ void *thread_audio(void *data) static void print_usage(void) { - fprintf(stderr, "usage: toxic [OPTION] [FILE ...]\n"); - fprintf(stderr, " -4, --ipv4 Force IPv4 connection\n"); - fprintf(stderr, " -b, --debug Enable stderr for debugging\n"); - fprintf(stderr, " -c, --config Use specified config file\n"); - fprintf(stderr, " -d, --default-locale Use default POSIX locale\n"); - fprintf(stderr, " -e, --encrypt-data Encrypt an unencrypted data file\n"); - fprintf(stderr, " -f, --file Use specified data file\n"); - fprintf(stderr, " -h, --help Show this message and exit\n"); - fprintf(stderr, " -n, --nodes Use specified DHTnodes file\n"); - fprintf(stderr, " -o, --noconnect Do not connect to the DHT network\n"); - fprintf(stderr, " -p, --SOCKS5-proxy Use SOCKS5 proxy: Requires [IP] [port]\n"); - fprintf(stderr, " -P, --HTTP-proxy Use HTTP proxy: Requires [IP] [port]\n"); - fprintf(stderr, " -r, --dnslist Use specified DNSservers file\n"); - fprintf(stderr, " -t, --force-tcp Force TCP connection (use this with proxies)\n"); - fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n"); + fprintf(stderr, gettext("usage: toxic [OPTION] [FILE ...]\n")); + fprintf(stderr, " -4, --ipv4 "); + fprintf(stderr, gettext("Force IPv4 connection\n")); + fprintf(stderr, " -b, --debug "); + fprintf(stderr, gettext("Enable stderr for debugging\n")); + fprintf(stderr, " -c, --config "); + fprintf(stderr, gettext("Use specified config file\n")); + fprintf(stderr, " -d, --default-locale "); + fprintf(stderr, gettext("Use default POSIX locale\n")); + fprintf(stderr, " -e, --encrypt-data "); + fprintf(stderr, gettext("Encrypt an unencrypted data file\n")); + fprintf(stderr, " -f, --file "); + fprintf(stderr, gettext("Use specified data file\n")); + fprintf(stderr, " -h, --help "); + fprintf(stderr, gettext("Show this message and exit\n")); + fprintf(stderr, " -n, --nodes "); + fprintf(stderr, gettext("Use specified DHTnodes file\n")); + fprintf(stderr, " -o, --noconnect "); + fprintf(stderr, gettext("Do not connect to the DHT network\n")); + fprintf(stderr, " -p, --SOCKS5-proxy "); + fprintf(stderr, gettext("Use SOCKS5 proxy: Requires [IP] [port]\n")); + fprintf(stderr, " -P, --HTTP-proxy "); + fprintf(stderr, gettext("Use HTTP proxy: Requires [IP] [port]\n")); + fprintf(stderr, " -r, --dnslist "); + fprintf(stderr, gettext("Use specified DNSservers file\n")); + fprintf(stderr, " -t, --force-tcp "); + fprintf(stderr, gettext("Force TCP connection (use this with proxies)\n")); + fprintf(stderr, " -u, --unencrypt-data "); + fprintf(stderr, gettext("Unencrypt an encrypted data file\n")); } static void set_default_opts(void) @@ -905,20 +929,20 @@ static void parse_args(int argc, char *argv[]) case 'b': arg_opts.debug = 1; - queue_init_message("stderr enabled"); + queue_init_message(gettext("stderr enabled")); break; case 'c': snprintf(arg_opts.config_path, sizeof(arg_opts.config_path), "%s", optarg); if (!file_exists(arg_opts.config_path)) - queue_init_message("Config file not found"); + queue_init_message(gettext("Config file not found")); break; case 'd': arg_opts.default_locale = 1; - queue_init_message("Using default POSIX locale"); + queue_init_message(gettext("Using default POSIX locale")); break; case 'e': @@ -931,12 +955,12 @@ static void parse_args(int argc, char *argv[]) BLOCK_FILE = malloc(strlen(optarg) + strlen("-blocklist") + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in parse_args", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in parse_args"), FATALERR_MEMORY); strcpy(BLOCK_FILE, optarg); strcat(BLOCK_FILE, "-blocklist"); - queue_init_message("Using '%s' data file", DATA_FILE); + queue_init_message(gettext("Using '%s' data file"), DATA_FILE); break; @@ -944,13 +968,13 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.nodes_path, sizeof(arg_opts.nodes_path), "%s", optarg); if (!file_exists(arg_opts.nodes_path)) - queue_init_message("DHTnodes file not found"); + queue_init_message(gettext("DHTnodes file not found")); break; case 'o': arg_opts.no_connect = 1; - queue_init_message("DHT disabled"); + queue_init_message(gettext("DHT disabled")); break; case 'p': @@ -958,7 +982,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err("Proxy error", FATALERR_PROXY); + exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -968,7 +992,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err("Proxy error", FATALERR_PROXY); + exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -977,7 +1001,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.dns_path, sizeof(arg_opts.dns_path), "%s", optarg); if (!file_exists(arg_opts.dns_path)) - queue_init_message("DNSservers file not found"); + queue_init_message(gettext("DNSservers file not found")); break; @@ -1012,13 +1036,13 @@ static int init_default_data_files(void) BLOCK_FILE = strdup(BLOCKNAME); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); } else { DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(DATANAME) + 1); BLOCK_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(BLOCKNAME) + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); strcpy(DATA_FILE, user_config_dir); strcat(DATA_FILE, CONFIGDIR); @@ -1074,7 +1098,7 @@ int main(int argc, char *argv[]) if (arg_opts.encrypt_data && arg_opts.unencrypt_data) { arg_opts.encrypt_data = 0; arg_opts.unencrypt_data = 0; - queue_init_message("Warning: Using --unencrypt-data and --encrypt-data simultaneously has no effect"); + queue_init_message(gettext("Warning: Using \"%s\" and \"%s\" simultaneously has no effect"), "--unencrypt-data", "--encrypt-data"); } /* Make sure all written files are read/writeable only by the current user. */ @@ -1087,23 +1111,23 @@ int main(int argc, char *argv[]) last_bootstrap_time = get_unix_time(); if (!datafile_exists && !arg_opts.unencrypt_data) - first_time_encrypt("Creating new data file. Would you like to encrypt it? Y/n (q to quit)"); + first_time_encrypt(gettext("Creating new data file. Would you like to encrypt it? Y/n (q to quit)")); else if (arg_opts.encrypt_data) - first_time_encrypt("Encrypt existing data file? Y/n (q to quit)"); + first_time_encrypt(gettext("Encrypt existing data file? Y/n (q to quit)")); /* init user_settings struct and load settings from conf file */ user_settings = calloc(1, sizeof(struct user_settings)); if (user_settings == NULL) - exit_toxic_err("failed in main", FATALERR_MEMORY); + exit_toxic_err(gettext("failed in main"), FATALERR_MEMORY); const char *p = arg_opts.config_path[0] ? arg_opts.config_path : NULL; int settings_err = settings_load(user_settings, p); #ifdef X11 if (init_xtra(DnD_callback) == -1) - queue_init_message("X failed to initialize"); + queue_init_message(gettext("X failed to initialize")); #endif Tox *m = load_toxic(DATA_FILE); @@ -1119,14 +1143,14 @@ int main(int argc, char *argv[]) /* thread for ncurses stuff */ if (pthread_mutex_init(&Winthread.lock, NULL) != 0) - exit_toxic_err("failed in main", FATALERR_MUTEX_INIT); + exit_toxic_err(gettext("failed in main"), FATALERR_MUTEX_INIT); if (pthread_create(&Winthread.tid, NULL, thread_winref, (void *) m) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); /* thread for message queue */ if (pthread_create(&cqueue_thread.tid, NULL, thread_cqueue, (void *) m) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); #ifdef AUDIO @@ -1134,14 +1158,14 @@ int main(int argc, char *argv[]) /* audio thread */ if (pthread_create(&audio_thread.tid, NULL, thread_audio, (void *) av) != 0) - exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); + exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); set_primary_device(input, user_settings->audio_in_dev); set_primary_device(output, user_settings->audio_out_dev); #elif SOUND_NOTIFY if ( init_devices() == de_InternalError ) - queue_init_message("Failed to init audio devices"); + queue_init_message(gettext("Failed to init audio devices")); #endif /* AUDIO */ @@ -1150,16 +1174,16 @@ int main(int argc, char *argv[]) const char *msg; if (config_err) { - msg = "Unable to determine configuration directory. Defaulting to 'data' for data file..."; + msg = gettext("Unable to determine configuration directory. Defaulting to 'data' for data file..."); queue_init_message("%s", msg); } if (settings_err == -1) - queue_init_message("Failed to load user settings"); + queue_init_message(gettext("Failed to load user settings")); /* screen/tmux auto-away timer */ if (init_mplex_away_timer(m) == -1) - queue_init_message("Failed to init mplex auto-away."); + queue_init_message(gettext("Failed to init mplex auto-away.")); print_init_messages(prompt); cleanup_init_messages(); @@ -1182,7 +1206,7 @@ int main(int argc, char *argv[]) if (timed_out(last_save, cur_time, AUTOSAVE_FREQ)) { pthread_mutex_lock(&Winthread.lock); if (store_data(m, DATA_FILE) != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "WARNING: Failed to save to data file"); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("WARNING: Failed to save to data file")); pthread_mutex_unlock(&Winthread.lock); last_save = cur_time; diff --git a/src/toxic.h b/src/toxic.h index 6129fab..0adb759 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -40,8 +40,8 @@ #include -#define UNKNOWN_NAME "Anonymous" -#define DEFAULT_TOX_NAME "Tox User" /* should always be the same as toxcore's default name */ +#define UNKNOWN_NAME gettext("Anonymous") +#define DEFAULT_TOX_NAME gettext("Tox User") /* should always be the same as toxcore's default name */ #define MAX_STR_SIZE TOX_MAX_MESSAGE_LENGTH /* must be >= TOX_MAX_MESSAGE_LENGTH */ #define MAX_CMDNAME_SIZE 64 diff --git a/src/windows.c b/src/windows.c index de41a31..4075371 100644 --- a/src/windows.c +++ b/src/windows.c @@ -25,6 +25,12 @@ #include #include +#ifdef NO_GETTEXT +#define gettext(A) (A) +#else +#include +#endif + #include "friendlist.h" #include "prompt.h" #include "toxic.h" @@ -359,7 +365,7 @@ void set_next_window(int ch) return; if (active_window == inf) /* infinite loop check */ - exit_toxic_err("failed in set_next_window", FATALERR_INFLOOP); + exit_toxic_err(gettext("failed in set_next_window"), FATALERR_INFLOOP); } } @@ -381,7 +387,7 @@ ToxWindow *init_windows(Tox *m) int n_prompt = add_window(m, new_prompt()); if (n_prompt == -1 || add_window(m, new_friendlist()) == -1) - exit_toxic_err("failed in init_windows", FATALERR_WININIT); + exit_toxic_err(gettext("failed in init_windows"), FATALERR_WININIT); prompt = &windows[n_prompt]; active_window = prompt; diff --git a/translations/en.mo b/translations/en.mo new file mode 100644 index 0000000000000000000000000000000000000000..c30c0646ae437e00ea0a2b64515d56b7dc679837 GIT binary patch literal 28644 zcmeI3dwiT#o&O(!A`KNNrCeGrPXeJSZPN5cAy9frdP!-Mn4~vr36q&8$X_+27)IRdo3Y0>Y}RD7w42?k+A~QB?e~qN}bKR74jx~ z^ZRS&)sy#g?&o~Z_uNl^aPl!Xd;Bsl^Sm?RrN?{TV|>5*RJnTIx6kst+3-8?B=|U7 z1OE%IgG+XQArRK;Tp0sZjM?0u`^{F@VQlKL{1?I;i@- z6RMmafhzYy5D|Odg^0lWy>mZ)pLaQblwSya_{PV4ODu!!CCNL zD80T9D*V@>>hTm@0_PwE>FY&M`mzl1)Vx7f;m6;$~3 zQ1#gF?BmY<4yg3+fj;~SR60*X^^>_5*!WAK^r9Q8-L8bH*Y(c-F2_$p>Bsk>>hnD8 zgJ)4GhWsQfO4s_zg~e|dwm-vTMJ_W<a6;$}Uq3ZuITm^ptm&2xI zHr}A)YavzlJ_w~Bk2?MqN{$QLtsbs`YX2*t`o}@2c6uXJJ@1A}|I1KvdjU#rb8%Gt zE`)R8c6c1T0;<1`LZx#9RDEuRlEZ`WB=}3Ha{K{Gj;F4$^1T2mpB+%)hv8g!6Fd># z>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znKRcx#87o)A7YwL#510D=1%6Xa&mDo5)QHMN(8UDD`L_^cOWKzcPl*IPc1*heQYIN zuFx5#dzUqTBpmbXf)iG5I8Ex)oNVi9o|@)isykB*x(l;>A~e^%Q82{PI9Vj?=#B}J zflcf~+m|~j-6|)pb82lL``NN4b77VqDsZE#CgC-dH~m43>{DLD$U$=!9Z92GDGc)_ zQciEAsxEdf6RFc{>@bs@9dFb=o>?y>p6N749&1R`88m@1;TJ;BEFj!_9UThTo~W^K zscw5KdWWQM#HqUnYi;n{rDePer%|o4&fM$V$rO8xUNHk%kV2??uH2uqVW3yK< z*S~*!OjZ5}@yvd5$h~WGt!IWWyJpbGQz zw{Nh!w})wcbNBX5K5GW1_6Z#=t0^12Njha;Db(hrwL8elwv ztt;F8<;y!(wl8U4(cVtL)_!(k%IJvU^scRSP!GIvDHcUMW8so9&*KN3D6rdek3KRD z+jX`{rCSGsRK9~5i_OK3?j4(I)mct8IvMGiG+MP7L_BoCWyKr=4tr4UxX}Hz8wNVN zyKCXx)3Vl0oPlZw(&1k;%nH3P$8s&#x|t&t_DY4Ku|{iGT*A8$`K)az_>F7*<%=(A zs6W}PKiOnSSbwrTQjA@>zefS%0$W)^;4t9{N77{$#WM zWOLdp-c9E1W&O$KX1f!soy2U>!HB)nj$i2ES%0$0W}3^e`jbufAG~znp-Y-6M-fh$ zI7F$Qhw!kddOBNwvKha@t3TP)|3B1$aQ(@qxj?qBmNx75IleVBCyeF_yAxKiRCkZ?qR4^(UJgx7D9)*4}#7 zpKR8jY}TJ_)}L&e|0Gv^S6F|tY5pUB{mCY4%lebe`jgGnCmlzS3ARWy&1_0F^YWb^;)lg " +msgstr "Require: " + +#: ../src/global_commands.c:261 +msgid "Invalid port." +msgstr "Invalid port." + +#: ../src/global_commands.c:274 +msgid "Bootstrap failed: Invalid IP." +msgstr "Bootstrap failed: Invalid IP." + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "Bootstrap failed: Invalid port." + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "Bootstrap failed." + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "Please specify group type: %s" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "Valid group types are: %s" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "Group chat [%d] created." + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "Logging for this window is ON. Type \"/log off\" to disable." + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "Logging for this window is OFF. Type \"/log on\" to enable." + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "Logging enabled" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "Logging disabled" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "Invalid option. Use \"%s\" to toggle logging." + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "Input required." + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "Invalid name." + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "Note must be enclosed in quotes." + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "No pending friend requests." + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "Require a status. Statuses are: %s." + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "Invalid status. Valid statuses are: %s." + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "Title is set to: %s" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "Title is not set" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "Title must be enclosed in quotes." + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "Failed to set title." + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr " set the group title to: %s" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "set title to %s" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "failed in init_groupchat_win" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "Group Audio failed to init\n" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "failed in copy_peernames" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "has joined the room" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "has left the room" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr " is now known as " + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "is now known as %s" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "Invalid syntax.\n" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr " * Failed to send action." + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr " * Failed to send message." + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "Peers: %d\n" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "failed in groupchat_onInit" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "source: %d, queued: %d, processed: %d\n" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "dvhandle is null)\n" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "ctx is null\n" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "write: %d\n" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "Group %d" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "failed in new_group_chat" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "Global Commands:\n" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "Add contact with optional message\n" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "Accept friend request\n" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "Set an avatar (leave path empty to unset)\n" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "Decline friend request\n" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "List pending friend requests\n" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "Manually connect to a DHT node\n" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "Set status with optional note\n" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "Set a personal note\n" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "Set your nickname\n" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "Enable/disable logging\n" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "Create a group chat where type: text | audio\n" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "Print your Tox ID\n" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "Clear window history\n" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "Close the current chat window\n" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "Exit Toxic\n" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" +"\n" +" Audio:\n" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "List devices where type:" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "Set active device\n" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "Chat Commands:\n" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "Invite contact to a group chat\n" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "Join a pending group chat\n" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "Send a file\n" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "Receive a file\n" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "Cancel file transfer where type:" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "Audio call\n" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "Answer incoming call\n" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "Reject incoming call\n" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "Hangup active call\n" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "Change active device\n" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "Mute active device if in call\n" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "VAD sensitivity threshold\n" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "Key bindings:\n" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "Navigate through the tabs\n" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "Scroll window history one line\n" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "Scroll window history half a page\n" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "Move to the bottom of window history\n" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "Scroll peer list in groupchats\n" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" +"Toggle the groupchat peerlist\n" +"\n" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "Group commands:\n" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" +"Set group title (show current title if no msg)\n" +"\n" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "Friendlist controls:\n" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr " Up and Down arrows : Scroll through list\n" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" +" Enter : Open a chat window with selected contact\n" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr " Delete : Permanently delete a contact\n" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "Block or unblock a contact\n" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "failed in line_info_init" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "failed in line_info_add" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "failed in load_chat_history" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr " * Failed to read log file" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "failed in cqueue_message" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "failed in get_file_name" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "Failed to set note (error %d)\n" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "ERROR" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "Online" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "Away" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "Busy" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr " [Offline]" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "%s has come online" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "%s has gone offline" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "Friend request with the message '%s'" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "Friend request queue is full. Discarding request." + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "Type \"%s %d\" or \"%s %d\"" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "Toxing on Toxic" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" +"Type \"%s\" for assistance. Further help may be found via the man page." + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "failed in prompt_onInit" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "failed in new_prompt" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "Caught SIGSEGV: Aborting toxic session.\n" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "Toxic session aborted with error code %d (%s)\n" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "Failed in queue_init_message" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "Failed to bootstrap %s:%d\n" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "Failed to add TCP relay %s:%d\n" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "Enter a new password (must be at least %d characters) " + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "Password must be between %d and %d characters long. " + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "Enter password again " + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "Passwords don't match. Try again. " + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "Data file '%s' is encrypted" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "tox_pass_encrypt() failed with error %d\n" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "Forcing IPv4 connection" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "Using %s proxy %s : %d" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "UDP disabled" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "Use the -t option to disable UDP." + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "failed in load_toxic" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "Data file '%s' has been unencrypted" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" +"Warning: passed --unencrypt-data option with unencrypted data file '%s'" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "Enter password (\"%s\" to quit) " + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "Invalid password. Try again. " + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "tox_pass_decrypt() failed" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "Falling back to ipv4" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "tox_new returned fatal error" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "tox_new returned non-fatal error %d" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "Toxic User" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "Auto-connect failed with error code %d" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "usage: toxic [OPTION] [FILE ...]\n" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "Force IPv4 connection\n" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "Enable stderr for debugging\n" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "Use specified config file\n" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "Use default POSIX locale\n" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "Encrypt an unencrypted data file\n" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "Use specified data file\n" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "Show this message and exit\n" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "Use specified DHTnodes file\n" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "Do not connect to the DHT network\n" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "Use SOCKS5 proxy: Requires [IP] [port]\n" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "Use HTTP proxy: Requires [IP] [port]\n" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "Use specified DNSservers file\n" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "Force TCP connection (use this with proxies)\n" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "Unencrypt an encrypted data file\n" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "stderr enabled" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "Config file not found" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "Using default POSIX locale" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "failed in parse_args" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "Using '%s' data file" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "DHTnodes file not found" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "DHT disabled" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "Proxy error" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "DNSservers file not found" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "Encrypt existing data file? Y/n (q to quit)" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "failed in main" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "X failed to initialize" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "Failed to init audio devices" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "Failed to load user settings" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "Failed to init mplex auto-away." + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "WARNING: Failed to save to data file" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "Anonymous" + +#: ../src/toxic.h:44 +msgid "Tox User" +msgstr "Tox User" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "failed in set_next_window" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "failed in init_windows" diff --git a/translations/it.mo b/translations/it.mo new file mode 100644 index 0000000000000000000000000000000000000000..a7aaff16b0085e79ff2c15ad3b6dfc55088ae8ba GIT binary patch literal 30657 zcmb8237j2Oo$pIgkY-)uW} z!yCtCaCr#m;Kq#NiaO|fD&jIDE)$3JuEYe3zPf@gsA5N$Sb|O!IQvy!DGSC zfX@cM0jmBZp!#u$Z|fZc9?tz~?tU3~4EN`Qr-GY6wKD-82e!fIfUf`t!1sZdf)9Z` zVDA#o(~!4<-Cz||{g;7y?_Hq!^A1qu{ti^XzXBc)eiziZeg&%D$uuHd4n6~12ddr% zP~*G~R6kpw`h5ooNxip$4AuLTd;Wb;^?wB(2|f<$y$3TGjptbY(R)^dJ~#xb{*4Y_ z>F{sCr9A%vsB!!nJPJJYx%U2KkSX(4xcgy{p?Fo0|GZlq-V3VSmmU5BjJQ7%BKCoM z!HwWOpyuac@I>$lQ1f^UMACTA0Y!(kpy;;)90PZQD)&i{E_&YrMW^3`YUku$+wWB% zr0@nowO0k73C@DzOGOWzYX-ce>N`c(ln&R2m) zgZG2#$7ey&@w=et`%6&oIsRN*ei?WS_g8^Offa`dsQ16b-MKM2B_-j_kq zU&J{KI1W4hd{F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yV8B3pV78>9Snru?vq&1O+d=Xwn%y6_@0EdDFR zj;vUiaHmzU1y9HXChgzm;*aCN{y8_ghEU0cPZZKkP{VNU073epg4-+3zE4P3)x{kj zc3rnKVE3s)Me7_XSdH84$@Z%kc56+{Ud$`(xaF(2()Nc4W|X`6a$&%k85k`8W+5;i zEu_WlrwfY~EbnQ%j~CQid*)6b6d2QGdYbJD7euU<&&lp zcIuJ#&h>SJ_Rd@LJo8ZB0GQa7v7A!ey+-Po4WnPpu^<}Ky5Eu1Y-O28uvckbOk_r7 zpM+NEbG~~p3qq^{N6JugvTIs7by%3pC(2fi-r)H7#^Gx@rn-@%C!NO3u}^9pN`>2r z7!zi)tU>f&;h4-vCr=+lG-6!x2|f=pP9zVFvqE5ky*%d*Xk!y^0+Gc*hJ1sPWRo|b zU3INFP!`>oXam`2681=?(e}ZtJVJdcLHN7WKpNxg?)+e)+wIsp^HTuK^ z87~j(vsS&}OdCD6Ttl~?LJ-)3S>!_$zoC#7li#CVb!ymMj_LjHp~LIaJ+yhTsjI#2 z!e*%i<||n(fvWtb4!Loqj@*l|wT-P0fhXZCwI+ z{ErZe&x@Z?bmSC2q$p=$8u=?s)-r~rtkTC6<(!VsDN31gKg%Cf%+Ge8RFpFEk0HgIcDd#b#-xFy*z1NF@{cmgGTm)SX1BY#X|KHLSgvY6 z&FE;Lg4K&3YUFP(ZByHhF7&0wVigd9Zp|Q{M6k)N2}h?o z5i#FpgqC=Vm6NWvWucxeu2p;f4M*02LT2_EN0uqon!eh8$e}aN>1Q0qKDzHX>}MSM OOaNQsrhNZ " +msgstr "Richiede: " + +#: ../src/global_commands.c:261 +msgid "Invalid port." +msgstr "Porta non valida." + +#: ../src/global_commands.c:274 +msgid "Bootstrap failed: Invalid IP." +msgstr "Bootstrap fallito: IP non valido." + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "Bootstrap fallito: porta non valida." + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "Bootstrap fallito." + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "Specifica il tipo di chat di gruppo: %s" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "I tipi di chat di gruppo permessi sono: %s" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "Chat di gruppo [%d] creata." + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "" +"La cronologia chat per questa finestra è ON. Usa \"/log off\" per " +"disabilitarla." + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "" +"La cronologia chat per questa finestra è OFF. Usa \"/log on\" per abilitarla." + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "Cronologia chat abilitata" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "Cronologia chat disabilitata" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "Opzione non valida. Usa \"%s\" per impostare la cronologia chat." + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "Input richiesto." + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "Nome non valido." + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "Il messaggio di stato deve essere tra virgolette." + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "Nessuna richiesta d'amicizia in sospeso." + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "Richiede uno stato. Gli stati sono: %s." + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "Stato non valido. Gli stati disponibilit sono: %s." + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "Titolo impostato a: \"%s\"" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "Titolo non impostato" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "Il titolo deve essere tra virgolette." + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "Errore nell'impostare il titolo." + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr " ha impostato il titolo a: \"%s\"" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "ha impostato il titolo a \"%s\"" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "errore in \"init_groupchat_win\"" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "Inizializzazione fallita delle chat di gruppo audio\n" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "errore in \"copy_peernames\"" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "è entrato nella chat" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "ha lasciato la chat" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr " è ora conosciuto come " + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "è ora conosciuto come %s" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "Sintassi non valida.\n" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr " * Errore nell'inviare l'azione." + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr " * Errore nell'inviare il messaggio." + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "Utenti: %d\n" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "errore in \"groupchat_onInit\"" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "sorgente: %d, coda: %d, processati: %d\n" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "\"dvhandle\" è null)\n" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "\"ctx\" è null\n" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "scritto: %d\n" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "Chat di gruppo %d" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "errore in \"new_group_chat\"" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "Comandi Globali:\n" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "Aggiungi contatto con un messaggio opzionale\n" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "Accetta richiesta d'amicizia\n" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "Imposta un avatar (lascia vuoto per resettare)\n" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "Rifiuta richiesta d'amicizia\n" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "Mostra le richieste d'amicizia in sospeso\n" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "Connettiti manualmente ad un nodo DHT\n" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "Imposta lo stato con un messaggio opzionale\n" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "Imposta il messaggio di stato\n" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "Imposta il nickname\n" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "Abilita/disabilita cronologia chat\n" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "Crea una caht di gruppo di tipo: text|audio\n" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "Mostra il tuo Tox ID\n" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "Pulisce la cronologia della finestra\n" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "Chiude la fiestra di chat corrente\n" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "Esce da Toxic\n" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" +"\n" +" Audio:\n" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "Mostra i dispositivi di tipo:" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "Imposta il device attivo\n" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "Comandi Chat:\n" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "Invita un contatto ad una chat di gruppo\n" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "Unisciti ad una chat di gruppo a cui sei stato invitato\n" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "Invia un file\n" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "Accetta la ricezione di un file\n" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "Annulla trasferimento file di tipo:" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "Chiamata audio\n" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "Rispondi ad una chiamata\n" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "Rifiuta una chiamata\n" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "Termina una chiamata attiva\n" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "Cambia il dispositivo attivo\n" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "Disabilita il dispositivo attivo mentre sei in una chiamata\n" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "Sensibilità VAD\n" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "Mappatura tasti:\n" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "Naviga tra le schede\n" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "Scorri la cronologia della finestra di una riga\n" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "Scorri la cronologia della finestra di metà pagina\n" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "Vai in fondo alla finestra\n" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "Scorre la lista utenti nelle chat di gruppo\n" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" +"Mostra/nasconde la lista degli utenti nelle chat di gruppo\n" +"\n" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" +" (Nota: mappature personalizzate sovrascrivono i defaults.)\n" +"\n" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "Comandi chat di gruppo:\n" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" +"Imposta il titolo (mostra il titolo corrente se non è specificato niente)\n" +"\n" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "Controllo lista contatti:\n" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr " Frecce Su e Giù : Scorri la lista\n" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" +" Frecce Destra e Sinistra : Cambia tra lista contatti e lista " +"bloccati\n" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" +" Invio : Apre una finestra di chat con il contatto " +"selezionato\n" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr "" +" Canc : Elimina un contatto definitivamente\n" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "Blocca o sblocca un contatto\n" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "errore in \"line_info_init\"" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "errore in \"line_info_add\"" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "errore in \"load_chat_history\"" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr " * Errore nel leggere il file della cronologia chat" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "errore in \"cqueue_message\"" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "errore in \"get_file_name\"" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "Errore nell'impostare il messaggio di stato (errore %d)\n" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "ERRORE" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "Online" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "Assente" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "Occupato" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr " [Offline]" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "%s si è connesso" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "%s si è disconnesso" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "Richiesta d'amicizia con il messaggio '%s'" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "Coda delle richieste d'amicizia piena. Richiesta scartata." + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "Scrivi \"%s %d\" o \"%s %d\"" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "Toxing on Toxic" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "Benvenuto in Toxic, un client gratis e open source per la rete Tox." + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" +"Usa \"%s\" per ricevere assistenza. Ulteriori aiuto può essere ottenuto " +"attraverso la pagina di manuale." + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "errore in \"prompt_onInit\"" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "errore in \"new_prompt\"" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "Ricevuto segnale SIGSEGV: chiudo sessione.\n" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "Sessio ciusa con errore %d (%s)\n" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" +"Impossibile impostare la localizzazione, controlla le impostazione o " +"disabilita il supporto unicode con l'opzione \"-d\"." + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "errore in \"queue_init_message\"" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "Bootstrap fallito %s:%d\n" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "Errore aggiungendo relay TCP %s:%d\n" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "Inserisci una nuova password (deve contenere almeno %d caratteri) " + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "La password deve essere lunga tra %d e %d caratteri. " + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "Reinserisci password " + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "Le passwords non corrispondono. Riprova. " + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "Il file dati '%s' è criptato" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "\"tox_pass_encrypt()\" fallita con errore %d\n" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "Forzata connessione IPv4" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "Uso %s proxy %s:%d" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "UDP disabilitato" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" +"ATTENZIONE: usare un proxy senza disabilitare UDP potrebbe portare alla " +"rivelazione del tuo vero IP." + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "Usa l'optione \"-t\" per disabilitare UDP." + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "errore in \"load_toxic\"" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "Il file di dati '%s' è stato decriptato" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" +"Attenzione: opzione \"--unencrypt-data\" usata con un file di dati non " +"criptato (%s)" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "Inserisci password (\"%s\" per uscire) " + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "Password errata. Riprova. " + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "\"tox_pass_decrypt()\" fallita" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "Ritorno a IPv4" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "\"tox_new\" ha ritornato un errore fatale" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "\"tox_new\" ha ritornato un errore non fatale %d" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "Utente Toxic" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "Connessione automatica fallita con errore %d" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "uso: toxic [OPZIONE] [FILE...]\n" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "Forza connessioni IPv4\n" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "Abilita stderr per il debugging\n" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "Usa il file di configurazione specificato\n" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "Usa localizzazione POSIX di default\n" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "Cripta un file di dati non criptato\n" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "Usa il file di dati specificato\n" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "Mostra questo messaggio ed esce\n" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "Usa il file DHTnodes specificato\n" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "Non si connette alla rete DHT\n" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "Usa proxy SOCKS5: richiede [IP] [porta]\n" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "Usa proxy HTTP: richiede [IP] [porta]\n" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "Usa il file DNSservers specificato\n" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "Forza connessioni TCP (usa questa opzione per i proxies)\n" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "Decripta un file di dati criptato\n" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "stderr abilitato" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "File di configurazione non trovato" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "Uso localizzazione POSIX di default" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "erorre in \"parse_args\"" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "Uso il file di dati '%s'" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "File DHTnodes non trovato" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "DHT disabilitato" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "Errore proxy" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "File DNSservers non trovato" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "Attenzione: usando \"%s\" e \"%s\" simultaneamente non avrà effetto" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "" +"Creazione di un nuovo file di dati. Vuoi criptarlo? Y/n (\"q\" per uscire)" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "Criptare il file di dati esistente? Y/n (\"q\" per uscire)" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "errore in \"main\"" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "Errore inizializzazione X" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "Inizializzazione dispositivi audio fallita" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" +"Impossibile determinare la directory delle configurazioni. Uso 'data' come " +"file di dati..." + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "Errore nel caricamento delle impostazioni utente" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "Errore nell'inizializzazione di mplex auto-away." + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "ATTENZIONE: salvataggio file di dati fallito" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "Anonimo" + +#: ../src/toxic.h:44 +msgid "Tox User" +msgstr "Utente Toxic" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "errore in \"set_next_window\"" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "errore in \"init_windows\"" diff --git a/translations/tools/create_mo.sh b/translations/tools/create_mo.sh new file mode 100755 index 0000000..b0de40c --- /dev/null +++ b/translations/tools/create_mo.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale (for example \"en\"): " + read loc +done + +cd .. + +if [ ! -e "$loc.po" ]; then + echo "File \"$loc.po\" not found" + echo "The translation file must exist" + exit 1 +else + msgfmt -c -o $loc.mo $loc.po +fi diff --git a/translations/tools/create_po.sh b/translations/tools/create_po.sh new file mode 100755 index 0000000..6a884a6 --- /dev/null +++ b/translations/tools/create_po.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale to create (for example \"en\"): " + read loc +done + +cd .. + +if [ -e "$loc.po" ]; then + echo "File \"$loc.po\" found" + echo "The translation file must not exist" + exit 1 +else + v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ") + echo "PACKAGE_NAME=Toxic" > configure + echo "PACKAGE_VERSION=$v" >> configure + msginit --no-translator -l $loc -o $loc.po -i toxic.pot + rm -f configure +fi diff --git a/translations/tools/update_po.sh b/translations/tools/update_po.sh new file mode 100755 index 0000000..ee352ff --- /dev/null +++ b/translations/tools/update_po.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cd $(dirname $0) + +loc="$1" +while [ -z "$1" -a -z "$loc" ]; do + echo -n "Insert locale to update (for example \"en\"): " + read loc +done + +cd .. + +if [ ! -e "$loc.po" ]; then + echo "File \"$loc.po\" not found" + echo "The translation file must exist" + exit 1 +else + msgmerge -U --backup=none --previous $loc.po toxic.pot +fi diff --git a/translations/tools/update_pot.sh b/translations/tools/update_pot.sh new file mode 100755 index 0000000..e182ea9 --- /dev/null +++ b/translations/tools/update_pot.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +cd $(dirname $0)/.. +v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ") +xgettext --default-domain="toxic" \ + --from-code="UTF-8" \ + --copyright-holder="Toxic Team" \ + --msgid-bugs-address="JFreegman@tox.im" \ + --package-name="Toxic" \ + --package-version="$v" \ + --output="toxic.pot" \ + ../src/* diff --git a/translations/toxic.pot b/translations/toxic.pot new file mode 100644 index 0000000..278d575 --- /dev/null +++ b/translations/toxic.pot @@ -0,0 +1,1574 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Toxic Team +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Toxic 0.6.0\n" +"Report-Msgid-Bugs-To: JFreegman@tox.im\n" +"POT-Creation-Date: 2015-05-30 11:30+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/audio_call.c:133 +msgid "Failed to init devices" +msgstr "" + +#: ../src/audio_call.c:195 ../src/audio_call.c:201 +msgid "Could not prepare transmission" +msgstr "" + +#: ../src/audio_call.c:217 +msgid "Failed to open input device!" +msgstr "" + +#: ../src/audio_call.c:222 +msgid "Failed to register input handler!" +msgstr "" + +#: ../src/audio_call.c:226 +msgid "Failed to open output device!" +msgstr "" + +#: ../src/audio_call.c:284 ../src/audio_call.c:303 +msgid "Error starting transmission!" +msgstr "" + +#: ../src/audio_call.c:357 ../src/audio_call.c:392 ../src/audio_call.c:423 +#: ../src/audio_call.c:454 +msgid "Unknown arguments." +msgstr "" + +#: ../src/audio_call.c:362 ../src/audio_call.c:397 ../src/audio_call.c:428 +#: ../src/audio_call.c:459 +msgid "Audio not supported!" +msgstr "" + +#: ../src/audio_call.c:367 +msgid "Friend is offline." +msgstr "" + +#: ../src/audio_call.c:374 +msgid "Already in a call!" +msgstr "" + +#: ../src/audio_call.c:375 ../src/audio_call.c:406 ../src/audio_call.c:437 +#: ../src/audio_call.c:479 +msgid "Internal error!" +msgstr "" + +#: ../src/audio_call.c:380 +#, c-format +msgid "Calling... idx: %d" +msgstr "" + +#: ../src/audio_call.c:404 +msgid "Cannot answer in invalid state!" +msgstr "" + +#: ../src/audio_call.c:405 ../src/audio_call.c:436 +msgid "No incoming call!" +msgstr "" + +#: ../src/audio_call.c:432 +msgid "Why not?" +msgstr "" + +#: ../src/audio_call.c:435 +msgid "Cannot reject in invalid state!" +msgstr "" + +#: ../src/audio_call.c:467 +msgid "Only those who appreciate small things know the beauty that is life" +msgstr "" + +#: ../src/audio_call.c:471 ../src/chat.c:653 +msgid "Call canceled!" +msgstr "" + +#: ../src/audio_call.c:477 +msgid "Cannot hangup in invalid state!" +msgstr "" + +#: ../src/audio_call.c:478 +msgid "No call!" +msgstr "" + +#: ../src/audio_call.c:494 ../src/audio_call.c:526 ../src/audio_call.c:570 +#: ../src/audio_call.c:643 +msgid "Type must be specified!" +msgstr "" + +#: ../src/audio_call.c:495 +msgid "Only one argument allowed!" +msgstr "" + +#: ../src/audio_call.c:509 ../src/audio_call.c:542 ../src/audio_call.c:586 +#: ../src/audio_call.c:658 +#, c-format +msgid "Invalid type: %s" +msgstr "" + +#: ../src/audio_call.c:527 ../src/audio_call.c:571 +msgid "Must have id!" +msgstr "" + +#: ../src/audio_call.c:528 ../src/audio_call.c:572 ../src/audio_call.c:644 +#: ../src/audio_call.c:690 +msgid "Only two arguments allowed!" +msgstr "" + +#: ../src/audio_call.c:551 ../src/audio_call.c:595 ../src/audio_call.c:699 +msgid "Invalid input" +msgstr "" + +#: ../src/audio_call.c:556 ../src/audio_call.c:600 +msgid "Invalid selection!" +msgstr "" + +#: ../src/audio_call.c:689 +msgid "Must have value!" +msgstr "" + +#: ../src/audio_call.c:728 +msgid "Not interested anymore" +msgstr "" + +#: ../src/audio_call.c:731 +msgid "Not interested" +msgstr "" + +#: ../src/autocomplete.c:126 +msgid "failed in complete_line" +msgstr "" + +#: ../src/avatars.c:68 +#, c-format +msgid "tox_file_send failed for friendnumber %d (error %d)\n" +msgstr "" + +#: ../src/avatars.c:212 +#, c-format +msgid "tox_file_send_chunk failed in avatar callback (error %d)\n" +msgstr "" + +#: ../src/chat.c:56 +msgid "yes" +msgstr "" + +#: ../src/chat.c:57 +msgid "no" +msgstr "" + +#: ../src/chat.c:223 ../src/prompt.c:360 +msgid "has come online" +msgstr "" + +#: ../src/chat.c:234 ../src/prompt.c:372 +msgid "has gone offline" +msgstr "" + +#: ../src/chat.c:319 +#, c-format +msgid "File '%s' successfully sent." +msgstr "" + +#: ../src/chat.c:326 +#, c-format +msgid "File transfer for '%s' failed: Null file pointer." +msgstr "" + +#: ../src/chat.c:333 +#, c-format +msgid "File transfer for '%s' failed: Seek fail." +msgstr "" + +#: ../src/chat.c:345 +#, c-format +msgid "File transfer for '%s' failed: Read fail." +msgstr "" + +#: ../src/chat.c:354 +#, c-format +msgid "tox_file_send_chunk failed in chat callback (error %d)\n" +msgstr "" + +#: ../src/chat.c:377 +#, c-format +msgid "File '%s' successfully received." +msgstr "" + +#: ../src/chat.c:384 +#, c-format +msgid "File transfer for '%s' failed: Invalid file pointer." +msgstr "" + +#: ../src/chat.c:390 +#, c-format +msgid "File transfer for '%s' failed: Write fail." +msgstr "" + +#: ../src/chat.c:416 +#, c-format +msgid "File transfer [%d] for '%s' accepted." +msgstr "" + +#: ../src/chat.c:434 +#, c-format +msgid "File transfer for '%s' was aborted." +msgstr "" + +#: ../src/chat.c:450 ../src/chat_commands.c:309 +msgid "File transfer failed: Too many concurrent file transfers." +msgstr "" + +#: ../src/chat.c:456 +#, c-format +msgid "File transfer request for '%s' (%s)" +msgstr "" + +#: ../src/chat.c:471 +msgid "File transfer faield: File path too long." +msgstr "" + +#: ../src/chat.c:497 +msgid "File transfer failed: invalid file path." +msgstr "" + +#: ../src/chat.c:502 +#, c-format +msgid "Type '%s %d' to accept the file transfer." +msgstr "" + +#: ../src/chat.c:515 ../src/chat.c:518 +#, c-format +msgid "Incoming file: %s" +msgstr "" + +#: ../src/chat.c:533 +msgid "Failed in chat_onGroupInvite" +msgstr "" + +#: ../src/chat.c:547 ../src/chat.c:549 +msgid "invites you to join group chat" +msgstr "" + +#: ../src/chat.c:551 +#, c-format +msgid "%s has invited you to a group chat." +msgstr "" + +#: ../src/chat.c:552 +#, c-format +msgid "Type \"%s\" to join the chat." +msgstr "" + +#: ../src/chat.c:566 +#, c-format +msgid "Incoming audio call! Type: \"%s\" or \"%s\"" +msgstr "" + +#: ../src/chat.c:573 ../src/chat.c:575 +msgid "Incoming audio call!" +msgstr "" + +#: ../src/chat.c:583 +#, c-format +msgid "Ringing...type \"%s\" to cancel it." +msgstr "" + +#: ../src/chat.c:598 ../src/chat.c:639 +#, c-format +msgid "Call started! Type: \"%s\" to end it." +msgstr "" + +#: ../src/chat.c:612 ../src/chat.c:680 +msgid "Call ended!" +msgstr "" + +#: ../src/chat.c:625 +msgid "Error!" +msgstr "" + +#: ../src/chat.c:666 +msgid "Rejected!" +msgstr "" + +#: ../src/chat.c:693 +msgid "No answer!" +msgstr "" + +#: ../src/chat.c:707 +msgid "Peer disconnected; call ended!" +msgstr "" + +#: ../src/chat.c:769 +msgid " Call Active\n" +msgstr "" + +#: ../src/chat.c:773 +msgid " Duration: " +msgstr "" + +#: ../src/chat.c:778 +msgid " In muted: " +msgstr "" + +#: ../src/chat.c:783 +msgid " Out muted: " +msgstr "" + +#: ../src/chat.c:788 +msgid " VAD level: " +msgstr "" + +#: ../src/chat.c:1080 +msgid "failed in chat_onInit" +msgstr "" + +#: ../src/chat.c:1152 +msgid "failed in new_chat" +msgstr "" + +#: ../src/chat_commands.c:48 +#, c-format +msgid "Requires type %s and the file ID." +msgstr "" + +#: ../src/chat_commands.c:57 ../src/chat_commands.c:74 +#: ../src/chat_commands.c:79 +msgid "Invalid file ID." +msgstr "" + +#: ../src/chat_commands.c:69 +#, c-format +msgid "Type must be '%s' or '%s'." +msgstr "" + +#: ../src/chat_commands.c:83 +#, c-format +msgid "File transfer for '%s' aborted." +msgstr "" + +#: ../src/chat_commands.c:90 +msgid "Group number required." +msgstr "" + +#: ../src/chat_commands.c:97 +msgid "Invalid group number." +msgstr "" + +#: ../src/chat_commands.c:102 +msgid "Failed to invite contact to group." +msgstr "" + +#: ../src/chat_commands.c:106 +#, c-format +msgid "Invited contact to Group %d." +msgstr "" + +#: ../src/chat_commands.c:112 ../src/global_commands.c:324 +msgid " * Warning: Too many windows are open." +msgstr "" + +#: ../src/chat_commands.c:121 +msgid "No pending group chat invite." +msgstr "" + +#: ../src/chat_commands.c:136 ../src/global_commands.c:354 +msgid "Group chat instance failed to initialize." +msgstr "" + +#: ../src/chat_commands.c:141 ../src/global_commands.c:359 +msgid "Group chat window failed to initialize." +msgstr "" + +#: ../src/chat_commands.c:151 +msgid "File ID required." +msgstr "" + +#: ../src/chat_commands.c:158 ../src/chat_commands.c:165 +#: ../src/chat_commands.c:170 +msgid "No pending file transfers with that ID." +msgstr "" + +#: ../src/chat_commands.c:175 +msgid "File transfer failed: Invalid file path." +msgstr "" + +#: ../src/chat_commands.c:186 +#, c-format +msgid "Saving file [%d] as: '%s'" +msgstr "" + +#: ../src/chat_commands.c:201 +msgid "File transfer failed: Friend not found." +msgstr "" + +#: ../src/chat_commands.c:205 +msgid "File transfer failed: Friend is not online." +msgstr "" + +#: ../src/chat_commands.c:209 +msgid "File transfer failed: Invalid filenumber." +msgstr "" + +#: ../src/chat_commands.c:213 +msgid "File transfer failed: Connection error." +msgstr "" + +#: ../src/chat_commands.c:217 +#, c-format +msgid "File transfer failed (error %d)\n" +msgstr "" + +#: ../src/chat_commands.c:227 +msgid "File path required." +msgstr "" + +#: ../src/chat_commands.c:232 +msgid "File path must be enclosed in quotes." +msgstr "" + +#: ../src/chat_commands.c:243 +msgid "File path exceeds character limit." +msgstr "" + +#: ../src/chat_commands.c:250 +msgid "File not found." +msgstr "" + +#: ../src/chat_commands.c:257 +msgid "Invalid file." +msgstr "" + +#: ../src/chat_commands.c:290 +#, c-format +msgid "Sending file [%d]: '%s' (%s)" +msgstr "" + +#: ../src/chat_commands.c:297 +msgid "File transfer failed: Invalid friend." +msgstr "" + +#: ../src/chat_commands.c:301 +msgid "File transfer failed: Friend is offline." +msgstr "" + +#: ../src/chat_commands.c:305 +msgid "File transfer failed: Filename is too long." +msgstr "" + +#: ../src/chat_commands.c:313 +msgid "File transfer failed." +msgstr "" + +#: ../src/configdir.c:125 ../src/toxic.c:1039 ../src/toxic.c:1045 +msgid "failed in load_data_structures" +msgstr "" + +#: ../src/dns.c:155 +#, c-format +msgid "User lookup failed: %s" +msgstr "" + +#: ../src/dns.c:181 +msgid "dn_expand failed." +msgstr "" + +#: ../src/dns.c:186 ../src/dns.c:209 +msgid "DNS reply was too short." +msgstr "" + +#: ../src/dns.c:192 +msgid "Broken DNS reply." +msgstr "" + +#: ../src/dns.c:204 +msgid "Second dn_expand failed." +msgstr "" + +#: ../src/dns.c:217 +msgid "RR overflow." +msgstr "" + +#: ../src/dns.c:222 +msgid "DNS response failed." +msgstr "" + +#: ../src/dns.c:227 +msgid "No record found." +msgstr "" + +#: ../src/dns.c:230 +msgid "Invalid DNS response." +msgstr "" + +#: ../src/dns.c:307 +msgid "Must be a Tox ID or an address in the form username@domain" +msgstr "" + +#: ../src/dns.c:317 +msgid "Domain not found." +msgstr "" + +#: ../src/dns.c:324 +msgid "Core failed to create DNS object." +msgstr "" + +#: ../src/dns.c:335 +msgid "Core failed to generate DNS3 string." +msgstr "" + +#: ../src/dns.c:349 +msgid "DNS query failed." +msgstr "" + +#: ../src/dns.c:364 +msgid "Bad DNS3 TXT response." +msgstr "" + +#: ../src/dns.c:372 +msgid "Core failed to decrypt DNS response." +msgstr "" + +#: ../src/dns.c:388 +msgid "DNS lookups are disabled." +msgstr "" + +#: ../src/dns.c:393 +msgid "Please wait for previous user lookup to finish." +msgstr "" + +#: ../src/dns.c:403 +#, c-format +msgid "" +"DNS server list failed to load with error code %d. Falling back to hard-" +"coded list." +msgstr "" + +#: ../src/dns.c:416 +msgid "Error: DNS thread attr failed to init" +msgstr "" + +#: ../src/dns.c:422 +msgid "Error: DNS thread attr failed to set" +msgstr "" + +#: ../src/dns.c:429 +msgid "Error: DNS thread failed to init" +msgstr "" + +#: ../src/execute.c:107 +msgid "failed in parse_command" +msgstr "" + +#: ../src/execute.c:121 +msgid "Invalid argument. Did you forget a closing \"?" +msgstr "" + +#: ../src/execute.c:192 +msgid "Invalid command." +msgstr "" + +#: ../src/friendlist.c:93 +msgid "failed in realloc_friends" +msgstr "" + +#: ../src/friendlist.c:113 +msgid "failed in realloc_blocklist" +msgstr "" + +#: ../src/friendlist.c:141 +msgid "Failed in save_blocklist" +msgstr "" + +#: ../src/friendlist.c:208 +msgid "Failed in load_blocklist" +msgstr "" + +#: ../src/friendlist.c:331 ../src/friendlist.c:766 ../src/friendlist.c:1076 +msgid "* Warning: Too many windows are open." +msgstr "" + +#: ../src/friendlist.c:346 +#, c-format +msgid "avatar_send failed for friend %d\n" +msgstr "" + +#: ../src/friendlist.c:421 +#, c-format +msgid "tox_friend_get_public_key failed (error %d)\n" +msgstr "" + +#: ../src/friendlist.c:500 +#, c-format +msgid "* File transfer from %s failed: too many windows are open." +msgstr "" + +#: ../src/friendlist.c:523 +#, c-format +msgid "* Group chat invite from %s failed: too many windows are open." +msgstr "" + +#: ../src/friendlist.c:546 +#, c-format +msgid "tox_friend_delete failed with error %d\n" +msgstr "" + +#: ../src/friendlist.c:626 +msgid "Delete contact " +msgstr "" + +#: ../src/friendlist.c:707 +#, c-format +msgid "Failed to unblock friend (error %d)\n" +msgstr "" + +#: ../src/friendlist.c:803 +msgid " Blocked: " +msgstr "" + +#: ../src/friendlist.c:855 ../src/friendlist.c:1035 +msgid "Key: " +msgstr "" + +#: ../src/friendlist.c:881 +msgid " Press the" +msgstr "" + +#: ../src/friendlist.c:885 +msgid "" +"key for help\n" +"\n" +msgstr "" + +#: ../src/friendlist.c:897 +msgid " Online: " +msgstr "" + +#: ../src/friendlist.c:1011 +#, c-format +msgid " Last seen: Today %s\n" +msgstr "" + +#: ../src/friendlist.c:1015 +#, c-format +msgid " Last seen: Yesterday %s\n" +msgstr "" + +#: ../src/friendlist.c:1019 +#, c-format +msgid " Last seen: %d days ago\n" +msgstr "" + +#: ../src/friendlist.c:1023 +msgid " Last seen: Never\n" +msgstr "" + +#: ../src/friendlist.c:1074 +#, c-format +msgid "Audio action from: %s!" +msgstr "" + +#: ../src/friendlist.c:1126 +msgid "failed in new_friendlist" +msgstr "" + +#: ../src/friendlist.c:1129 +msgid "contacts" +msgstr "" + +#: ../src/global_commands.c:55 ../src/global_commands.c:292 +msgid "Request ID required." +msgstr "" + +#: ../src/global_commands.c:62 ../src/global_commands.c:67 +#: ../src/global_commands.c:299 ../src/global_commands.c:304 +msgid "No pending friend request with that ID." +msgstr "" + +#: ../src/global_commands.c:75 +#, c-format +msgid "Failed to add friend (error %d)\n" +msgstr "" + +#: ../src/global_commands.c:78 +msgid "Friend request accepted." +msgstr "" + +#: ../src/global_commands.c:105 +msgid "Message is too long." +msgstr "" + +#: ../src/global_commands.c:109 +msgid "Please add a message to your request." +msgstr "" + +#: ../src/global_commands.c:113 +msgid "That appears to be your own ID." +msgstr "" + +#: ../src/global_commands.c:117 +msgid "Friend request has already been sent." +msgstr "" + +#: ../src/global_commands.c:121 +msgid "Bad checksum in address." +msgstr "" + +#: ../src/global_commands.c:125 +msgid "Nospam was different." +msgstr "" + +#: ../src/global_commands.c:129 +msgid "Core memory allocation failed." +msgstr "" + +#: ../src/global_commands.c:133 +msgid "Friend request sent." +msgstr "" + +#: ../src/global_commands.c:140 +msgid "Failed to add friend: Unknown error." +msgstr "" + +#: ../src/global_commands.c:150 +msgid "Tox ID or address required." +msgstr "" + +#: ../src/global_commands.c:159 +msgid "Message must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:175 +#, c-format +msgid "Hello, my name is %s. Care to Tox?" +msgstr "" + +#: ../src/global_commands.c:193 +msgid "Invalid Tox ID." +msgstr "" + +#: ../src/global_commands.c:210 +msgid "Avatar is not set." +msgstr "" + +#: ../src/global_commands.c:215 +msgid "Path must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:225 +msgid "Invalid path." +msgstr "" + +#: ../src/global_commands.c:235 +#, c-format +msgid "" +"Failed to set avatar. Avatars must be in PNG format and may not exceed %d " +"bytes." +msgstr "" + +#: ../src/global_commands.c:240 +#, c-format +msgid "Avatar set to '%s'" +msgstr "" + +#: ../src/global_commands.c:252 +msgid "Require: " +msgstr "" + +#: ../src/global_commands.c:261 +msgid "Invalid port." +msgstr "" + +#: ../src/global_commands.c:274 +msgid "Bootstrap failed: Invalid IP." +msgstr "" + +#: ../src/global_commands.c:278 +msgid "Bootstrap failed: Invalid port." +msgstr "" + +#: ../src/global_commands.c:282 +msgid "Bootstrap failed." +msgstr "" + +#: ../src/global_commands.c:329 +#, c-format +msgid "Please specify group type: %s" +msgstr "" + +#: ../src/global_commands.c:340 +#, c-format +msgid "Valid group types are: %s" +msgstr "" + +#: ../src/global_commands.c:364 +#, c-format +msgid "Group chat [%d] created." +msgstr "" + +#: ../src/global_commands.c:374 +msgid "Logging for this window is ON. Type \"/log off\" to disable." +msgstr "" + +#: ../src/global_commands.c:376 +msgid "Logging for this window is OFF. Type \"/log on\" to enable." +msgstr "" + +#: ../src/global_commands.c:397 +msgid "Logging enabled" +msgstr "" + +#: ../src/global_commands.c:406 +msgid "Logging disabled" +msgstr "" + +#: ../src/global_commands.c:411 +#, c-format +msgid "Invalid option. Use \"%s\" to toggle logging." +msgstr "" + +#: ../src/global_commands.c:435 ../src/global_commands.c:468 +msgid "Input required." +msgstr "" + +#: ../src/global_commands.c:452 +msgid "Invalid name." +msgstr "" + +#: ../src/global_commands.c:473 ../src/global_commands.c:561 +msgid "Note must be enclosed in quotes." +msgstr "" + +#: ../src/global_commands.c:499 +msgid "No pending friend requests." +msgstr "" + +#: ../src/global_commands.c:536 +#, c-format +msgid "Require a status. Statuses are: %s." +msgstr "" + +#: ../src/global_commands.c:551 +#, c-format +msgid "Invalid status. Valid statuses are: %s." +msgstr "" + +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "" + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "" + +#: ../src/group_commands.c:80 ../src/groupchat.c:337 +#, c-format +msgid " set the group title to: %s" +msgstr "" + +#: ../src/group_commands.c:83 ../src/groupchat.c:340 +#, c-format +msgid "set title to %s" +msgstr "" + +#: ../src/groupchat.c:143 +msgid "failed in init_groupchat_win" +msgstr "" + +#: ../src/groupchat.c:151 +#, c-format +msgid "Group Audio failed to init\n" +msgstr "" + +#: ../src/groupchat.c:362 +msgid "failed in copy_peernames" +msgstr "" + +#: ../src/groupchat.c:419 +msgid "has joined the room" +msgstr "" + +#: ../src/groupchat.c:517 +msgid "has left the room" +msgstr "" + +#: ../src/groupchat.c:534 +msgid " is now known as " +msgstr "" + +#: ../src/groupchat.c:538 +#, c-format +msgid "is now known as %s" +msgstr "" + +#: ../src/groupchat.c:549 +msgid "Invalid syntax.\n" +msgstr "" + +#: ../src/groupchat.c:554 +msgid " * Failed to send action." +msgstr "" + +#: ../src/groupchat.c:641 +msgid " * Failed to send message." +msgstr "" + +#: ../src/groupchat.c:678 +#, c-format +msgid "Peers: %d\n" +msgstr "" + +#: ../src/groupchat.c:728 +msgid "failed in groupchat_onInit" +msgstr "" + +#: ../src/groupchat.c:813 +#, c-format +msgid "source: %d, queued: %d, processed: %d\n" +msgstr "" + +#: ../src/groupchat.c:852 +#, c-format +msgid "dvhandle is null)\n" +msgstr "" + +#: ../src/groupchat.c:855 +#, c-format +msgid "ctx is null\n" +msgstr "" + +#: ../src/groupchat.c:858 +#, c-format +msgid "write: %d\n" +msgstr "" + +#: ../src/groupchat.c:882 +#, c-format +msgid "Group %d" +msgstr "" + +#: ../src/groupchat.c:888 +msgid "failed in new_group_chat" +msgstr "" + +#: ../src/help.c:148 +msgid "Global Commands:\n" +msgstr "" + +#: ../src/help.c:152 +msgid "Add contact with optional message\n" +msgstr "" + +#: ../src/help.c:154 +msgid "Accept friend request\n" +msgstr "" + +#: ../src/help.c:156 +msgid "Set an avatar (leave path empty to unset)\n" +msgstr "" + +#: ../src/help.c:158 +msgid "Decline friend request\n" +msgstr "" + +#: ../src/help.c:160 +msgid "List pending friend requests\n" +msgstr "" + +#: ../src/help.c:162 +msgid "Manually connect to a DHT node\n" +msgstr "" + +#: ../src/help.c:164 +msgid "Set status with optional note\n" +msgstr "" + +#: ../src/help.c:166 +msgid "Set a personal note\n" +msgstr "" + +#: ../src/help.c:168 +msgid "Set your nickname\n" +msgstr "" + +#: ../src/help.c:170 +msgid "Enable/disable logging\n" +msgstr "" + +#: ../src/help.c:172 +msgid "Create a group chat where type: text | audio\n" +msgstr "" + +#: ../src/help.c:174 +msgid "Print your Tox ID\n" +msgstr "" + +#: ../src/help.c:176 +msgid "Clear window history\n" +msgstr "" + +#: ../src/help.c:178 +msgid "Close the current chat window\n" +msgstr "" + +#: ../src/help.c:180 +msgid "Exit Toxic\n" +msgstr "" + +#: ../src/help.c:184 ../src/help.c:224 +msgid "" +"\n" +" Audio:\n" +msgstr "" + +#: ../src/help.c:188 +msgid "List devices where type:" +msgstr "" + +#: ../src/help.c:191 +msgid "Set active device\n" +msgstr "" + +#: ../src/help.c:207 +msgid "Chat Commands:\n" +msgstr "" + +#: ../src/help.c:211 +msgid "Invite contact to a group chat\n" +msgstr "" + +#: ../src/help.c:213 +msgid "Join a pending group chat\n" +msgstr "" + +#: ../src/help.c:215 +msgid "Send a file\n" +msgstr "" + +#: ../src/help.c:217 +msgid "Receive a file\n" +msgstr "" + +#: ../src/help.c:219 +msgid "Cancel file transfer where type:" +msgstr "" + +#: ../src/help.c:228 +msgid "Audio call\n" +msgstr "" + +#: ../src/help.c:230 +msgid "Answer incoming call\n" +msgstr "" + +#: ../src/help.c:232 +msgid "Reject incoming call\n" +msgstr "" + +#: ../src/help.c:234 +msgid "Hangup active call\n" +msgstr "" + +#: ../src/help.c:236 +msgid "Change active device\n" +msgstr "" + +#: ../src/help.c:238 +msgid "Mute active device if in call\n" +msgstr "" + +#: ../src/help.c:240 +msgid "VAD sensitivity threshold\n" +msgstr "" + +#: ../src/help.c:256 +msgid "Key bindings:\n" +msgstr "" + +#: ../src/help.c:260 +msgid "Navigate through the tabs\n" +msgstr "" + +#: ../src/help.c:262 +msgid "Scroll window history one line\n" +msgstr "" + +#: ../src/help.c:264 +msgid "Scroll window history half a page\n" +msgstr "" + +#: ../src/help.c:266 +msgid "Move to the bottom of window history\n" +msgstr "" + +#: ../src/help.c:268 +msgid "Scroll peer list in groupchats\n" +msgstr "" + +#: ../src/help.c:270 +msgid "" +"Toggle the groupchat peerlist\n" +"\n" +msgstr "" + +#: ../src/help.c:271 +msgid "" +" (Note: Custom keybindings override these defaults.)\n" +"\n" +msgstr "" + +#: ../src/help.c:286 +msgid "Group commands:\n" +msgstr "" + +#: ../src/help.c:290 +msgid "" +"Set group title (show current title if no msg)\n" +"\n" +msgstr "" + +#: ../src/help.c:305 +msgid "Friendlist controls:\n" +msgstr "" + +#: ../src/help.c:308 +msgid " Up and Down arrows : Scroll through list\n" +msgstr "" + +#: ../src/help.c:309 +msgid "" +" Right and Left arrows : Switch between friendlist and blocked " +"list\n" +msgstr "" + +#: ../src/help.c:310 +msgid "" +" Enter : Open a chat window with selected contact\n" +msgstr "" + +#: ../src/help.c:311 +msgid " Delete : Permanently delete a contact\n" +msgstr "" + +#: ../src/help.c:313 +msgid "Block or unblock a contact\n" +msgstr "" + +#: ../src/line_info.c:50 +msgid "failed in line_info_init" +msgstr "" + +#: ../src/line_info.c:150 +msgid "failed in line_info_add" +msgstr "" + +#: ../src/log.c:189 +msgid "failed in load_chat_history" +msgstr "" + +#: ../src/log.c:193 ../src/log.c:199 +msgid " * Failed to read log file" +msgstr "" + +#: ../src/message_queue.c:56 +msgid "failed in cqueue_message" +msgstr "" + +#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 +msgid "failed in get_file_name" +msgstr "" + +#: ../src/prompt.c:139 +#, c-format +msgid "Failed to set note (error %d)\n" +msgstr "" + +#: ../src/prompt.c:271 +msgid "ERROR" +msgstr "" + +#: ../src/prompt.c:275 +msgid "Online" +msgstr "" + +#: ../src/prompt.c:279 +msgid "Away" +msgstr "" + +#: ../src/prompt.c:283 +msgid "Busy" +msgstr "" + +#: ../src/prompt.c:296 +msgid " [Offline]" +msgstr "" + +#: ../src/prompt.c:366 ../src/prompt.c:369 +#, c-format +msgid "%s has come online" +msgstr "" + +#: ../src/prompt.c:378 ../src/prompt.c:381 +#, c-format +msgid "%s has gone offline" +msgstr "" + +#: ../src/prompt.c:392 ../src/prompt.c:393 +#, c-format +msgid "Friend request with the message '%s'" +msgstr "" + +#: ../src/prompt.c:398 +msgid "Friend request queue is full. Discarding request." +msgstr "" + +#: ../src/prompt.c:403 +#, c-format +msgid "Type \"%s %d\" or \"%s %d\"" +msgstr "" + +#: ../src/prompt.c:432 ../src/prompt.c:433 +#, c-format +msgid "Toxing on Toxic" +msgstr "" + +#: ../src/prompt.c:455 +msgid "" +"Welcome to Toxic, a free, open source Tox-based instant messenging client." +msgstr "" + +#: ../src/prompt.c:457 +#, c-format +msgid "Type \"%s\" for assistance. Further help may be found via the man page." +msgstr "" + +#: ../src/prompt.c:476 +msgid "failed in prompt_onInit" +msgstr "" + +#: ../src/prompt.c:514 +msgid "failed in new_prompt" +msgstr "" + +#: ../src/toxic.c:112 +#, c-format +msgid "Caught SIGSEGV: Aborting toxic session.\n" +msgstr "" + +#: ../src/toxic.c:161 +#, c-format +msgid "Toxic session aborted with error code %d (%s)\n" +msgstr "" + +#: ../src/toxic.c:171 +msgid "" +"Could not set your locale, please check your locale settings or disable " +"unicode support with the -d flag." +msgstr "" + +#: ../src/toxic.c:231 ../src/toxic.c:236 +msgid "Failed in queue_init_message" +msgstr "" + +#: ../src/toxic.c:328 +#, c-format +msgid "Failed to bootstrap %s:%d\n" +msgstr "" + +#: ../src/toxic.c:335 +#, c-format +msgid "Failed to add TCP relay %s:%d\n" +msgstr "" + +#: ../src/toxic.c:466 +#, c-format +msgid "Enter a new password (must be at least %d characters) " +msgstr "" + +#: ../src/toxic.c:476 +#, c-format +msgid "Password must be between %d and %d characters long. " +msgstr "" + +#: ../src/toxic.c:481 +#, c-format +msgid "Enter password again " +msgstr "" + +#: ../src/toxic.c:489 +#, c-format +msgid "Passwords don't match. Try again. " +msgstr "" + +#: ../src/toxic.c:496 +#, c-format +msgid "Data file '%s' is encrypted" +msgstr "" + +#: ../src/toxic.c:533 +#, c-format +msgid "tox_pass_encrypt() failed with error %d\n" +msgstr "" + +#: ../src/toxic.c:584 +msgid "Forcing IPv4 connection" +msgstr "" + +#: ../src/toxic.c:592 +#, c-format +msgid "Using %s proxy %s : %d" +msgstr "" + +#: ../src/toxic.c:597 +msgid "UDP disabled" +msgstr "" + +#: ../src/toxic.c:599 +msgid "" +"WARNING: Using a proxy without disabling UDP may leak your real IP address." +msgstr "" + +#: ../src/toxic.c:601 +msgid "Use the -t option to disable UDP." +msgstr "" + +#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 +#: ../src/toxic.c:722 +msgid "failed in load_toxic" +msgstr "" + +#: ../src/toxic.c:639 +#, c-format +msgid "Data file '%s' has been unencrypted" +msgstr "" + +#: ../src/toxic.c:641 +#, c-format +msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" +msgstr "" + +#: ../src/toxic.c:649 +#, c-format +msgid "Enter password (\"%s\" to quit) " +msgstr "" + +#: ../src/toxic.c:666 ../src/toxic.c:690 +#, c-format +msgid "Invalid password. Try again. " +msgstr "" + +#: ../src/toxic.c:693 +msgid "tox_pass_decrypt() failed" +msgstr "" + +#: ../src/toxic.c:737 +msgid "Falling back to ipv4" +msgstr "" + +#: ../src/toxic.c:743 +msgid "tox_new returned fatal error" +msgstr "" + +#: ../src/toxic.c:746 +#, c-format +msgid "tox_new returned non-fatal error %d" +msgstr "" + +#: ../src/toxic.c:753 +msgid "Toxic User" +msgstr "" + +#: ../src/toxic.c:779 +#, c-format +msgid "Auto-connect failed with error code %d" +msgstr "" + +#: ../src/toxic.c:860 +#, c-format +msgid "usage: toxic [OPTION] [FILE ...]\n" +msgstr "" + +#: ../src/toxic.c:862 +#, c-format +msgid "Force IPv4 connection\n" +msgstr "" + +#: ../src/toxic.c:864 +#, c-format +msgid "Enable stderr for debugging\n" +msgstr "" + +#: ../src/toxic.c:866 +#, c-format +msgid "Use specified config file\n" +msgstr "" + +#: ../src/toxic.c:868 +#, c-format +msgid "Use default POSIX locale\n" +msgstr "" + +#: ../src/toxic.c:870 +#, c-format +msgid "Encrypt an unencrypted data file\n" +msgstr "" + +#: ../src/toxic.c:872 +#, c-format +msgid "Use specified data file\n" +msgstr "" + +#: ../src/toxic.c:874 +#, c-format +msgid "Show this message and exit\n" +msgstr "" + +#: ../src/toxic.c:876 +#, c-format +msgid "Use specified DHTnodes file\n" +msgstr "" + +#: ../src/toxic.c:878 +#, c-format +msgid "Do not connect to the DHT network\n" +msgstr "" + +#: ../src/toxic.c:880 +#, c-format +msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" +msgstr "" + +#: ../src/toxic.c:882 +#, c-format +msgid "Use HTTP proxy: Requires [IP] [port]\n" +msgstr "" + +#: ../src/toxic.c:884 +#, c-format +msgid "Use specified DNSservers file\n" +msgstr "" + +#: ../src/toxic.c:886 +#, c-format +msgid "Force TCP connection (use this with proxies)\n" +msgstr "" + +#: ../src/toxic.c:888 +#, c-format +msgid "Unencrypt an encrypted data file\n" +msgstr "" + +#: ../src/toxic.c:932 +msgid "stderr enabled" +msgstr "" + +#: ../src/toxic.c:939 +msgid "Config file not found" +msgstr "" + +#: ../src/toxic.c:945 +msgid "Using default POSIX locale" +msgstr "" + +#: ../src/toxic.c:958 +msgid "failed in parse_args" +msgstr "" + +#: ../src/toxic.c:963 +#, c-format +msgid "Using '%s' data file" +msgstr "" + +#: ../src/toxic.c:971 +msgid "DHTnodes file not found" +msgstr "" + +#: ../src/toxic.c:977 +msgid "DHT disabled" +msgstr "" + +#: ../src/toxic.c:985 ../src/toxic.c:995 +msgid "Proxy error" +msgstr "" + +#: ../src/toxic.c:1004 +msgid "DNSservers file not found" +msgstr "" + +#: ../src/toxic.c:1101 +#, c-format +msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" +msgstr "" + +#: ../src/toxic.c:1114 +msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" +msgstr "" + +#: ../src/toxic.c:1116 +msgid "Encrypt existing data file? Y/n (q to quit)" +msgstr "" + +#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 +#: ../src/toxic.c:1153 ../src/toxic.c:1161 +msgid "failed in main" +msgstr "" + +#: ../src/toxic.c:1130 +msgid "X failed to initialize" +msgstr "" + +#: ../src/toxic.c:1168 +msgid "Failed to init audio devices" +msgstr "" + +#: ../src/toxic.c:1177 +msgid "" +"Unable to determine configuration directory. Defaulting to 'data' for data " +"file..." +msgstr "" + +#: ../src/toxic.c:1182 +msgid "Failed to load user settings" +msgstr "" + +#: ../src/toxic.c:1186 +msgid "Failed to init mplex auto-away." +msgstr "" + +#: ../src/toxic.c:1209 +msgid "WARNING: Failed to save to data file" +msgstr "" + +#: ../src/toxic.h:43 +msgid "Anonymous" +msgstr "" + +#: ../src/toxic.h:44 +msgid "Tox User" +msgstr "" + +#: ../src/windows.c:368 +msgid "failed in set_next_window" +msgstr "" + +#: ../src/windows.c:390 +msgid "failed in init_windows" +msgstr "" From 1beb35025bf50e4872efad11bac84776a3f43176 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Fri, 12 Jun 2015 09:59:26 +0200 Subject: [PATCH 16/33] travis.yml: update dependencies --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3da703b..fb0f5e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,22 +9,22 @@ before_script: # Installing libsodium, needed for toxcore - git clone https://github.com/jedisct1/libsodium.git libsodium - cd libsodium - - git checkout tags/1.0.2 > /dev/null + - git checkout tags/1.0.3 > /dev/null - ./autogen.sh > /dev/null - ./configure > /dev/null - make check -j2 || make check || exit 1 > /dev/null - sudo make install > /dev/null - cd .. # Installing libopus, needed for audio encoding/decoding - - wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz - - tar xzf opus-1.0.3.tar.gz > /dev/null - - cd opus-1.0.3 + - wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz + - tar xzf opus-1.1.tar.gz > /dev/null + - cd opus-1.1 - ./configure > /dev/null - make -j2 || make || exit 1 > /dev/null - sudo make install > /dev/null - cd .. # Installing vpx - - git clone http://git.chromium.org/webm/libvpx.git libvpx + - git clone https://chromium.googlesource.com/webm/libvpx libvpx - cd libvpx - ./configure --enable-shared > /dev/null - make -j2 || make || exit 1 > /dev/null From d8eca8393caf7761d0bf6d59e498eb4f019213a3 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 29 Jun 2015 03:16:09 -0400 Subject: [PATCH 17/33] s/tox.im/tox.chat/g -- reflect new tox domain --- README.md | 4 ++-- src/toxic.c | 2 +- translations/en.po | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd78dae..7861d74 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Toxic [![Build Status](https://travis-ci.org/Tox/toxic.png?branch=master)](https://travis-ci.org/Tox/toxic) -Toxic is a [Tox](https://tox.im)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. +Toxic is a [Tox](https://tox.chat)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. [![Toxic Screenshot](https://i.imgur.com/san99Z2.png "Home Screen")](https://i.imgur.com/san99Z2.png) ## Installation -[Use our repositories](https://wiki.tox.im/Binaries#Linux)
+[Use our repositories](https://wiki.tox.chat/Binaries#Linux)
[Compile it yourself](/INSTALL.md) ## Downloads diff --git a/src/toxic.c b/src/toxic.c index 31154eb..c8d0c4f 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -261,7 +261,7 @@ static void print_init_messages(ToxWindow *toxwin) line_info_add(toxwin, NULL, NULL, NULL, SYS_MSG, 0, 0, init_messages.msgs[i]); } -#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.im = 6) */ +#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.chat = 6) */ #define MAX_NODE_LINE 256 /* Approx max number of chars in a sever line (name + port + key) */ #define MAXNODES 50 #define NODELEN (MAX_NODE_LINE - TOX_PUBLIC_KEY_SIZE - 7) diff --git a/translations/en.po b/translations/en.po index e9dc748..b781648 100644 --- a/translations/en.po +++ b/translations/en.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Toxic 0.6.0\n" -"Report-Msgid-Bugs-To: JFreegman@tox.im\n" +"Report-Msgid-Bugs-To: JFreegman@tox.chat\n" "POT-Creation-Date: 2015-05-30 11:30+0200\n" "PO-Revision-Date: 2015-05-30 11:30+0200\n" "Last-Translator: Automatically generated\n" From 84a027666838d226b80a2e7e944a74820f526523 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 30 Jun 2015 22:40:45 -0400 Subject: [PATCH 18/33] Fix some possible race conditions related to line printing --- src/chat.c | 3 +++ src/groupchat.c | 3 +++ src/prompt.c | 3 +++ src/windows.c | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/chat.c b/src/chat.c index 6dafd9e..4c8bbc7 100644 --- a/src/chat.c +++ b/src/chat.c @@ -923,7 +923,10 @@ static void chat_onDraw(ToxWindow *self, Tox *m) ChatContext *ctx = self->chatwin; + pthread_mutex_lock(&Winthread.lock); line_info_print(self); + pthread_mutex_unlock(&Winthread.lock); + wclear(ctx->linewin); curs_set(1); diff --git a/src/groupchat.c b/src/groupchat.c index ec97ebb..8423497 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -656,7 +656,10 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m) ChatContext *ctx = self->chatwin; + pthread_mutex_lock(&Winthread.lock); line_info_print(self); + pthread_mutex_unlock(&Winthread.lock); + wclear(ctx->linewin); curs_set(1); diff --git a/src/prompt.c b/src/prompt.c index 355d0d3..a3d2901 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -254,7 +254,10 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) ChatContext *ctx = self->chatwin; + pthread_mutex_lock(&Winthread.lock); line_info_print(self); + pthread_mutex_unlock(&Winthread.lock); + wclear(ctx->linewin); curs_set(1); diff --git a/src/windows.c b/src/windows.c index 4075371..f50ff10 100644 --- a/src/windows.c +++ b/src/windows.c @@ -561,8 +561,11 @@ void refresh_inactive_windows(void) for (i = 0; i < MAX_WINDOWS_NUM; ++i) { ToxWindow *a = &windows[i]; - if (a->active && a != active_window && !a->is_friendlist) + if (a->active && a != active_window && !a->is_friendlist) { + pthread_mutex_lock(&Winthread.lock); line_info_print(a); + pthread_mutex_unlock(&Winthread.lock); + } } } From 444d8e7a74a517433f82cf8a910534405b88cdc6 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 30 Jun 2015 23:51:27 -0400 Subject: [PATCH 19/33] update translations --- translations/en.mo | Bin 28476 -> 28646 bytes translations/en.po | 111 ++++++++++++++++++++-------------------- translations/toxic.pot | 113 +++++++++++++++++++++-------------------- 3 files changed, 113 insertions(+), 111 deletions(-) diff --git a/translations/en.mo b/translations/en.mo index 568b7c36e9ce8476974e819892c4bcf7bf981402..bc070ff8f499dac6ad89c8dcc545ca7de6f7f1a4 100644 GIT binary patch delta 7863 zcma*sd01Cf9>?*6JD?~aC@A^^QA9uyQ4}{s+`tuA+);5WB?-+m{W&(Kl}n3Oj!Uj( z=8~C{la`v}KB=RXS-D&0+G=HK&ilhT`1t4CXTHA9IrrYPe9yT+&+I(w^X)kw@7bVI ziwxHYA7iRx3x8wIQ63noR%5=1Fvb^8VWZ|RO1-D}pEK}2%aBPWT z*w57qunzTk=x2=AyhnjC%`WE=tV;b92H_7Ff+an+qcGHj8ew^CiF9N#UA?!f55qv( z$6+<}qWW8c!MF))F~0ejLMjd4Vk?Y{G^REVMJ3@GjKXE84tAp^a1u4KGpOf&MlHmT zhbv{&3}t*Xje=IZ5H-_{sF@!^vTVLWl3?z*_OM#EgE$PJJrOl< zYvg|>i+?m=K6-E_>iyNuz0OPMt;>y)(RL;ASdn_Vt7jwIX-2#HY-EvU8S+1~%Xt~~ zoG)pUb#V-Kzy#ca?eH9G%W9LBDwtG<{OfRJ(x4TOKxJYQDuoNMC$2#~_d7Ca6BJ`J z)dba1HfrKyktCTZsQ#8=Y21uD+}lvkpFl0-S`7J*qfnkS=+rhvtsoz@xARdiuE8?6 z2U&zUh|0h%^k8tT-GXG)^J%Ds4082JuKqHr{|)HDBVG#X=mzR@39M&3h({f&PN=;b zidxwWcYn2WH|mU>L9OUd?2ZwvN&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# zR7RGe_HqkqYffVZRv6-}unlTr`B)zZp(Zi~tKf^MEhiPN)IG@%0Z=epH8RZNZf@*JxT3I&gRChxys2Fu7 zCZaO%3~It}TDN)H+5fL7Xoil>)O{s47YK0}?AQ>c~xjGBnoSZ81tY9h_C z0%oJ$&%s96+uomwDb$}uw^F`~LJPc!F_`?I^XKsZR7PfEBrZoy@KcP%bEv(qI?g$y z&9EZ%bo9c;#M6YXBEn0JTy2Plh#)WaKY_+z#pre5DiuGUk2k{JX zov6k$b8rw*ow6=};t1g)hR~La{~&r$?u+HuI$P*M`w3fiKTjc)23=1QI$&*WeY+a% zRfD$nw#@eaeeI)kizv45^tWc&C(`i%an{!Lb61uM(dUmFx}ChtMha zCN>d`>1-q3d;Ob=zU_fTAMTf5Z`wi~+LG^SZ(9BUX3;)The+RWO)A&!xtT=$AoX6T z9}|6cx?-r;#&?Nth+OLW)|SDeL?rP((T=u2;ymRIgsxwSyF|1qT!#twdQXub1H5d@ z&3Lgg@e_6ayW;tOE4pD{+Vne-Nz@~B-6Za#{iLV%zke=JjHF#xT?g|Lx@_AEl+*MP zRiwZ#q*+4fdYNdzLpyLbkx2Os)U}o9M?DdLBUTdKs87W%#3RHZVjD4q$m3ou!kf_5 z+d9punrtuf{{)p7qJ&sLd`vt}lwTt$bhR(4?HJLV2qHp=w+USfiLZ$Ls&Gvw0*T|Q zaP1~K(N7+JK@1?4YX4i&xEx<3S`!h}Q}EuaGnGcP|AHNGAfaoogYl!@%9ed`GT}>G z3h_DRx>yDONkmibkEMir1pnxYrBT-whrjehPp`IfdGMZKXd55Z4}eEW== zuM$5K#l!^SB2h`-e=iE}5W0MbkBBuyIxnw9UF|7, YEAR. # @@ -8,10 +8,11 @@ msgid "" msgstr "" "Project-Id-Version: Toxic 0.6.0\n" "Report-Msgid-Bugs-To: JFreegman@tox.chat\n" -"POT-Creation-Date: 2015-05-30 11:30+0200\n" +"POT-Creation-Date: 2015-06-30 23:49-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -166,11 +167,11 @@ msgstr "" msgid "no" msgstr "" -#: ../src/chat.c:223 ../src/prompt.c:360 +#: ../src/chat.c:223 ../src/prompt.c:363 msgid "has come online" msgstr "" -#: ../src/chat.c:234 ../src/prompt.c:372 +#: ../src/chat.c:234 ../src/prompt.c:375 msgid "has gone offline" msgstr "" @@ -328,11 +329,11 @@ msgstr "" msgid " VAD level: " msgstr "" -#: ../src/chat.c:1080 +#: ../src/chat.c:1083 msgid "failed in chat_onInit" msgstr "" -#: ../src/chat.c:1152 +#: ../src/chat.c:1155 msgid "failed in new_chat" msgstr "" @@ -862,33 +863,6 @@ msgstr "" msgid "Invalid status. Valid statuses are: %s." msgstr "" -#: ../src/group_commands.c:46 -#, c-format -msgid "Title is set to: %s" -msgstr "" - -#: ../src/group_commands.c:48 -msgid "Title is not set" -msgstr "" - -#: ../src/group_commands.c:55 -msgid "Title must be enclosed in quotes." -msgstr "" - -#: ../src/group_commands.c:65 -msgid "Failed to set title." -msgstr "" - -#: ../src/group_commands.c:80 ../src/groupchat.c:337 -#, c-format -msgid " set the group title to: %s" -msgstr "" - -#: ../src/group_commands.c:83 ../src/groupchat.c:340 -#, c-format -msgid "set title to %s" -msgstr "" - #: ../src/groupchat.c:143 msgid "failed in init_groupchat_win" msgstr "" @@ -898,6 +872,16 @@ msgstr "" msgid "Group Audio failed to init\n" msgstr "" +#: ../src/groupchat.c:337 ../src/group_commands.c:80 +#, c-format +msgid " set the group title to: %s" +msgstr "" + +#: ../src/groupchat.c:340 ../src/group_commands.c:83 +#, c-format +msgid "set title to %s" +msgstr "" + #: ../src/groupchat.c:362 msgid "failed in copy_peernames" msgstr "" @@ -931,44 +915,61 @@ msgstr "" msgid " * Failed to send message." msgstr "" -#: ../src/groupchat.c:678 +#: ../src/groupchat.c:681 #, c-format msgid "Peers: %d\n" msgstr "" -#: ../src/groupchat.c:728 +#: ../src/groupchat.c:731 msgid "failed in groupchat_onInit" msgstr "" -#: ../src/groupchat.c:813 +#: ../src/groupchat.c:816 #, c-format msgid "source: %d, queued: %d, processed: %d\n" msgstr "" -#: ../src/groupchat.c:852 +#: ../src/groupchat.c:855 #, c-format msgid "dvhandle is null)\n" msgstr "" -#: ../src/groupchat.c:855 +#: ../src/groupchat.c:858 #, c-format msgid "ctx is null\n" msgstr "" -#: ../src/groupchat.c:858 +#: ../src/groupchat.c:861 #, c-format msgid "write: %d\n" msgstr "" -#: ../src/groupchat.c:882 +#: ../src/groupchat.c:885 #, c-format msgid "Group %d" msgstr "" -#: ../src/groupchat.c:888 +#: ../src/groupchat.c:891 msgid "failed in new_group_chat" msgstr "" +#: ../src/group_commands.c:46 +#, c-format +msgid "Title is set to: %s" +msgstr "" + +#: ../src/group_commands.c:48 +msgid "Title is not set" +msgstr "" + +#: ../src/group_commands.c:55 +msgid "Title must be enclosed in quotes." +msgstr "" + +#: ../src/group_commands.c:65 +msgid "Failed to set title." +msgstr "" + #: ../src/help.c:148 msgid "Global Commands:\n" msgstr "" @@ -1201,70 +1202,70 @@ msgstr "" msgid "Failed to set note (error %d)\n" msgstr "" -#: ../src/prompt.c:271 +#: ../src/prompt.c:274 msgid "ERROR" msgstr "" -#: ../src/prompt.c:275 +#: ../src/prompt.c:278 msgid "Online" msgstr "" -#: ../src/prompt.c:279 +#: ../src/prompt.c:282 msgid "Away" msgstr "" -#: ../src/prompt.c:283 +#: ../src/prompt.c:286 msgid "Busy" msgstr "" -#: ../src/prompt.c:296 +#: ../src/prompt.c:299 msgid " [Offline]" msgstr "" -#: ../src/prompt.c:366 ../src/prompt.c:369 +#: ../src/prompt.c:369 ../src/prompt.c:372 #, c-format msgid "%s has come online" msgstr "" -#: ../src/prompt.c:378 ../src/prompt.c:381 +#: ../src/prompt.c:381 ../src/prompt.c:384 #, c-format msgid "%s has gone offline" msgstr "" -#: ../src/prompt.c:392 ../src/prompt.c:393 +#: ../src/prompt.c:395 ../src/prompt.c:396 #, c-format msgid "Friend request with the message '%s'" msgstr "" -#: ../src/prompt.c:398 +#: ../src/prompt.c:401 msgid "Friend request queue is full. Discarding request." msgstr "" -#: ../src/prompt.c:403 +#: ../src/prompt.c:406 #, c-format msgid "Type \"%s %d\" or \"%s %d\"" msgstr "" -#: ../src/prompt.c:432 ../src/prompt.c:433 +#: ../src/prompt.c:435 ../src/prompt.c:436 #, c-format msgid "Toxing on Toxic" msgstr "" -#: ../src/prompt.c:455 +#: ../src/prompt.c:458 msgid "" "Welcome to Toxic, a free, open source Tox-based instant messenging client." msgstr "" -#: ../src/prompt.c:457 +#: ../src/prompt.c:460 #, c-format msgid "Type \"%s\" for assistance. Further help may be found via the man page." msgstr "" -#: ../src/prompt.c:476 +#: ../src/prompt.c:479 msgid "failed in prompt_onInit" msgstr "" -#: ../src/prompt.c:514 +#: ../src/prompt.c:517 msgid "failed in new_prompt" msgstr "" From 035420e5c758fdc504475c76d1a5b19519ed3962 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sat, 4 Jul 2015 01:19:16 -0400 Subject: [PATCH 20/33] Revert commit 312d0c3 (localization/gettext) There were serious problems with branch merging that need to be resolved first --- INSTALL.md | 53 +- README.md | 4 +- cfg/checks/check_features.mk | 6 - cfg/global_vars.mk | 5 - cfg/systems/Darwin.mk | 6 - cfg/targets/help.mk | 1 - cfg/targets/install.mk | 11 - src/audio_call.c | 118 ++- src/autocomplete.c | 8 +- src/avatars.c | 10 +- src/chat.c | 101 +- src/chat_commands.c | 78 +- src/configdir.c | 8 +- src/dns.c | 52 +- src/execute.c | 12 +- src/friendlist.c | 60 +- src/global_commands.c | 112 +-- src/group_commands.c | 18 +- src/groupchat.c | 48 +- src/help.c | 143 +-- src/line_info.c | 10 +- src/log.c | 12 +- src/message_queue.c | 8 +- src/misc_tools.c | 10 +- src/prompt.c | 52 +- src/toxic.c | 178 ++-- src/toxic.h | 4 +- src/windows.c | 10 +- translations/en.mo | Bin 28646 -> 0 bytes translations/en.po | 1600 ----------------------------- translations/it.mo | Bin 30657 -> 0 bytes translations/it.po | 1607 ------------------------------ translations/tools/create_mo.sh | 19 - translations/tools/create_po.sh | 23 - translations/tools/update_po.sh | 19 - translations/tools/update_pot.sh | 12 - translations/toxic.pot | 1575 ----------------------------- 37 files changed, 441 insertions(+), 5552 deletions(-) delete mode 100644 translations/en.mo delete mode 100644 translations/en.po delete mode 100644 translations/it.mo delete mode 100644 translations/it.po delete mode 100755 translations/tools/create_mo.sh delete mode 100755 translations/tools/create_po.sh delete mode 100755 translations/tools/update_po.sh delete mode 100755 translations/tools/update_pot.sh delete mode 100644 translations/toxic.pot diff --git a/INSTALL.md b/INSTALL.md index 49fbb8b..4e96a30 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -3,10 +3,6 @@ * [OS X Notes](#deps_osx) * [Compiling](#compiling) * [Documentation](#docs) -* [Translating](#langs) - * [Create new translation 1: PO file](#new_lang_1) - * [Create new translation 2: MO file](#new_lang_2) - * [Update existing translation](#upd_lang) * [Notes](#notes) * [Compilation variables](#comp_vars) * [Packaging](#packaging) @@ -24,23 +20,20 @@ | [OpenALUT](http://openal.org) | SOUND NOTIFICATIONS | libalut-dev | | [LibNotify](https://developer.gnome.org/libnotify) | DESKTOP NOTIFICATIONS | libnotify-dev | | [AsciiDoc](http://asciidoc.org/index.html) | DOCUMENTATION1 | asciidoc | -| [Gettext](https://www.gnu.org/software/gettext) | LOCALIZATION2 | gettext | -1: see [Documentation](#docs)
-2: see [Translating](#langs) +1: see [Documentation](#docs)
#### OS X Notes Using [Homebrew](http://brew.sh): ``` -brew install openal-soft freealut libconfig gettext +brew install openal-soft freealut libconfig brew install https://raw.githubusercontent.com/Tox/homebrew-tox/master/Formula/libtoxcore.rb brew install https://raw.githubusercontent.com/Homebrew/homebrew-x11/master/libnotify.rb -brew link gettext ``` You can omit `libnotify` if you intend to build without desktop notifications enabled. - + ## Compiling ``` make PREFIX="/where/to/install" @@ -53,45 +46,6 @@ Run `make doc` in the build directory after editing the asciidoc files to regene **NOTE FOR DEVELOPERS**: asciidoc files and generated manpages will need to be commited together.
**NOTE FOR EVERYONE**: [asciidoc](http://asciidoc.org/index.html) (and this step) is only required for regenerating manpages when you modify them. -
-## Translating -Toxic uses gettext to localize some strings in various languages.
-These notes are for people who want help translating toxic in new languages (or improve an existing translation).
-The following example shows how to create/update german translation (de). - -
-#### Create new translation 1: PO file -To start a new translation, you can use the [provided script](translations/tools/create_po.sh): -``` -cd toxic-src/translations/tools -./create_po.sh -Insert locale to create (for example "en"): de -Created de.po. -``` -Now you can proceed to translate `toxic-src/translations/de.po`. - - -#### Create new translation 2: MO file -When you fully translated the PO file, you are ready to create the MO (Machine Object) file.
-Again you can use the [provided script](translations/tools/create_mo.sh) to achieve this: -``` -cd toxic-src/translations/tools -./create_mo.sh -Insert locale (for example "en"): de -``` - -
-#### Update existing translation -When the toxic sources are updated, you probably need to update your translation as well.
-To do so use the [provided script](translations/tools/update_po.sh) to update the PO file: -``` -cd toxic-src/translations/tools -./update_po.sh -Insert locale to update (for example "en"): de -..................................... done. -``` -Then you need to translate new/changed strings and after you fully updated the PO file, create the MO file as described [above](#new_lang_2). -
## Notes @@ -104,7 +58,6 @@ Then you need to translate new/changed strings and after you fully updated the P * `DISABLE_AV=1` → build toxic without audio call support * `DISABLE_SOUND_NOTIFY=1` → build toxic without sound notifications support * `DISABLE_DESKTOP_NOTIFY=1` → build toxic without desktop notifications support - * `DISABLE_LOCALIZATION=1` → build toxic without localization support #### Packaging diff --git a/README.md b/README.md index 7861d74..dd78dae 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Toxic [![Build Status](https://travis-ci.org/Tox/toxic.png?branch=master)](https://travis-ci.org/Tox/toxic) -Toxic is a [Tox](https://tox.chat)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. +Toxic is a [Tox](https://tox.im)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. [![Toxic Screenshot](https://i.imgur.com/san99Z2.png "Home Screen")](https://i.imgur.com/san99Z2.png) ## Installation -[Use our repositories](https://wiki.tox.chat/Binaries#Linux)
+[Use our repositories](https://wiki.tox.im/Binaries#Linux)
[Compile it yourself](/INSTALL.md) ## Downloads diff --git a/cfg/checks/check_features.mk b/cfg/checks/check_features.mk index d6bcc57..430d1af 100644 --- a/cfg/checks/check_features.mk +++ b/cfg/checks/check_features.mk @@ -24,12 +24,6 @@ ifneq ($(DESK_NOTIFY), disabled) -include $(CHECKS_DIR)/desktop_notifications.mk endif -# Check if we want build localization support -LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) -ifneq ($(LOCALIZATION), enabled) - CFLAGS += -DNO_GETTEXT -endif - # Check if we can build Toxic CHECK_LIBS = $(shell pkg-config --exists $(LIBS) || echo -n "error") ifneq ($(CHECK_LIBS), error) diff --git a/cfg/global_vars.mk b/cfg/global_vars.mk index 5d4a14c..d5c7b57 100644 --- a/cfg/global_vars.mk +++ b/cfg/global_vars.mk @@ -13,7 +13,6 @@ DOC_DIR = $(BASE_DIR)/doc SRC_DIR = $(BASE_DIR)/src SND_DIR = $(BASE_DIR)/sounds MISC_DIR = $(BASE_DIR)/misc -TRANSLATIONS_DIR = $(BASE_DIR)/translations # Project files MANFILES = toxic.1 toxic.conf.5 @@ -23,13 +22,9 @@ SNDFILES = ToxicContactOnline.wav ToxicContactOffline.wav ToxicError.wav SNDFILES += ToxicRecvMessage.wav ToxicOutgoingCall.wav ToxicIncomingCall.wav SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav -# Available languages (sorted alphabetically) -LANGS = en it - # Install directories PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic MANDIR = $(PREFIX)/share/man APPDIR = $(PREFIX)/share/applications -LOCALEDIR = ${PREFIX}/share/locale diff --git a/cfg/systems/Darwin.mk b/cfg/systems/Darwin.mk index b4c82ad..f33a4be 100644 --- a/cfg/systems/Darwin.mk +++ b/cfg/systems/Darwin.mk @@ -8,9 +8,3 @@ LIBS := $(filter-out ncursesw, $(LIBS)) # OS X ships a usable, recent version of ncurses, but calls it ncurses not ncursesw. LDFLAGS += -lncurses -lalut -ltoxav -ltoxcore -ltoxdns -lresolv -lconfig -ltoxencryptsave -g CFLAGS += -I/usr/local/opt/freealut/include/AL -I/usr/local/opt/glib/include/glib-2.0 -g - -# Check if we want build localization support -LOCALIZATION = $(shell if [ -z "$(DISABLE_LOCALIZATION)" ] || [ "$(DISABLE_LOCALIZATION)" = "0" ] ; then echo enabled ; else echo disabled ; fi) -ifneq ($(LOCALIZATION), disabled) - LDFLAGS += -lintl -endif diff --git a/cfg/targets/help.mk b/cfg/targets/help.mk index 4946b00..fba1c8f 100644 --- a/cfg/targets/help.mk +++ b/cfg/targets/help.mk @@ -14,7 +14,6 @@ help: @echo " DISABLE_AV: Set to \"1\" to force building without audio call support" @echo " DISABLE_SOUND_NOTIFY: Set to \"1\" to force building without sound notification support" @echo " DISABLE_DESKTOP_NOTIFY: Set to \"1\" to force building without desktop notifications support" - @echo " DISABLE_LOCALIZATION: Set to \"1\" to force building without localization support" @echo " USER_CFLAGS: Add custom flags to default CFLAGS" @echo " USER_LDFLAGS: Add custom flags to default LDFLAGS" @echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")" diff --git a/cfg/targets/install.mk b/cfg/targets/install.mk index 3f9bf47..12050ff 100644 --- a/cfg/targets/install.mk +++ b/cfg/targets/install.mk @@ -8,17 +8,6 @@ install: $(BUILD_DIR)/toxic @mkdir -p $(abspath $(DESTDIR)/$(APPDIR)) @install -m 0644 $(MISC_DIR)/$(DESKFILE) $(abspath $(DESTDIR)/$(APPDIR)/$(DESKFILE)) - @if [ -z "$(DISABLE_LOCALIZATION)" -o "$(DISABLE_LOCALIZATION)" = "0" ]; then \ - echo "Installing translations" ; \ - for i in $(LANGS) ; do \ - if [ ! -e $(TRANSLATIONS_DIR)/$$i.mo ]; then \ - continue ; \ - fi ; \ - mkdir -p $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES) ; \ - install -m 0644 $(TRANSLATIONS_DIR)/$$i.mo $(abspath $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES/toxic.mo) ; \ - done ; \ - fi - @echo "Installing data files" @mkdir -p $(abspath $(DESTDIR)/$(DATADIR)) @for f in $(DATAFILES) ; do \ diff --git a/src/audio_call.c b/src/audio_call.c index 274b5bb..54b865b 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -37,12 +37,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #ifdef __APPLE__ #include #include @@ -130,7 +124,7 @@ ToxAv *init_audio(ToxWindow *self, Tox *tox) } if ( init_devices(ASettins.av) == de_InternalError ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to init devices")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to init devices"); toxav_kill(ASettins.av); return ASettins.av = NULL; } @@ -173,7 +167,7 @@ void read_device_callback (const int16_t* captured, uint32_t size, void* data) uint8_t encoded_payload[RTP_PAYLOAD_SIZE]; int32_t payload_size = toxav_prepare_audio_frame(ASettins.av, call_index, encoded_payload, RTP_PAYLOAD_SIZE, captured, size); if ( payload_size <= 0 || toxav_send_audio(ASettins.av, call_index, encoded_payload, payload_size) < 0 ) { - /*fprintf(stderr, gettext("Could not encode audio packet\n"));*/ + /*fprintf(stderr, "Could not encode audio packet\n");*/ } } @@ -192,13 +186,13 @@ void write_device_callback(void *agent, int32_t call_index, const int16_t* PCM, int start_transmission(ToxWindow *self, Call *call) { if ( !self || !ASettins.av || self->call_idx == -1 ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); return -1; } /* Don't provide support for video */ if ( 0 != toxav_prepare_transmission(ASettins.av, self->call_idx, 0) ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Could not prepare transmission")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Could not prepare transmission"); return -1; } @@ -214,16 +208,16 @@ int start_transmission(ToxWindow *self, Call *call) if ( open_primary_device(input, &call->in_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open input device!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open input device!"); if ( register_device_callback(self->call_idx, call->in_idx, read_device_callback, &self->call_idx, true) != de_None) /* Set VAD as true for all; TODO: Make it more dynamic */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to register input handler!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to register input handler!"); if ( open_primary_device(output, &call->out_idx, csettings.audio_sample_rate, csettings.audio_frame_duration, csettings.audio_channels) != de_None ) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to open output device!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to open output device!"); call->has_output = 0; } @@ -281,7 +275,7 @@ void callback_recv_starting ( void* av, int32_t call_index, void* arg ) if (windows[i].onStarting != NULL && windows[i].call_idx == call_index) { windows[i].onStarting(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index])) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , gettext("Error starting transmission!")); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0 , "Error starting transmission!"); } return; } @@ -300,7 +294,7 @@ void callback_call_started ( void* av, int32_t call_index, void* arg ) if (windows[i].onStart != NULL && windows[i].call_idx == call_index) { windows[i].onStart(&windows[i], ASettins.av, call_index); if ( 0 != start_transmission(&windows[i], &ASettins.calls[call_index]) ) {/* YEAH! */ - line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error starting transmission!")); + line_info_add(&windows[i], NULL, NULL, NULL, SYS_MSG, 0, 0, "Error starting transmission!"); return; } } @@ -354,30 +348,30 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if (argc != 0) { - error_str = gettext("Unknown arguments."); + error_str = "Unknown arguments."; goto on_error; } if ( !ASettins.av ) { - error_str = gettext("Audio not supported!"); + error_str = "Audio not supported!"; goto on_error; } if (!self->stb->connection) { - error_str = gettext("Friend is offline."); + error_str = "Friend is offline."; goto on_error; } ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, &ASettins.cs, 30); if ( error != av_ErrorNone ) { - if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = gettext("Already in a call!"); - else error_str = gettext("Internal error!"); + if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = "Already in a call!"; + else error_str = "Internal error!"; goto on_error; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Calling... idx: %d"), self->call_idx); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Calling... idx: %d", self->call_idx); return; on_error: @@ -389,21 +383,21 @@ void cmd_answer(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = gettext("Unknown arguments."); + error_str = "Unknown arguments."; goto on_error; } if ( !ASettins.av ) { - error_str = gettext("Audio not supported!"); + error_str = "Audio not supported!"; goto on_error; } ToxAvError error = toxav_answer(ASettins.av, self->call_idx, &ASettins.cs); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot answer in invalid state!"); - else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); - else error_str = gettext("Internal error!"); + if ( error == av_ErrorInvalidState ) error_str = "Cannot answer in invalid state!"; + else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; + else error_str = "Internal error!"; goto on_error; } @@ -420,21 +414,21 @@ void cmd_reject(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = gettext("Unknown arguments."); + error_str = "Unknown arguments."; goto on_error; } if ( !ASettins.av ) { - error_str = gettext("Audio not supported!"); + error_str = "Audio not supported!"; goto on_error; } - ToxAvError error = toxav_reject(ASettins.av, self->call_idx, gettext("Why not?")); + ToxAvError error = toxav_reject(ASettins.av, self->call_idx, "Why not?"); if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot reject in invalid state!"); - else if ( error == av_ErrorNoCall ) error_str = gettext("No incoming call!"); - else error_str = gettext("Internal error!"); + if ( error == av_ErrorInvalidState ) error_str = "Cannot reject in invalid state!"; + else if ( error == av_ErrorNoCall ) error_str = "No incoming call!"; + else error_str = "Internal error!"; goto on_error; } @@ -451,12 +445,12 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ const char *error_str; if (argc != 0) { - error_str = gettext("Unknown arguments."); + error_str = "Unknown arguments."; goto on_error; } if ( !ASettins.av ) { - error_str = gettext("Audio not supported!"); + error_str = "Audio not supported!"; goto on_error; } @@ -464,19 +458,19 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (toxav_get_call_state(ASettins.av, self->call_idx) == av_CallInviting) { error = toxav_cancel(ASettins.av, self->call_idx, self->num, - gettext("Only those who appreciate small things know the beauty that is life")); + "Only those who appreciate small things know the beauty that is life"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); #endif - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); } else { error = toxav_hangup(ASettins.av, self->call_idx); } if ( error != av_ErrorNone ) { - if ( error == av_ErrorInvalidState ) error_str = gettext("Cannot hangup in invalid state!"); - else if ( error == av_ErrorNoCall ) error_str = gettext("No call!"); - else error_str = gettext("Internal error!"); + if ( error == av_ErrorInvalidState ) error_str = "Cannot hangup in invalid state!"; + else if ( error == av_ErrorNoCall ) error_str = "No call!"; + else error_str = "Internal error!"; goto on_error; } @@ -491,8 +485,8 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = gettext("Type must be specified!"); - else error_str = gettext("Only one argument allowed!"); + if ( argc < 1 ) error_str = "Type must be specified!"; + else error_str = "Only one argument allowed!"; goto on_error; } @@ -506,7 +500,7 @@ void cmd_list_devices(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (* type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); return; } @@ -523,9 +517,9 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = gettext("Type must be specified!"); - else if ( argc < 2 ) error_str = gettext("Must have id!"); - else error_str = gettext("Only two arguments allowed!"); + if ( argc < 1 ) error_str = "Type must be specified!"; + else if ( argc < 2 ) error_str = "Must have id!"; + else error_str = "Only two arguments allowed!"; goto on_error; } @@ -539,7 +533,7 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); return; } @@ -548,12 +542,12 @@ void cmd_change_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char ( long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = gettext("Invalid input"); + error_str = "Invalid input"; goto on_error; } if ( set_primary_device(type, selection) == de_InvalidSelection ) { - error_str=gettext("Invalid selection!"); + error_str="Invalid selection!"; goto on_error; } @@ -567,9 +561,9 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a const char *error_str; if ( argc != 2 ) { - if ( argc < 1 ) error_str = gettext("Type must be specified!"); - else if ( argc < 2 ) error_str = gettext("Must have id!"); - else error_str = gettext("Only two arguments allowed!"); + if ( argc < 1 ) error_str = "Type must be specified!"; + else if ( argc < 2 ) error_str = "Must have id!"; + else error_str = "Only two arguments allowed!"; goto on_error; } @@ -583,7 +577,7 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); return; } @@ -592,12 +586,12 @@ void cmd_ccur_device(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a long int selection = strtol(argv[2], &end, 10); if ( *end ) { - error_str = gettext("Invalid input"); + error_str = "Invalid input"; goto on_error; } if ( selection_valid(type, selection) == de_InvalidSelection ) { - error_str=gettext("Invalid selection!"); + error_str="Invalid selection!"; goto on_error; } @@ -640,8 +634,8 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = gettext("Type must be specified!"); - else error_str = gettext("Only two arguments allowed!"); + if ( argc < 1 ) error_str = "Type must be specified!"; + else error_str = "Only two arguments allowed!"; goto on_error; } @@ -655,7 +649,7 @@ void cmd_mute(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA type = output; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid type: %s"), argv[1]); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid type: %s", argv[1]); return; } @@ -686,8 +680,8 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M const char *error_str; if ( argc != 1 ) { - if ( argc < 1 ) error_str = gettext("Must have value!"); - else error_str = gettext("Only two arguments allowed!"); + if ( argc < 1 ) error_str = "Must have value!"; + else error_str = "Only two arguments allowed!"; goto on_error; } @@ -696,7 +690,7 @@ void cmd_sense(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M float value = strtof(argv[1], &end); if ( *end ) { - error_str = gettext("Invalid input"); + error_str = "Invalid input"; goto on_error; } @@ -725,10 +719,10 @@ void stop_current_call(ToxWindow* self) toxav_hangup(ASettins.av, self->call_idx); break; case av_CallInviting: - toxav_cancel(ASettins.av, self->call_idx, 0, gettext("Not interested anymore")); + toxav_cancel(ASettins.av, self->call_idx, 0, "Not interested anymore"); break; case av_CallStarting: - toxav_reject(ASettins.av, self->call_idx, gettext("Not interested")); + toxav_reject(ASettins.av, self->call_idx, "Not interested"); break; default: break; diff --git a/src/autocomplete.c b/src/autocomplete.c index c500a03..8cf703c 100644 --- a/src/autocomplete.c +++ b/src/autocomplete.c @@ -24,12 +24,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #ifdef __APPLE__ #include #include @@ -123,7 +117,7 @@ int complete_line(ToxWindow *self, const void *list, int n_items, int size) char *sub = malloc(strlen(ubuf) + 1); if (sub == NULL) - exit_toxic_err(gettext("failed in complete_line"), FATALERR_MEMORY); + exit_toxic_err("failed in complete_line", FATALERR_MEMORY); if (!s && !dir_search) { strcpy(sub, tmp); diff --git a/src/avatars.c b/src/avatars.c index d9c621a..a17c3be 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -24,12 +24,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "misc_tools.h" #include "file_transfers.h" #include "friendlist.h" @@ -65,7 +59,7 @@ int avatar_send(Tox *m, uint32_t friendnum) return 0; if (err != TOX_ERR_FILE_SEND_OK) { - fprintf(stderr, gettext("tox_file_send failed for friendnumber %d (error %d)\n"), friendnum, err); + fprintf(stderr, "tox_file_send failed for friendnumber %d (error %d)\n", friendnum, err); return -1; } @@ -209,7 +203,7 @@ void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, gettext("tox_file_send_chunk failed in avatar callback (error %d)\n"), err); + fprintf(stderr, "tox_file_send_chunk failed in avatar callback (error %d)\n", err); ft->position += send_length; } diff --git a/src/chat.c b/src/chat.c index 4c8bbc7..f41958d 100644 --- a/src/chat.c +++ b/src/chat.c @@ -31,12 +31,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "execute.h" @@ -53,9 +47,6 @@ #include "notify.h" #include "message_queue.h" -#define YES_STR gettext("yes") -#define NO_STR gettext("no") - #ifdef AUDIO #include "audio_call.h" #endif /* AUDIO */ @@ -220,7 +211,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C ? tox_friend_get_typing(m, num, NULL) : false; chat_resume_file_transfers(m, num); - msg = gettext("has come online"); + msg = "has come online"; line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); } else if (connection_status == TOX_CONNECTION_NONE) { @@ -231,7 +222,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C chat_stop_file_senders(m, num); - msg = gettext("has gone offline"); + msg = "has gone offline"; line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); } @@ -316,21 +307,21 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), gettext("File '%s' successfully sent."), ft->file_name); + snprintf(msg, sizeof(msg), "File '%s' successfully sent.", ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Null file pointer."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Null file pointer.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (ft->position != position) { if (fseek(ft->file, position, SEEK_SET) == -1) { - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Seek fail."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Seek fail.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -342,7 +333,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, size_t send_length = fread(send_data, 1, sizeof(send_data), ft->file); if (send_length != length) { - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Read fail."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Read fail.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -351,7 +342,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, tox_file_send_chunk(m, ft->friendnum, ft->filenum, position, send_data, send_length, &err); if (err != TOX_ERR_FILE_SEND_CHUNK_OK) - fprintf(stderr, gettext("tox_file_send_chunk failed in chat callback (error %d)\n"), err); + fprintf(stderr, "tox_file_send_chunk failed in chat callback (error %d)\n", err); ft->position += send_length; ft->bps += send_length; @@ -374,20 +365,20 @@ static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, ui char msg[MAX_STR_SIZE]; if (length == 0) { - snprintf(msg, sizeof(msg), gettext("File '%s' successfully received."), ft->file_name); + snprintf(msg, sizeof(msg), "File '%s' successfully received.", ft->file_name); print_progress_bar(self, ft->bps, 100.0, ft->line_id); close_file_transfer(self, m, ft, -1, msg, transfer_completed); return; } if (ft->file == NULL) { - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Invalid file pointer."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Invalid file pointer.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } if (fwrite(data, length, 1, ft->file) != 1) { - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' failed: Write fail."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' failed: Write fail.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -413,7 +404,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint /* transfer is accepted */ if (ft->state == FILE_TRANSFER_PENDING) { ft->state = FILE_TRANSFER_STARTED; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer [%d] for '%s' accepted."), + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.", ft->index, ft->file_name); char progline[MAX_STR_SIZE]; prep_prog_line(progline); @@ -431,7 +422,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint break; case TOX_FILE_CONTROL_CANCEL: - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' was aborted."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' was aborted.", ft->file_name); close_file_transfer(self, m, ft, -1, msg, notif_error); break; } @@ -447,13 +438,13 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (!ft) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Too many concurrent file transfers.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Too many concurrent file transfers."); return; } char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), file_size); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer request for '%s' (%s)"), filename, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer request for '%s' (%s)", filename, sizestr); char file_path[MAX_STR_SIZE]; size_t path_len = name_length; @@ -468,7 +459,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (path_len >= sizeof(ft->file_path) || name_length >= sizeof(ft->file_name)) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer faield: File path too long.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer faield: File path too long."); return; } @@ -494,12 +485,12 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (count > 999) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: invalid file path.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: invalid file path."); return; } } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type '%s %d' to accept the file transfer."), "/savefile", ft->index); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type '/savefile %d' to accept the file transfer.", ft->index); ft->state = FILE_TRANSFER_PENDING; ft->direction = FILE_TRANSFER_RECV; @@ -512,10 +503,10 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (self->active_box != -1) box_notify2(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, self->active_box, - gettext("Incoming file: %s"), filename ); + "Incoming file: %s", filename ); else box_notify(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, &self->active_box, self->name, - gettext("Incoming file: %s"), filename ); + "Incoming file: %s", filename ); } static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, uint8_t type, const char *group_pub_key, @@ -530,7 +521,7 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui char *k = malloc(length); if (k == NULL) - exit_toxic_err(gettext("Failed in chat_onGroupInvite"), FATALERR_MEMORY); + exit_toxic_err("Failed in chat_onGroupInvite", FATALERR_MEMORY); memcpy(k, group_pub_key, length); Friends.list[friendnumber].group_invite.key = k; @@ -544,12 +535,12 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int32_t friendnumber, ui get_nick_truncate(m, name, friendnumber); if (self->active_box != -1) - box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, gettext("invites you to join group chat")); + box_silent_notify2(self, NT_WNDALERT_2 | NT_NOFOCUS, self->active_box, "invites you to join group chat"); else - box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, gettext("invites you to join group chat")); + box_silent_notify(self, NT_WNDALERT_2 | NT_NOFOCUS, &self->active_box, name, "invites you to join group chat"); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("%s has invited you to a group chat."), name); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s\" to join the chat."), "/join"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s has invited you to a group chat.", name); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/join\" to join the chat."); } /* Av Stuff */ @@ -563,16 +554,16 @@ void chat_onInvite (ToxWindow *self, ToxAv *av, int call_index) /* call_index is set here and reset on call end */ self->call_idx = call_index; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Incoming audio call! Type: \"%s\" or \"%s\""), "/answer", "/reject"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Incoming audio call! Type: \"/answer\" or \"/reject\""); if (self->ringing_sound == -1) sound_notify(self, call_incoming, NT_LOOP, &self->ringing_sound); if (self->active_box != -1) - box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, gettext("Incoming audio call!")); + box_silent_notify2(self, NT_NOFOCUS | NT_WNDALERT_0, self->active_box, "Incoming audio call!"); else - box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, gettext("Incoming audio call!")); + box_silent_notify(self, NT_NOFOCUS | NT_WNDALERT_0, &self->active_box, self->name, "Incoming audio call!"); } void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) @@ -580,7 +571,7 @@ void chat_onRinging (ToxWindow *self, ToxAv *av, int call_index) if ( !self || self->call_idx != call_index || self->num != toxav_get_peer_id(av, call_index, 0)) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Ringing...type \"%s\" to cancel it."), "/hangup"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ringing...type \"/hangup\" to cancel it."); #ifdef SOUND_NOTIFY if (self->ringing_sound == -1) @@ -595,7 +586,7 @@ void chat_onStarting (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -609,7 +600,7 @@ void chat_onEnding (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -622,7 +613,7 @@ void chat_onError (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Error!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Error!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -636,7 +627,7 @@ void chat_onStart (ToxWindow *self, ToxAv *av, int call_index) init_infobox(self); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call started! Type: \"%s\" to end it."), "/hangup"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call started! Type: \"/hangup\" to end it."); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -650,7 +641,7 @@ void chat_onCancel (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call canceled!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call canceled!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -663,7 +654,7 @@ void chat_onReject (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Rejected!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Rejected!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -677,7 +668,7 @@ void chat_onEnd (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Call ended!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Call ended!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -690,7 +681,7 @@ void chat_onRequestTimeout (ToxWindow *self, ToxAv *av, int call_index) return; self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No answer!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No answer!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -704,7 +695,7 @@ void chat_onPeerTimeout (ToxWindow *self, ToxAv *av, int call_index) kill_infobox(self); self->call_idx = -1; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Peer disconnected; call ended!")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Peer disconnected; call ended!"); #ifdef SOUND_NOTIFY stop_sound(self->ringing_sound); @@ -761,31 +752,31 @@ static void draw_infobox(ToxWindow *self) infobox->lastupdate = curtime; - const char *in_is_muted = infobox->in_is_muted ? YES_STR : NO_STR; - const char *out_is_muted = infobox->out_is_muted ? YES_STR : NO_STR; + const char *in_is_muted = infobox->in_is_muted ? "yes" : "no"; + const char *out_is_muted = infobox->out_is_muted ? "yes" : "no"; wmove(infobox->win, 1, 1); wattron(infobox->win, COLOR_PAIR(RED) | A_BOLD); - wprintw(infobox->win, gettext(" Call Active\n")); + wprintw(infobox->win, " Call Active\n"); wattroff(infobox->win, COLOR_PAIR(RED) | A_BOLD); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, gettext(" Duration: ")); + wprintw(infobox->win, " Duration: "); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", infobox->timestr); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, gettext(" In muted: ")); + wprintw(infobox->win, " In muted: "); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", in_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, gettext(" Out muted: ")); + wprintw(infobox->win, " Out muted: "); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%s\n", out_is_muted); wattron(infobox->win, A_BOLD); - wprintw(infobox->win, gettext(" VAD level: ")); + wprintw(infobox->win, " VAD level: "); wattroff(infobox->win, A_BOLD); wprintw(infobox->win, "%.2f\n", infobox->vad_lvl); @@ -1080,7 +1071,7 @@ static void chat_onInit(ToxWindow *self, Tox *m) ctx->cqueue = calloc(1, sizeof(struct chat_queue)); if (ctx->log == NULL || ctx->hst == NULL || ctx->cqueue == NULL) - exit_toxic_err(gettext("failed in chat_onInit"), FATALERR_MEMORY); + exit_toxic_err("failed in chat_onInit", FATALERR_MEMORY); line_info_init(ctx->hst); @@ -1152,7 +1143,7 @@ ToxWindow new_chat(Tox *m, uint32_t friendnum) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err(gettext("failed in new_chat"), FATALERR_MEMORY); + exit_toxic_err("failed in new_chat", FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/chat_commands.c b/src/chat_commands.c index 63218e5..3352f47 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -23,12 +23,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -45,7 +39,7 @@ extern FriendsList Friends; void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 2) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Requires type %s and the file ID."), "in|out"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Requires type in|out and the file ID."); return; } @@ -54,7 +48,7 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar int idx = atoi(argv[2]); if (idx >= MAX_FILES || idx < 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); return; } @@ -66,50 +60,50 @@ void cmd_cancelfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar } else if (strcasecmp(inoutstr, "out") == 0) { ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_SEND); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type must be '%s' or '%s'."), "in", "out"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type must be 'in' or 'out'."); return; } if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); return; } if (ft->state == FILE_TRANSFER_INACTIVE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file ID."); return; } - snprintf(msg, sizeof(msg), gettext("File transfer for '%s' aborted."), ft->file_name); + snprintf(msg, sizeof(msg), "File transfer for '%s' aborted.", ft->file_name); close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, silent); } void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group number required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group number required."); return; } int groupnum = atoi(argv[1]); if (groupnum == 0 && strcmp(argv[1], "0")) { /* atoi returns 0 value on invalid input */ - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid group number.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid group number."); return; } if (tox_invite_friend(m, self->num, groupnum) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to invite contact to group.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to invite contact to group."); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invited contact to Group %d."), groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invited contact to Group %d.", groupnum); } void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); return; } @@ -118,7 +112,7 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar uint8_t type = Friends.list[self->num].group_invite.type; if (!Friends.list[self->num].group_invite.pending) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending group chat invite.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending group chat invite."); return; } @@ -133,12 +127,12 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); tox_del_groupchat(m, groupnum); return; } @@ -148,31 +142,31 @@ void cmd_join_group(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File ID required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File ID required."); return; } int idx = atoi(argv[1]); if ((idx == 0 && strcmp(argv[1], "0")) || idx >= MAX_FILES) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); return; } struct FileTransfer *ft = get_file_transfer_struct_index(self->num, idx, FILE_TRANSFER_RECV); if (!ft) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); return; } if (ft->state != FILE_TRANSFER_PENDING) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending file transfers with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending file transfers with that ID."); return; } if ((ft->file = fopen(ft->file_path, "a")) == NULL) { - const char *msg = gettext("File transfer failed: Invalid file path."); + const char *msg = "File transfer failed: Invalid file path."; close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return; } @@ -183,7 +177,7 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv if (err != TOX_ERR_FILE_CONTROL_OK) goto on_recv_error; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Saving file [%d] as: '%s'"), idx, ft->file_path); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Saving file [%d] as: '%s'", idx, ft->file_path); /* prep progress bar line */ char progline[MAX_STR_SIZE]; @@ -198,23 +192,23 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv on_recv_error: switch (err) { case TOX_ERR_FILE_CONTROL_FRIEND_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend not found.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend not found."); return; case TOX_ERR_FILE_CONTROL_FRIEND_NOT_CONNECTED: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Friend is not online.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Friend is not online."); return; case TOX_ERR_FILE_CONTROL_NOT_FOUND: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Invalid filenumber.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Invalid filenumber."); return; case TOX_ERR_FILE_CONTROL_SENDQ: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed: Connection error.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed: Connection error."); return; default: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File transfer failed (error %d)\n"), err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer failed (error %d)\n", err); return; } } @@ -224,12 +218,12 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv const char *errmsg = NULL; if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path required."); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path must be enclosed in quotes."); return; } @@ -240,21 +234,21 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv path[path_len] = '\0'; if (path_len >= MAX_STR_SIZE) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File path exceeds character limit.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File path exceeds character limit."); return; } FILE *file_to_send = fopen(path, "r"); if (file_to_send == NULL) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("File not found.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File not found."); return; } off_t filesize = file_size(path); if (filesize == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid file.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid file."); fclose(file_to_send); return; } @@ -287,30 +281,30 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), filesize); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Sending file [%d]: '%s' (%s)"), filenum, file_name, sizestr); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Sending file [%d]: '%s' (%s)", filenum, file_name, sizestr); return; on_send_error: switch (err) { case TOX_ERR_FILE_SEND_FRIEND_NOT_FOUND: - errmsg = gettext("File transfer failed: Invalid friend."); + errmsg = "File transfer failed: Invalid friend."; break; case TOX_ERR_FILE_SEND_FRIEND_NOT_CONNECTED: - errmsg = gettext("File transfer failed: Friend is offline."); + errmsg = "File transfer failed: Friend is offline."; break; case TOX_ERR_FILE_SEND_NAME_TOO_LONG: - errmsg = gettext("File transfer failed: Filename is too long."); + errmsg = "File transfer failed: Filename is too long."; break; case TOX_ERR_FILE_SEND_TOO_MANY: - errmsg = gettext("File transfer failed: Too many concurrent file transfers."); + errmsg = "File transfer failed: Too many concurrent file transfers."; break; default: - errmsg = gettext("File transfer failed."); + errmsg = "File transfer failed."; break; } diff --git a/src/configdir.c b/src/configdir.c index a6fda82..8a9f60c 100644 --- a/src/configdir.c +++ b/src/configdir.c @@ -29,12 +29,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "configdir.h" @@ -122,7 +116,7 @@ int create_user_config_dirs(char *path) char *logpath = malloc(strlen(path) + strlen(LOGDIR) + 1); if (fullpath == NULL || logpath == NULL) - exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); + exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); strcpy(fullpath, path); strcat(fullpath, CONFIGDIR); diff --git a/src/dns.c b/src/dns.c index 8a7a6f3..ade723c 100644 --- a/src/dns.c +++ b/src/dns.c @@ -26,12 +26,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #ifdef __APPLE__ #include #else @@ -152,7 +146,7 @@ static int load_dns_domainlist(const char *path) static int dns_error(ToxWindow *self, const char *errmsg) { pthread_mutex_lock(&Winthread.lock); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("User lookup failed: %s"), errmsg); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "User lookup failed: %s", errmsg); pthread_mutex_unlock(&Winthread.lock); return -1; @@ -178,18 +172,18 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char int len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, gettext("dn_expand failed.")); + return dns_error(self, "dn_expand failed."); ans_pt += len; if (ans_pt > ans_end - 4) - return dns_error(self, gettext("DNS reply was too short.")); + return dns_error(self, "DNS reply was too short."); int type; GETSHORT(type, ans_pt); if (type != T_TXT) - return dns_error(self, gettext("Broken DNS reply.")); + return dns_error(self, "Broken DNS reply."); ans_pt += INT16SZ; /* class */ @@ -201,12 +195,12 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char len = dn_expand(answer, ans_end, ans_pt, exp_ans, sizeof(exp_ans)); if (len == -1) - return dns_error(self, gettext("Second dn_expand failed.")); + return dns_error(self, "Second dn_expand failed."); ans_pt += len; if (ans_pt > ans_end - 10) - return dns_error(self, gettext("DNS reply was too short.")); + return dns_error(self, "DNS reply was too short."); GETSHORT(type, ans_pt); ans_pt += INT16SZ; @@ -214,20 +208,20 @@ static int parse_dns_response(ToxWindow *self, u_char *answer, int ans_len, char GETSHORT(size, ans_pt); if (ans_pt + size < answer || ans_pt + size > ans_end) - return dns_error(self, gettext("RR overflow.")); + return dns_error(self, "RR overflow."); } while (type == T_CNAME); if (type != T_TXT) - return dns_error(self, gettext("DNS response failed.")); + return dns_error(self, "DNS response failed."); uint32_t txt_len = *ans_pt; if (!size || txt_len >= size || !txt_len) - return dns_error(self, gettext("No record found.")); + return dns_error(self, "No record found."); if (txt_len > MAX_DNS_REQST_SIZE) - return dns_error(self, gettext("Invalid DNS response.")); + return dns_error(self, "Invalid DNS response."); ans_pt++; ans_pt[txt_len] = '\0'; @@ -304,7 +298,7 @@ void *dns3_lookup_thread(void *data) int namelen = parse_addr(t_data.addr, name, inputdomain); if (namelen == -1) { - dns_error(self, gettext("Must be a Tox ID or an address in the form username@domain")); + dns_error(self, "Must be a Tox ID or an address in the form username@domain"); killdns_thread(NULL); } @@ -314,14 +308,14 @@ void *dns3_lookup_thread(void *data) int match = get_domain_match(DNS_pubkey, domain, inputdomain); if (match == -1) { - dns_error(self, gettext("Domain not found.")); + dns_error(self, "Domain not found."); killdns_thread(NULL); } void *dns_obj = tox_dns3_new((uint8_t *) DNS_pubkey); if (dns_obj == NULL) { - dns_error(self, gettext("Core failed to create DNS object.")); + dns_error(self, "Core failed to create DNS object."); killdns_thread(NULL); } @@ -332,7 +326,7 @@ void *dns3_lookup_thread(void *data) (uint8_t *) name, namelen); if (str_len == -1) { - dns_error(self, gettext("Core failed to generate DNS3 string.")); + dns_error(self, "Core failed to generate DNS3 string."); killdns_thread(dns_obj); } @@ -346,7 +340,7 @@ void *dns3_lookup_thread(void *data) int ans_len = res_query(d_string, C_IN, T_TXT, answer, sizeof(answer)); if (ans_len <= 0) { - dns_error(self, gettext("DNS query failed.")); + dns_error(self, "DNS query failed."); killdns_thread(dns_obj); } @@ -361,7 +355,7 @@ void *dns3_lookup_thread(void *data) /* extract the encrypted ID from TXT response */ if (strncmp(ans_id, TOX_DNS3_TXT_PREFIX, prfx_len) != 0) { - dns_error(self, gettext("Bad DNS3 TXT response.")); + dns_error(self, "Bad DNS3 TXT response."); killdns_thread(dns_obj); } @@ -369,7 +363,7 @@ void *dns3_lookup_thread(void *data) if (tox_decrypt_dns3_TXT(dns_obj, (uint8_t *) t_data.id_bin, (uint8_t *) encrypted_id, strlen(encrypted_id), request_id) == -1) { - dns_error(self, gettext("Core failed to decrypt DNS response.")); + dns_error(self, "Core failed to decrypt DNS response."); killdns_thread(dns_obj); } @@ -385,12 +379,12 @@ void *dns3_lookup_thread(void *data) void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, const char *msg) { if (arg_opts.proxy_type != TOX_PROXY_TYPE_NONE && arg_opts.force_tcp) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("DNS lookups are disabled.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "DNS lookups are disabled."); return; } if (t_data.busy) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please wait for previous user lookup to finish.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please wait for previous user lookup to finish."); return; } @@ -400,7 +394,7 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, int ret = load_dns_domainlist(path); if (ret < 0) { - const char *errmsg = gettext("DNS server list failed to load with error code %d. Falling back to hard-coded list."); + const char *errmsg = "DNS server list failed to load with error code %d. Falling back to hard-coded list."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, ret); } } @@ -413,20 +407,20 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr, t_data.busy = 1; if (pthread_attr_init(&dns_thread.attr) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to init")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to init"); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_attr_setdetachstate(&dns_thread.attr, PTHREAD_CREATE_DETACHED) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread attr failed to set")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread attr failed to set"); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; } if (pthread_create(&dns_thread.tid, &dns_thread.attr, dns3_lookup_thread, NULL) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("Error: DNS thread failed to init")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, "Error: DNS thread failed to init"); pthread_attr_destroy(&dns_thread.attr); memset(&t_data, 0, sizeof(struct thread_data)); return; diff --git a/src/execute.c b/src/execute.c index 81dfb70..9e83a83 100644 --- a/src/execute.c +++ b/src/execute.c @@ -24,12 +24,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "execute.h" @@ -104,7 +98,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a char *cmd = strdup(input); if (cmd == NULL) - exit_toxic_err(gettext("failed in parse_command"), FATALERR_MEMORY); + exit_toxic_err("failed in parse_command", FATALERR_MEMORY); int num_args = 0; int i = 0; /* index of last char in an argument */ @@ -118,7 +112,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a i = char_find(1, cmd, '\"'); if (cmd[i] == '\0') { - const char *errmsg = gettext("Invalid argument. Did you forget a closing \"?"); + const char *errmsg = "Invalid argument. Did you forget a closing \"?"; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); free(cmd); return -1; @@ -189,5 +183,5 @@ void execute(WINDOW *w, ToxWindow *self, Tox *m, const char *input, int mode) if (do_command(w, self, m, num_args, global_commands, args) == 0) return; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid command.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid command."); } diff --git a/src/friendlist.c b/src/friendlist.c index 45af2b2..c8df965 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -26,12 +26,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include #include "toxic.h" @@ -90,7 +84,7 @@ static void realloc_friends(int n) uint32_t *f_idx = realloc(Friends.index, n * sizeof(uint32_t)); if (f == NULL || f_idx == NULL) - exit_toxic_err(gettext("failed in realloc_friends"), FATALERR_MEMORY); + exit_toxic_err("failed in realloc_friends", FATALERR_MEMORY); Friends.list = f; Friends.index = f_idx; @@ -110,7 +104,7 @@ static void realloc_blocklist(int n) uint32_t *b_idx = realloc(Blocked.index, n * sizeof(uint32_t)); if (b == NULL || b_idx == NULL) - exit_toxic_err(gettext("failed in realloc_blocklist"), FATALERR_MEMORY); + exit_toxic_err("failed in realloc_blocklist", FATALERR_MEMORY); Blocked.list = b; Blocked.index = b_idx; @@ -138,7 +132,7 @@ static int save_blocklist(char *path) char *data = malloc(len); if (data == NULL) - exit_toxic_err(gettext("Failed in save_blocklist"), FATALERR_MEMORY); + exit_toxic_err("Failed in save_blocklist", FATALERR_MEMORY); int i; @@ -205,7 +199,7 @@ int load_blocklist(char *path) if (data == NULL) { fclose(fp); - exit_toxic_err(gettext("Failed in load_blocklist"), FATALERR_MEMORY); + exit_toxic_err("Failed in load_blocklist", FATALERR_MEMORY); } if (fread(data, len, 1, fp) != 1) { @@ -328,7 +322,7 @@ static void friendlist_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESS get_time_str(timefrmt, sizeof(timefrmt)); line_info_add(prompt, timefrmt, nick, NULL, IN_MSG, 0, 0, "%s", str); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("* Warning: Too many windows are open.")); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "* Warning: Too many windows are open."); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -343,7 +337,7 @@ static void friendlist_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, ++Friends.num_online; if (avatar_send(m, num) == -1) - fprintf(stderr, gettext("avatar_send failed for friend %d\n"), num); + fprintf(stderr, "avatar_send failed for friend %d\n", num); } Friends.list[num].connection_status = connection_status; @@ -418,7 +412,7 @@ void friendlist_onFriendAdded(ToxWindow *self, Tox *m, uint32_t num, bool sort) tox_friend_get_public_key(m, num, (uint8_t *) Friends.list[i].pub_key, &pkerr); if (pkerr != TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK) - fprintf(stderr, gettext("tox_friend_get_public_key failed (error %d)\n"), pkerr); + fprintf(stderr, "tox_friend_get_public_key failed (error %d)\n", pkerr); TOX_ERR_FRIEND_GET_LAST_ONLINE loerr; uint64_t t = tox_friend_get_last_online(m, num, &loerr); @@ -497,7 +491,7 @@ static void friendlist_onFileRecv(ToxWindow *self, Tox *m, uint32_t num, uint32_ get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - gettext("* File transfer from %s failed: too many windows are open."), nick); + "* File transfer from %s failed: too many windows are open.", nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -520,7 +514,7 @@ static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, uint8 get_nick_truncate(m, nick, num); line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, - gettext("* Group chat invite from %s failed: too many windows are open."), nick); + "* Group chat invite from %s failed: too many windows are open.", nick); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -543,7 +537,7 @@ static void delete_friend(Tox *m, uint32_t f_num) { TOX_ERR_FRIEND_DELETE err; if (tox_friend_delete(m, f_num, &err) != true) { - fprintf(stderr, gettext("tox_friend_delete failed with error %d\n"), err); + fprintf(stderr, "tox_friend_delete failed with error %d\n", err); return; } @@ -623,7 +617,7 @@ static void draw_del_popup(void) wattroff(PendingDelete.popup, A_BOLD); wmove(PendingDelete.popup, 1, 1); - wprintw(PendingDelete.popup, gettext("Delete contact ")); + wprintw(PendingDelete.popup, "Delete contact "); wattron(PendingDelete.popup, A_BOLD); if (blocklist_view == 0) @@ -704,7 +698,7 @@ static void unblock_friend(Tox *m, uint32_t bnum) uint32_t friendnum = tox_friend_add_norequest(m, (uint8_t *) Blocked.list[bnum].pub_key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to unblock friend (error %d)\n"), err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to unblock friend (error %d)\n", err); return; } @@ -763,7 +757,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) Friends.list[f].chatwin = add_window(m, new_chat(m, Friends.list[f].num)); set_active_window(Friends.list[f].chatwin); } else { - const char *msg = gettext("* Warning: Too many windows are open."); + const char *msg = "* Warning: Too many windows are open."; line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, msg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); } @@ -800,7 +794,7 @@ static void friendlist_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) { wattron(self->window, A_BOLD); - wprintw(self->window, gettext(" Blocked: ")); + wprintw(self->window, " Blocked: "); wattroff(self->window, A_BOLD); wprintw(self->window, "%d\n\n", Blocked.num_blocked); @@ -852,7 +846,7 @@ static void blocklist_onDraw(ToxWindow *self, Tox *m, int y2, int x2) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, gettext("Key: ")); + wprintw(self->window, "Key: "); wattroff(self->window, A_BOLD); int i; @@ -878,11 +872,11 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) bool fix_statuses = x2 != self->x; /* true if window max x value has changed */ wattron(self->window, COLOR_PAIR(CYAN)); - wprintw(self->window, gettext(" Press the")); + wprintw(self->window, " Press the"); wattron(self->window, A_BOLD); wprintw(self->window, " h "); wattroff(self->window, A_BOLD); - wprintw(self->window, gettext("key for help\n\n")); + wprintw(self->window, "key for help\n\n"); wattroff(self->window, COLOR_PAIR(CYAN)); if (blocklist_view == 1) { @@ -894,7 +888,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) struct tm cur_loc_tm = *localtime((const time_t *) &cur_time); wattron(self->window, A_BOLD); - wprintw(self->window, gettext(" Online: ")); + wprintw(self->window, " Online: "); wattroff(self->window, A_BOLD); wprintw(self->window, "%d/%d \n\n", Friends.num_online, Friends.num_friends); @@ -1008,19 +1002,19 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) switch (day_dist) { case 0: - wprintw(self->window, gettext(" Last seen: Today %s\n"), hourmin); + wprintw(self->window, " Last seen: Today %s\n", hourmin); break; case 1: - wprintw(self->window, gettext(" Last seen: Yesterday %s\n"), hourmin); + wprintw(self->window, " Last seen: Yesterday %s\n", hourmin); break; default: - wprintw(self->window, gettext(" Last seen: %d days ago\n"), day_dist); + wprintw(self->window, " Last seen: %d days ago\n", day_dist); break; } } else { - wprintw(self->window, gettext(" Last seen: Never\n")); + wprintw(self->window, " Last seen: Never\n"); } } } @@ -1032,7 +1026,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) wmove(self->window, y2 - 1, 1); wattron(self->window, A_BOLD); - wprintw(self->window, gettext("Key: ")); + wprintw(self->window, "Key: "); wattroff(self->window, A_BOLD); int i; @@ -1071,9 +1065,9 @@ static void friendlist_onAv(ToxWindow *self, ToxAv *av, int call_index) } else { char nick[TOX_MAX_NAME_LENGTH]; get_nick_truncate(m, nick, Friends.list[id].num); - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Audio action from: %s!"), nick); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Audio action from: %s!", nick); - const char *errmsg = gettext("* Warning: Too many windows are open."); + const char *errmsg = "* Warning: Too many windows are open."; line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); sound_notify(prompt, notif_error, NT_WNDALERT_1, NULL); @@ -1123,9 +1117,9 @@ ToxWindow new_friendlist(void) Help *help = calloc(1, sizeof(Help)); if (help == NULL) - exit_toxic_err(gettext("failed in new_friendlist"), FATALERR_MEMORY); + exit_toxic_err("failed in new_friendlist", FATALERR_MEMORY); ret.help = help; - strcpy(ret.name, gettext("contacts")); + strcpy(ret.name, "contacts"); return ret; } diff --git a/src/global_commands.c b/src/global_commands.c index 50e0eb2..fc7e3b8 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -24,12 +24,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -52,19 +46,19 @@ extern FriendRequests FrndRequests; void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); return; } @@ -72,10 +66,10 @@ void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ uint32_t friendnum = tox_friend_add_norequest(m, FrndRequests.request[req].key, &err); if (err != TOX_ERR_FRIEND_ADD_OK) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to add friend (error %d)\n"), err); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to add friend (error %d\n)", err); return; } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request accepted.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Friend request accepted."); on_friendadded(m, friendnum, true); } @@ -102,42 +96,42 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg switch (err) { case TOX_ERR_FRIEND_ADD_TOO_LONG: - errmsg = gettext("Message is too long."); + errmsg = "Message is too long."; break; case TOX_ERR_FRIEND_ADD_NO_MESSAGE: - errmsg = gettext("Please add a message to your request."); + errmsg = "Please add a message to your request."; break; case TOX_ERR_FRIEND_ADD_OWN_KEY: - errmsg = gettext("That appears to be your own ID."); + errmsg = "That appears to be your own ID."; break; case TOX_ERR_FRIEND_ADD_ALREADY_SENT: - errmsg = gettext("Friend request has already been sent."); + errmsg = "Friend request has already been sent."; break; case TOX_ERR_FRIEND_ADD_BAD_CHECKSUM: - errmsg = gettext("Bad checksum in address."); + errmsg = "Bad checksum in address."; break; case TOX_ERR_FRIEND_ADD_SET_NEW_NOSPAM: - errmsg = gettext("Nospam was different."); + errmsg = "Nospam was different."; break; case TOX_ERR_FRIEND_ADD_MALLOC: - errmsg = gettext("Core memory allocation failed."); + errmsg = "Core memory allocation failed."; break; case TOX_ERR_FRIEND_ADD_OK: - errmsg = gettext("Friend request sent."); + errmsg = "Friend request sent."; on_friendadded(m, f_num, true); break; case TOX_ERR_FRIEND_ADD_NULL: /* fallthrough */ default: - errmsg = gettext("Failed to add friend: Unknown error."); + errmsg = "Faile to add friend: Unknown error."; break; } @@ -147,7 +141,7 @@ void cmd_add_helper(ToxWindow *self, Tox *m, const char *id_bin, const char *msg void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Tox ID or address required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Tox ID or address required."); return; } @@ -156,7 +150,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc > 1) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Message must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Message must be enclosed in quotes."); return; } @@ -172,7 +166,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX size_t n_len = tox_self_get_name_size(m); selfname[n_len] = '\0'; - snprintf(msg, sizeof(msg), gettext("Hello, my name is %s. Care to Tox?"), selfname); + snprintf(msg, sizeof(msg), "Hello, my name is %s. Care to Tox?", selfname); } char id_bin[TOX_ADDRESS_SIZE] = {0}; @@ -190,7 +184,7 @@ void cmd_add(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX xx[2] = '\0'; if (sscanf(xx, "%02x", &x) != 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid Tox ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid Tox ID."); return; } @@ -207,12 +201,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ { if (argc < 2 || strlen(argv[1]) < 3) { avatar_unset(m); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar is not set.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar is not set."); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Path must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Path must be enclosed in quotes."); return; } @@ -222,7 +216,7 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ int len = strlen(path) - 1; if (len <= 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid path.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid path."); return; } @@ -232,12 +226,12 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (avatar_set(m, path, len) == -1) { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, - gettext("Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes."), + "Failed to set avatar. Avatars must be in PNG format and may not exceed %d bytes.", MAX_AVATAR_FILE_SIZE); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Avatar set to '%s'"), filename); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Avatar set to '%s'", filename); } void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -249,7 +243,7 @@ void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc != 3) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Require: ")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Require: "); return; } @@ -258,7 +252,7 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) const char *key = argv[3]; if (atoi(port) == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid port.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid port."); return; } @@ -271,15 +265,15 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) switch (err) { case TOX_ERR_BOOTSTRAP_BAD_HOST: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid IP.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid IP."); break; case TOX_ERR_BOOTSTRAP_BAD_PORT: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed: Invalid port.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed: Invalid port."); break; case TOX_ERR_BOOTSTRAP_NULL: - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Bootstrap failed.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Bootstrap failed."); break; default: break; @@ -289,19 +283,19 @@ void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Request ID required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Request ID required."); return; } int req = atoi(argv[1]); if ((req == 0 && strcmp(argv[1], "0")) || req < 0 || req > MAX_FRIEND_REQUESTS) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); return; } if (!FrndRequests.request[req].active) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend request with that ID.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend request with that ID."); return; } @@ -321,12 +315,12 @@ void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (get_num_active_windows() >= MAX_WINDOWS_NUM) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Warning: Too many windows are open.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Warning: Too many windows are open."); return; } if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Please specify group type: %s"), "text|audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please specify group type: text | audio"); return; } @@ -337,7 +331,7 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg else if (!strcasecmp(argv[1], "text")) type = TOX_GROUPCHAT_TYPE_TEXT; else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Valid group types are: %s"), "text|audio"); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Valid group types are: text | audio"); return; } @@ -351,17 +345,17 @@ void cmd_groupchat(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg #endif if (groupnum == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat instance failed to initialize.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); return; } if (init_groupchat_win(prompt, m, groupnum, type) == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat window failed to initialize.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); tox_del_groupchat(m, groupnum); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Group chat [%d] created."), groupnum); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat [%d] created.", groupnum); } void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -371,9 +365,9 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX if (argc == 0) { if (log->log_on) - msg = gettext("Logging for this window is ON. Type \"/log off\" to disable."); + msg = "Logging for this window is ON. Type \"/log off\" to disable."; else - msg = gettext("Logging for this window is OFF. Type \"/log on\" to enable."); + msg = "Logging for this window is OFF. Type \"/log on\" to enable."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; @@ -394,7 +388,7 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_enable(self->name, myid, NULL, log, LOG_GROUP); } - msg = gettext("Logging enabled"); + msg = "Logging enabled"; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } else if (!strcmp(swch, "0") || !strcmp(swch, "off")) { @@ -403,13 +397,13 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_disable(log); - msg = gettext("Logging disabled"); + msg = "Logging disabled"; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } - msg = gettext("Invalid option. Use \"%s\" to toggle logging."); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg, "/log on|off"); + msg = "Invalid option. Use \"/log on\" and \"/log off\" to toggle logging."; + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); } void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) @@ -432,7 +426,7 @@ void cmd_myid(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); return; } @@ -449,7 +443,7 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA } if (!valid_nick(nick)) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Invalid name.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid name."); return; } @@ -465,12 +459,12 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_note(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Input required.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Input required."); return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); return; } @@ -496,7 +490,7 @@ void cmd_quit(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA void cmd_requests(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (FrndRequests.num_requests == 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("No pending friend requests.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "No pending friend requests."); return; } @@ -533,8 +527,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (argc >= 2) { have_note = true; } else if (argc < 1) { - errmsg = gettext("Require a status. Statuses are: %s."); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); + errmsg = "Require a status. Statuses are: online, busy and away."; + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); goto finish; } @@ -548,8 +542,8 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ else if (!strcasecmp(status_str, "busy")) status = TOX_USER_STATUS_BUSY; else { - errmsg = gettext("Invalid status. Valid statuses are: %s."); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg, "online|busy|away"); + errmsg = "Invalid status. Valid statuses are: online, busy and away."; + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); goto finish; } @@ -558,7 +552,7 @@ void cmd_status(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ if (have_note) { if (argv[2][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Note must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes."); goto finish; } diff --git a/src/group_commands.c b/src/group_commands.c index 2589370..fb73a0b 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -22,12 +22,6 @@ #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -43,16 +37,16 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg if (tlen != -1) { title[tlen] = '\0'; - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is set to: %s"), title); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is set to: %s", title); } else { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title is not set")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title is not set"); } return; } if (argv[1][0] != '\"') { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Title must be enclosed in quotes.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Title must be enclosed in quotes."); return; } @@ -62,7 +56,7 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg title[len] = '\0'; if (tox_group_set_title(m, self->num, (uint8_t *) title, len) != 0) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set title.")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set title."); return; } @@ -77,9 +71,9 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg size_t sn_len = tox_self_get_name_size(m); selfnick[sn_len] = '\0'; - line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); + line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); + snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); write_to_log(tmp_event, selfnick, self->chatwin->log, true); } diff --git a/src/groupchat.c b/src/groupchat.c index 8423497..751679e 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -31,12 +31,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #ifdef AUDIO #ifdef __APPLE__ #include @@ -140,15 +134,15 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type) if (groupchats[i].peer_names == NULL || groupchats[i].oldpeer_names == NULL || groupchats[i].peer_name_lengths == NULL || groupchats[i].oldpeer_name_lengths == NULL) - exit_toxic_err(gettext("failed in init_groupchat_win"), FATALERR_MEMORY); + exit_toxic_err("failed in init_groupchat_win", FATALERR_MEMORY); - memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, strlen(UNKNOWN_NAME)); + memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, sizeof(UNKNOWN_NAME)); groupchats[i].oldpeer_name_lengths[0] = (uint16_t) strlen(UNKNOWN_NAME); #ifdef AUDIO if (type == TOX_GROUPCHAT_TYPE_AV) if (group_audio_open_out_device(i) == -1) - fprintf(stderr, gettext("Group Audio failed to init\n")); + fprintf(stderr, "Group Audio failed to init\n"); #endif /* AUDIO */ set_active_window(groupchats[i].chatwin); @@ -334,10 +328,10 @@ static void groupchat_onGroupTitleChange(ToxWindow *self, Tox *m, int groupnum, char nick[TOX_MAX_NAME_LENGTH]; get_group_nick_truncate(m, nick, peernum, groupnum); - line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, gettext(" set the group title to: %s"), title); + line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title); char tmp_event[MAX_STR_SIZE]; - snprintf(tmp_event, sizeof(tmp_event), gettext("set title to %s"), title); + snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title); write_to_log(tmp_event, nick, ctx->log, true); } @@ -359,7 +353,7 @@ static void copy_peernames(int gnum, uint8_t peerlist[][TOX_MAX_NAME_LENGTH], ui if (groupchats[gnum].peer_names == NULL || groupchats[gnum].oldpeer_names == NULL || groupchats[gnum].peer_name_lengths == NULL || groupchats[gnum].oldpeer_name_lengths == NULL) { - exit_toxic_err(gettext("failed in copy_peernames"), FATALERR_MEMORY); + exit_toxic_err("failed in copy_peernames", FATALERR_MEMORY); } uint16_t u_len = strlen(UNKNOWN_NAME); @@ -416,7 +410,7 @@ void *group_add_wait(void *data) pthread_mutex_unlock(&Winthread.lock); } - const char *event = gettext("has joined the room"); + const char *event = "has joined the room"; char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); @@ -514,7 +508,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu break; case TOX_CHAT_CHANGE_PEER_DEL: - event = gettext("has left the room"); + event = "has left the room"; line_info_add(self, timefrmt, (char *) oldpeername, NULL, DISCONNECTION, 0, RED, event); if (groupchats[self->num].side_pos > 0) @@ -531,11 +525,11 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu if (strcmp((char *) oldpeername, DEFAULT_TOX_NAME) == 0) return; - event = gettext(" is now known as "); + event = " is now known as "; line_info_add(self, timefrmt, (char *) oldpeername, (char *) peername, NAME_CHANGE, 0, 0, event); char tmp_event[TOXIC_MAX_NAME_LENGTH * 2 + 32]; - snprintf(tmp_event, sizeof(tmp_event), gettext("is now known as %s"), (char *) peername); + snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", (char *) peername); write_to_log(tmp_event, (char *) oldpeername, ctx->log, true); break; } @@ -546,12 +540,12 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu static void send_group_action(ToxWindow *self, ChatContext *ctx, Tox *m, char *action) { if (action == NULL) { - wprintw(ctx->history, gettext("Invalid syntax.\n")); + wprintw(ctx->history, "Invalid syntax.\n"); return; } if (tox_group_action_send(m, self->num, (uint8_t *) action, strlen(action)) == -1) { - const char *errmsg = gettext(" * Failed to send action."); + const char *errmsg = " * Failed to send action."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -638,7 +632,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) } } else if (!string_is_empty(line)) { if (tox_group_message_send(m, self->num, (uint8_t *) line, strlen(line)) == -1) { - const char *errmsg = gettext(" * Failed to send message."); + const char *errmsg = " * Failed to send message."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, errmsg); } } @@ -678,7 +672,7 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m) wmove(ctx->sidebar, 0, 1); wattron(ctx->sidebar, A_BOLD); - wprintw(ctx->sidebar, gettext("Peers: %d\n"), num_peers); + wprintw(ctx->sidebar, "Peers: %d\n", num_peers); wattroff(ctx->sidebar, A_BOLD); mvwaddch(ctx->sidebar, 1, 0, ACS_LTEE); @@ -728,7 +722,7 @@ static void groupchat_onInit(ToxWindow *self, Tox *m) ctx->log = calloc(1, sizeof(struct chatlog)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err(gettext("failed in groupchat_onInit"), FATALERR_MEMORY); + exit_toxic_err("failed in groupchat_onInit", FATALERR_MEMORY); line_info_init(ctx->hst); @@ -813,7 +807,7 @@ static int group_audio_write(int peernum, int groupnum, const int16_t *pcm, unsi alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_PROCESSED, &processed); alGetSourcei(groupchats[groupnum].audio.source, AL_BUFFERS_QUEUED, &queued); - fprintf(stderr, gettext("source: %d, queued: %d, processed: %d\n"), groupchats[groupnum].audio.source, queued, processed); + fprintf(stderr, "source: %d, queued: %d, processed: %d\n", groupchats[groupnum].audio.source, queued, processed); if (processed) { ALuint bufids[processed]; @@ -852,13 +846,13 @@ static void groupchat_onWriteDevice(ToxWindow *self, Tox *m, int groupnum, int p return; if (groupchats[groupnum].audio.dvhandle == NULL) - fprintf(stderr, gettext("dvhandle is null)\n")); + fprintf(stderr, "dvhandle is null)\n"); if (groupchats[groupnum].audio.dvctx == NULL) - fprintf(stderr, gettext("ctx is null\n")); + fprintf(stderr, "ctx is null\n"); int ret = group_audio_write(peernum, groupnum, pcm, samples, channels, sample_rate); - fprintf(stderr, gettext("write: %d\n"), ret); + fprintf(stderr, "write: %d\n", ret); } #endif /* AUDIO */ @@ -882,13 +876,13 @@ ToxWindow new_group_chat(Tox *m, int groupnum) ret.onWriteDevice = &groupchat_onWriteDevice; #endif - snprintf(ret.name, sizeof(ret.name), gettext("Group %d"), groupnum); + snprintf(ret.name, sizeof(ret.name), "Group %d", groupnum); ChatContext *chatwin = calloc(1, sizeof(ChatContext)); Help *help = calloc(1, sizeof(Help)); if (chatwin == NULL || help == NULL) - exit_toxic_err(gettext("failed in new_group_chat"), FATALERR_MEMORY); + exit_toxic_err("failed in new_group_chat", FATALERR_MEMORY); ret.chatwin = chatwin; ret.help = help; diff --git a/src/help.c b/src/help.c index 0838433..8989c11 100644 --- a/src/help.c +++ b/src/help.c @@ -22,12 +22,6 @@ #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "windows.h" #include "toxic.h" #include "help.h" @@ -145,50 +139,32 @@ static void help_draw_global(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext("Global Commands:\n")); + wprintw(win, "Global Commands:\n"); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /add : "); - wprintw(win, gettext("Add contact with optional message\n")); - wprintw(win, " /accept : "); - wprintw(win, gettext("Accept friend request\n")); - wprintw(win, " /avatar : "); - wprintw(win, gettext("Set an avatar (leave path empty to unset)\n")); - wprintw(win, " /decline : "); - wprintw(win, gettext("Decline friend request\n")); - wprintw(win, " /requests : "); - wprintw(win, gettext("List pending friend requests\n")); - wprintw(win, " /connect : "); - wprintw(win, gettext("Manually connect to a DHT node\n")); - wprintw(win, " /status : "); - wprintw(win, gettext("Set status with optional note\n")); - wprintw(win, " /note : "); - wprintw(win, gettext("Set a personal note\n")); - wprintw(win, " /nick : "); - wprintw(win, gettext("Set your nickname\n")); - wprintw(win, " /log or : "); - wprintw(win, gettext("Enable/disable logging\n")); - wprintw(win, " /group : "); - wprintw(win, gettext("Create a group chat where type: text | audio\n")); - wprintw(win, " /myid : "); - wprintw(win, gettext("Print your Tox ID\n")); - wprintw(win, " /clear : "); - wprintw(win, gettext("Clear window history\n")); - wprintw(win, " /close : "); - wprintw(win, gettext("Close the current chat window\n")); - wprintw(win, " /quit or /exit : "); - wprintw(win, gettext("Exit Toxic\n")); + wprintw(win, " /add : Add contact with optional message\n"); + wprintw(win, " /accept : Accept friend request\n"); + wprintw(win, " /avatar : Set an avatar (leave path empty to unset)\n"); + wprintw(win, " /decline : Decline friend request\n"); + wprintw(win, " /requests : List pending friend requests\n"); + wprintw(win, " /connect : Manually connect to a DHT node\n"); + wprintw(win, " /status : Set status with optional note\n"); + wprintw(win, " /note : Set a personal note\n"); + wprintw(win, " /nick : Set your nickname\n"); + wprintw(win, " /log or : Enable/disable logging\n"); + wprintw(win, " /group : Create a group chat where type: text | audio\n"); + wprintw(win, " /myid : Print your Tox ID\n"); + wprintw(win, " /clear : Clear window history\n"); + wprintw(win, " /close : Close the current chat window\n"); + wprintw(win, " /quit or /exit : Exit Toxic\n"); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, gettext("\n Audio:\n")); + wprintw(win, "\n Audio:\n"); wattroff(win, A_BOLD); - wprintw(win, " /lsdev : "); - wprintw(win, gettext("List devices where type:")); - wprintw(win, " in|out\n"); - wprintw(win, " /sdev : "); - wprintw(win, gettext("Set active device\n")); + wprintw(win, " /lsdev : List devices where type: in|out\n"); + wprintw(win, " /sdev : Set active device\n"); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -204,40 +180,27 @@ static void help_draw_chat(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext("Chat Commands:\n")); + wprintw(win, "Chat Commands:\n"); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /invite : "); - wprintw(win, gettext("Invite contact to a group chat\n")); - wprintw(win, " /join : "); - wprintw(win, gettext("Join a pending group chat\n")); - wprintw(win, " /sendfile : "); - wprintw(win, gettext("Send a file\n")); - wprintw(win, " /savefile : "); - wprintw(win, gettext("Receive a file\n")); - wprintw(win, " /cancel : "); - wprintw(win, gettext("Cancel file transfer where type:")); - wprintw(win, " in|out\n"); + wprintw(win, " /invite : Invite contact to a group chat\n"); + wprintw(win, " /join : Join a pending group chat\n"); + wprintw(win, " /sendfile : Send a file\n"); + wprintw(win, " /savefile : Receive a file\n"); + wprintw(win, " /cancel : Cancel file transfer where type: in|out\n"); #ifdef AUDIO wattron(win, A_BOLD); - wprintw(win, gettext("\n Audio:\n")); + wprintw(win, "\n Audio:\n"); wattroff(win, A_BOLD); - wprintw(win, " /call : "); - wprintw(win, gettext("Audio call\n")); - wprintw(win, " /answer : "); - wprintw(win, gettext("Answer incoming call\n")); - wprintw(win, " /reject : "); - wprintw(win, gettext("Reject incoming call\n")); - wprintw(win, " /hangup : "); - wprintw(win, gettext("Hangup active call\n")); - wprintw(win, " /sdev : "); - wprintw(win, gettext("Change active device\n")); - wprintw(win, " /mute : "); - wprintw(win, gettext("Mute active device if in call\n")); - wprintw(win, " /sense : "); - wprintw(win, gettext("VAD sensitivity threshold\n")); + wprintw(win, " /call : Audio call\n"); + wprintw(win, " /answer : Answer incoming call\n"); + wprintw(win, " /reject : Reject incoming call\n"); + wprintw(win, " /hangup : Hangup active call\n"); + wprintw(win, " /sdev : Change active device\n"); + wprintw(win, " /mute : Mute active device if in call\n"); + wprintw(win, " /sense : VAD sensitivity threshold\n"); #endif /* AUDIO */ help_draw_bottom_menu(win); @@ -253,22 +216,16 @@ static void help_draw_keys(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext("Key bindings:\n")); + wprintw(win, "Key bindings:\n"); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " Ctrl+O -- Ctrl+P : "); - wprintw(win, gettext("Navigate through the tabs\n")); - wprintw(win, " Page Up -- Page Down : "); - wprintw(win, gettext("Scroll window history one line\n")); - wprintw(win, " Ctrl+F -- Ctrl+V : "); - wprintw(win, gettext("Scroll window history half a page\n")); - wprintw(win, " Ctrl+H : "); - wprintw(win, gettext("Move to the bottom of window history\n")); - wprintw(win, " Ctrl+[ -- Ctrl+] : "); - wprintw(win, gettext("Scroll peer list in groupchats\n")); - wprintw(win, " Ctrl+B : "); - wprintw(win, gettext("Toggle the groupchat peerlist\n\n")); - wprintw(win, gettext(" (Note: Custom keybindings override these defaults.)\n\n")); + wprintw(win, " Ctrl+O and Ctrl+P : Navigate through the tabs\n"); + wprintw(win, " Page Up and Page Down : Scroll window history one line\n"); + wprintw(win, " Ctrl+F and Ctrl+V : Scroll window history half a page\n"); + wprintw(win, " Ctrl+H : Move to the bottom of window history\n"); + wprintw(win, " Ctrl+[ and Ctrl+] : Scroll peer list in groupchats\n"); + wprintw(win, " Ctrl+B : Toggle the groupchat peerlist\n\n"); + wprintw(win, " (Note: Custom keybindings override these defaults.)\n\n"); help_draw_bottom_menu(win); @@ -283,11 +240,10 @@ static void help_draw_group(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext("Group commands:\n")); + wprintw(win, "Group commands:\n"); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, " /title : "); - wprintw(win, gettext("Set group title (show current title if no msg)\n\n")); + wprintw(win, " /title : Set group title (show current title if no msg)\n\n"); help_draw_bottom_menu(win); @@ -302,15 +258,14 @@ static void help_draw_contacts(ToxWindow *self) wmove(win, 1, 1); wattron(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext("Friendlist controls:\n")); + wprintw(win, "Friendlist controls:\n"); wattroff(win, A_BOLD | COLOR_PAIR(RED)); - wprintw(win, gettext(" Up and Down arrows : Scroll through list\n")); - wprintw(win, gettext(" Right and Left arrows : Switch between friendlist and blocked list\n")); - wprintw(win, gettext(" Enter : Open a chat window with selected contact\n")); - wprintw(win, gettext(" Delete : Permanently delete a contact\n")); - wprintw(win, " B : "); - wprintw(win, gettext("Block or unblock a contact\n")); + wprintw(win, " Up and Down arrows : Scroll through list\n"); + wprintw(win, " Right and Left arrows : Switch between friendlist and blocked list\n"); + wprintw(win, " Enter : Open a chat window with selected contact\n"); + wprintw(win, " Delete : Permanently delete a contact\n"); + wprintw(win, " B : Block or unblock a contact\n"); help_draw_bottom_menu(win); diff --git a/src/line_info.c b/src/line_info.c index 12eea6d..b645e8f 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -25,12 +25,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "line_info.h" @@ -47,7 +41,7 @@ void line_info_init(struct history *hst) hst->line_root = calloc(1, sizeof(struct line_info)); if (hst->line_root == NULL) - exit_toxic_err(gettext("failed in line_info_init"), FATALERR_MEMORY); + exit_toxic_err("failed in line_info_init", FATALERR_MEMORY); hst->line_start = hst->line_root; hst->line_end = hst->line_start; @@ -147,7 +141,7 @@ void line_info_add(ToxWindow *self, const char *timestr, const char *name1, cons struct line_info *new_line = calloc(1, sizeof(struct line_info)); if (new_line == NULL) - exit_toxic_err(gettext("failed in line_info_add"), FATALERR_MEMORY); + exit_toxic_err("failed in line_info_add", FATALERR_MEMORY); char frmt_msg[MAX_LINE_INFO_MSG_SIZE] = {0}; diff --git a/src/log.c b/src/log.c index a3331ef..f04c83d 100644 --- a/src/log.c +++ b/src/log.c @@ -25,12 +25,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "configdir.h" #include "toxic.h" #include "windows.h" @@ -186,17 +180,17 @@ void load_chat_history(ToxWindow *self, struct chatlog *log) char *hstbuf = malloc(sz); if (hstbuf == NULL) - exit_toxic_err(gettext("failed in load_chat_history"), FATALERR_MEMORY); + exit_toxic_err("failed in load_chat_history", FATALERR_MEMORY); if (fseek(log->file, 0L, SEEK_SET) == -1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); return; } if (fread(hstbuf, sz, 1, log->file) != 1) { free(hstbuf); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext(" * Failed to read log file")); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, RED, " * Failed to read log file"); return; } diff --git a/src/message_queue.c b/src/message_queue.c index 996e4eb..70ccadb 100644 --- a/src/message_queue.c +++ b/src/message_queue.c @@ -22,12 +22,6 @@ #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "message_queue.h" @@ -53,7 +47,7 @@ void cqueue_add(struct chat_queue *q, const char *msg, size_t len, uint8_t type, struct cqueue_msg *new_m = malloc(sizeof(struct cqueue_msg)); if (new_m == NULL) - exit_toxic_err(gettext("failed in cqueue_message"), FATALERR_MEMORY); + exit_toxic_err("failed in cqueue_message", FATALERR_MEMORY); snprintf(new_m->message, sizeof(new_m->message), "%s", msg); new_m->len = len; diff --git a/src/misc_tools.c b/src/misc_tools.c index 65114a1..0d0a749 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -28,12 +28,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "misc_tools.h" @@ -237,7 +231,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *path = strdup(pathname); if (path == NULL) - exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); + exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); while (len >= 0 && pathname[len] == '/') path[len--] = '\0'; @@ -245,7 +239,7 @@ size_t get_file_name(char *namebuf, size_t bufsize, const char *pathname) char *finalname = strdup(path); if (finalname == NULL) - exit_toxic_err(gettext("failed in get_file_name"), FATALERR_MEMORY); + exit_toxic_err("failed in get_file_name", FATALERR_MEMORY); const char *basenm = strrchr(path, '/'); diff --git a/src/prompt.c b/src/prompt.c index a3d2901..7a189b0 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -28,12 +28,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "toxic.h" #include "windows.h" #include "prompt.h" @@ -136,7 +130,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusms tox_self_set_status_message(m, (uint8_t *) statusmsg, len, &err); if (err != TOX_ERR_SET_INFO_OK) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Failed to set note (error %d)\n"), err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to set note (error %d)\n", err); } /* Updates own status in prompt statusbar */ @@ -271,19 +265,19 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) if (statusbar->connection != TOX_CONNECTION_NONE) { int colour = MAGENTA; - const char *status_text = gettext("ERROR"); + const char *status_text = "ERROR"; switch (statusbar->status) { case TOX_USER_STATUS_NONE: - status_text = gettext("Online"); + status_text = "Online"; colour = GREEN; break; case TOX_USER_STATUS_AWAY: - status_text = gettext("Away"); + status_text = "Away"; colour = YELLOW; break; case TOX_USER_STATUS_BUSY: - status_text = gettext("Busy"); + status_text = "Busy"; colour = RED; break; } @@ -296,7 +290,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m) wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); } else { - wprintw(statusbar->topline, gettext(" [Offline]")); + wprintw(statusbar->topline, " [Offline]"); wattron(statusbar->topline, A_BOLD); wprintw(statusbar->topline, " %s", statusbar->nick); wattroff(statusbar->topline, A_BOLD); @@ -360,28 +354,28 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, uint32_t friendnu const char *msg; if (connection_status != TOX_CONNECTION_NONE && Friends.list[friendnum].connection_status == TOX_CONNECTION_NONE) { - msg = gettext("has come online"); + msg = "has come online"; line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - gettext("%s has come online"), nick ); + "%s has come online", nick ); else box_notify(self, user_log_in, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", gettext("%s has come online"), nick ); + "Toxic", "%s has come online", nick ); } else if (connection_status == TOX_CONNECTION_NONE) { - msg = gettext("has gone offline"); + msg = "has gone offline"; line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); write_to_log(msg, nick, ctx->log, true); if (self->active_box != -1) box_notify2(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, self->active_box, - gettext("%s has gone offline"), nick ); + "%s has gone offline", nick ); else box_notify(self, user_log_out, NT_WNDALERT_2 | NT_NOTIFWND | NT_RESTOL, &self->active_box, - "Toxic", gettext("%s has gone offline"), nick ); + "Toxic", "%s has gone offline", nick ); } } @@ -392,18 +386,18 @@ static void prompt_onFriendRequest(ToxWindow *self, Tox *m, const char *key, con char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, gettext("Friend request with the message '%s'"), data); - write_to_log(gettext("Friend request with the message '%s'"), "", ctx->log, true); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 0, 0, "Friend request with the message '%s'", data); + write_to_log("Friend request with the message '%s'", "", ctx->log, true); int n = add_friend_request(key, data); if (n == -1) { - const char *errmsg = gettext("Friend request queue is full. Discarding request."); + const char *errmsg = "Friend request queue is full. Discarding request."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg); return; } - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Type \"%s %d\" or \"%s %d\""), "/accept", n, "/decline", n); + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type \"/accept %d\" or \"/decline %d\"", n, n); sound_notify(self, generic_message, NT_WNDALERT_1 | NT_NOTIFWND, NULL); } @@ -432,8 +426,8 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m) nick[n_len] = '\0'; statusmsg[s_len] = '\0'; - if (s_len == 0 || !strncmp(statusmsg, gettext("Toxing on Toxic"), strlen(gettext("Toxing on Toxic")))) { - snprintf(statusmsg, sizeof(statusmsg), gettext("Toxing on Toxic")); + if (s_len == 0 || !strncmp(statusmsg, "Toxing on Toxic", strlen("Toxing on Toxic"))) { + snprintf(statusmsg, sizeof(statusmsg), "Toxing on Toxic"); s_len = strlen(statusmsg); statusmsg[s_len] = '\0'; } @@ -455,10 +449,10 @@ static void print_welcome_msg(ToxWindow *self) line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, BLUE, " |_| \\___/_/\\_\\___\\____| v." TOXICVER); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); - const char *msg = gettext("Welcome to Toxic, a free, open source Tox-based instant messenging client."); + const char *msg = "Welcome to Toxic, a free, open source Tox-based instant messenging client."; + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); + msg = "Type \"/help\" for assistance. Further help may be found via the man page."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg); - msg = gettext("Type \"%s\" for assistance. Further help may be found via the man page."); - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, CYAN, msg, "/help"); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, ""); } @@ -476,7 +470,7 @@ static void prompt_onInit(ToxWindow *self, Tox *m) ctx->hst = calloc(1, sizeof(struct history)); if (ctx->log == NULL || ctx->hst == NULL) - exit_toxic_err(gettext("failed in prompt_onInit"), FATALERR_MEMORY); + exit_toxic_err("failed in prompt_onInit", FATALERR_MEMORY); line_info_init(ctx->hst); @@ -514,7 +508,7 @@ ToxWindow new_prompt(void) Help *help = calloc(1, sizeof(Help)); if (stb == NULL || chatwin == NULL || help == NULL) - exit_toxic_err(gettext("failed in new_prompt"), FATALERR_MEMORY); + exit_toxic_err("failed in new_prompt", FATALERR_MEMORY); ret.chatwin = chatwin; ret.stb = stb; diff --git a/src/toxic.c b/src/toxic.c index c8d0c4f..9d14328 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -40,12 +40,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include #include @@ -109,7 +103,7 @@ static void catch_SIGSEGV(int sig) { freopen("/dev/tty", "w", stderr); // make sure stderr is enabled since we may have disabled it endwin(); - fprintf(stderr, gettext("Caught SIGSEGV: Aborting toxic session.\n")); + fprintf(stderr, "Caught SIGSEGV: Aborting toxic session.\n"); exit(EXIT_FAILURE); } @@ -158,7 +152,7 @@ void exit_toxic_err(const char *errmsg, int errcode) { freopen("/dev/tty", "w", stderr); endwin(); - fprintf(stderr, gettext("Toxic session aborted with error code %d (%s)\n"), errcode, errmsg); + fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg); exit(EXIT_FAILURE); } @@ -168,16 +162,12 @@ static void init_term(void) if (!arg_opts.default_locale) { if (setlocale(LC_ALL, "") == NULL) - exit_toxic_err(gettext("Could not set your locale, please check your locale settings or " - "disable unicode support with the -d flag."), FATALERR_LOCALE_NOT_SET); + exit_toxic_err("Could not set your locale, please check your locale settings or " + "disable unicode support with the -d flag.", FATALERR_LOCALE_NOT_SET); } #endif -#ifndef NO_GETTEXT - textdomain("toxic"); -#endif - initscr(); cbreak(); keypad(stdscr, 1); @@ -228,12 +218,12 @@ static void queue_init_message(const char *msg, ...) char **new_msgs = realloc(init_messages.msgs, sizeof(char *) * init_messages.num); if (new_msgs == NULL) - exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); + exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); new_msgs[i] = malloc(MAX_STR_SIZE); if (new_msgs[i] == NULL) - exit_toxic_err(gettext("Failed in queue_init_message"), FATALERR_MEMORY); + exit_toxic_err("Failed in queue_init_message", FATALERR_MEMORY); snprintf(new_msgs[i], MAX_STR_SIZE, "%s", frmt_msg); init_messages.msgs = new_msgs; @@ -261,7 +251,7 @@ static void print_init_messages(ToxWindow *toxwin) line_info_add(toxwin, NULL, NULL, NULL, SYS_MSG, 0, 0, init_messages.msgs[i]); } -#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.chat = 6) */ +#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.im = 6) */ #define MAX_NODE_LINE 256 /* Approx max number of chars in a sever line (name + port + key) */ #define MAXNODES 50 #define NODELEN (MAX_NODE_LINE - TOX_PUBLIC_KEY_SIZE - 7) @@ -325,14 +315,14 @@ int init_connection_helper(Tox *m, int line) tox_bootstrap(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, gettext("Failed to bootstrap %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, "Failed to bootstrap %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); return -1; } tox_add_tcp_relay(m, toxNodes.nodes[line], toxNodes.ports[line], (uint8_t *) toxNodes.keys[line], &err); if (err != TOX_ERR_BOOTSTRAP_OK) { - fprintf(stderr, gettext("Failed to add TCP relay %s:%d\n"), toxNodes.nodes[line], toxNodes.ports[line]); + fprintf(stderr, "Failed to add TCP relay %s:%d\n", toxNodes.nodes[line], toxNodes.ports[line]); return -1; } @@ -463,7 +453,7 @@ static void first_time_encrypt(const char *msg) bool valid_password = false; char passconfirm[MAX_PASSWORD_LEN + 1] = {0}; - printf(gettext("Enter a new password (must be at least %d characters) "), MIN_PASSWORD_LEN); + printf("Enter a new password (must be at least %d characters) ", MIN_PASSWORD_LEN); while (valid_password == false) { len = password_prompt(user_password.pass, sizeof(user_password.pass)); @@ -473,12 +463,12 @@ static void first_time_encrypt(const char *msg) exit(0); if (string_is_empty(passconfirm) && (len < MIN_PASSWORD_LEN || len > MAX_PASSWORD_LEN)) { - printf(gettext("Password must be between %d and %d characters long. "), MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); + printf("Password must be between %d and %d characters long. ", MIN_PASSWORD_LEN, MAX_PASSWORD_LEN); continue; } if (string_is_empty(passconfirm)) { - printf(gettext("Enter password again ")); + printf("Enter password again "); snprintf(passconfirm, sizeof(passconfirm), "%s", user_password.pass); continue; } @@ -486,14 +476,14 @@ static void first_time_encrypt(const char *msg) if (strcmp(user_password.pass, passconfirm) != 0) { memset(passconfirm, 0, sizeof(passconfirm)); memset(user_password.pass, 0, sizeof(user_password.pass)); - printf(gettext("Passwords don't match. Try again. ")); + printf("Passwords don't match. Try again. "); continue; } valid_password = true; } - queue_init_message(gettext("Data file '%s' is encrypted"), DATA_FILE); + queue_init_message("Data file '%s' is encrypted", DATA_FILE); memset(passconfirm, 0, sizeof(passconfirm)); user_password.data_is_encrypted = true; } @@ -530,7 +520,7 @@ int store_data(Tox *m, const char *path) (uint8_t *) enc_data, &err); if (err != TOX_ERR_ENCRYPTION_OK) { - fprintf(stderr, gettext("tox_pass_encrypt() failed with error %d\n"), err); + fprintf(stderr, "tox_pass_encrypt() failed with error %d\n", err); fclose(fp); return -1; } @@ -581,7 +571,7 @@ static void init_tox_options(struct Tox_Options *tox_opts) tox_opts->proxy_type = arg_opts.proxy_type; if (!tox_opts->ipv6_enabled) - queue_init_message(gettext("Forcing IPv4 connection")); + queue_init_message("Forcing IPv4 connection"); if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { tox_opts->proxy_port = arg_opts.proxy_port; @@ -589,16 +579,16 @@ static void init_tox_options(struct Tox_Options *tox_opts) const char *ps = tox_opts->proxy_type == TOX_PROXY_TYPE_SOCKS5 ? "SOCKS5" : "HTTP"; char tmp[48]; - snprintf(tmp, sizeof(tmp), gettext("Using %s proxy %s : %d"), ps, arg_opts.proxy_address, arg_opts.proxy_port); + snprintf(tmp, sizeof(tmp), "Using %s proxy %s : %d", ps, arg_opts.proxy_address, arg_opts.proxy_port); queue_init_message("%s", tmp); } if (!tox_opts->udp_enabled) { - queue_init_message(gettext("UDP disabled")); + queue_init_message("UDP disabled"); } else if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { - const char *msg = gettext("WARNING: Using a proxy without disabling UDP may leak your real IP address."); + const char *msg = "WARNING: Using a proxy without disabling UDP may leak your real IP address."; queue_init_message("%s", msg); - msg = gettext("Use the -t option to disable UDP."); + msg = "Use the -t option to disable UDP."; queue_init_message("%s", msg); } } @@ -617,14 +607,14 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (len == 0) { fclose(fp); - exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); + exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); } char data[len]; if (fread(data, sizeof(data), 1, fp) != 1) { fclose(fp); - exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); + exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); } bool is_encrypted = tox_is_data_encrypted((uint8_t *) data); @@ -632,13 +622,13 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW /* attempt to encrypt an already encrypted data file */ if (arg_opts.encrypt_data && is_encrypted) { fclose(fp); - exit_toxic_err(gettext("failed in load_toxic"), FATALERR_ENCRYPT); + exit_toxic_err("failed in load_toxic", FATALERR_ENCRYPT); } if (arg_opts.unencrypt_data && is_encrypted) - queue_init_message(gettext("Data file '%s' has been unencrypted"), data_path); + queue_init_message("Data file '%s' has been unencrypted", data_path); else if (arg_opts.unencrypt_data) - queue_init_message(gettext("Warning: passed --unencrypt-data option with unencrypted data file '%s'"), data_path); + queue_init_message("Warning: passed --unencrypt-data option with unencrypted data file '%s'", data_path); if (is_encrypted) { if (!arg_opts.unencrypt_data) @@ -646,7 +636,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW size_t pwlen = 0; system("clear"); // TODO: is this portable? - printf(gettext("Enter password (\"%s\" to quit) "), "q"); + printf("Enter password (q to quit) "); size_t plain_len = len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH; char plain[plain_len]; @@ -663,7 +653,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW if (pwlen < MIN_PASSWORD_LEN) { system("clear"); sleep(1); - printf(gettext("Invalid password. Try again. ")); + printf("Invalid password. Try again. "); continue; } @@ -687,10 +677,10 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW } else if (pwerr == TOX_ERR_DECRYPTION_FAILED) { system("clear"); sleep(1); - printf(gettext("Invalid password. Try again. ")); + printf("Invalid password. Try again. "); } else { fclose(fp); - exit_toxic_err(gettext("tox_pass_decrypt() failed"), pwerr); + exit_toxic_err("tox_pass_decrypt() failed", pwerr); } } } else { /* data is not encrypted */ @@ -709,7 +699,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW fclose(fp); } else { /* Data file does not/should not exist */ if (file_exists(data_path)) - exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); + exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); tox_opts->savedata_type = TOX_SAVEDATA_TYPE_NONE; @@ -719,7 +709,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, TOX_ERR_NEW return NULL; if (store_data(m, data_path) == -1) - exit_toxic_err(gettext("failed in load_toxic"), FATALERR_FILEOP); + exit_toxic_err("failed in load_toxic", FATALERR_FILEOP); } return m; @@ -734,23 +724,23 @@ static Tox *load_toxic(char *data_path) Tox *m = load_tox(data_path, &tox_opts, &new_err); if (new_err == TOX_ERR_NEW_PORT_ALLOC && tox_opts.ipv6_enabled) { - queue_init_message(gettext("Falling back to ipv4")); + queue_init_message("Falling back to ipv4"); tox_opts.ipv6_enabled = false; m = load_tox(data_path, &tox_opts, &new_err); } if (!m) - exit_toxic_err(gettext("tox_new returned fatal error"), new_err); + exit_toxic_err("tox_new returned fatal error", new_err); if (new_err != TOX_ERR_NEW_OK) - queue_init_message(gettext("tox_new returned non-fatal error %d"), new_err); + queue_init_message("tox_new returned non-fatal error %d", new_err); init_tox_callbacks(m); load_friendlist(m); load_blocklist(BLOCK_FILE); if (tox_self_get_name_size(m) == 0) - tox_self_set_name(m, (uint8_t *) gettext("Toxic User"), strlen(gettext("Toxic User")), NULL); + tox_self_set_name(m, (uint8_t *) "Toxic User", strlen("Toxic User"), NULL); return m; } @@ -776,7 +766,7 @@ static void do_bootstrap(Tox *m) conn_err = init_connection(m); if (conn_err != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, gettext("Auto-connect failed with error code %d"), conn_err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Auto-connect failed with error code %d", conn_err); } static void do_toxic(Tox *m, ToxWindow *prompt) @@ -857,35 +847,21 @@ void *thread_audio(void *data) static void print_usage(void) { - fprintf(stderr, gettext("usage: toxic [OPTION] [FILE ...]\n")); - fprintf(stderr, " -4, --ipv4 "); - fprintf(stderr, gettext("Force IPv4 connection\n")); - fprintf(stderr, " -b, --debug "); - fprintf(stderr, gettext("Enable stderr for debugging\n")); - fprintf(stderr, " -c, --config "); - fprintf(stderr, gettext("Use specified config file\n")); - fprintf(stderr, " -d, --default-locale "); - fprintf(stderr, gettext("Use default POSIX locale\n")); - fprintf(stderr, " -e, --encrypt-data "); - fprintf(stderr, gettext("Encrypt an unencrypted data file\n")); - fprintf(stderr, " -f, --file "); - fprintf(stderr, gettext("Use specified data file\n")); - fprintf(stderr, " -h, --help "); - fprintf(stderr, gettext("Show this message and exit\n")); - fprintf(stderr, " -n, --nodes "); - fprintf(stderr, gettext("Use specified DHTnodes file\n")); - fprintf(stderr, " -o, --noconnect "); - fprintf(stderr, gettext("Do not connect to the DHT network\n")); - fprintf(stderr, " -p, --SOCKS5-proxy "); - fprintf(stderr, gettext("Use SOCKS5 proxy: Requires [IP] [port]\n")); - fprintf(stderr, " -P, --HTTP-proxy "); - fprintf(stderr, gettext("Use HTTP proxy: Requires [IP] [port]\n")); - fprintf(stderr, " -r, --dnslist "); - fprintf(stderr, gettext("Use specified DNSservers file\n")); - fprintf(stderr, " -t, --force-tcp "); - fprintf(stderr, gettext("Force TCP connection (use this with proxies)\n")); - fprintf(stderr, " -u, --unencrypt-data "); - fprintf(stderr, gettext("Unencrypt an encrypted data file\n")); + fprintf(stderr, "usage: toxic [OPTION] [FILE ...]\n"); + fprintf(stderr, " -4, --ipv4 Force IPv4 connection\n"); + fprintf(stderr, " -b, --debug Enable stderr for debugging\n"); + fprintf(stderr, " -c, --config Use specified config file\n"); + fprintf(stderr, " -d, --default-locale Use default POSIX locale\n"); + fprintf(stderr, " -e, --encrypt-data Encrypt an unencrypted data file\n"); + fprintf(stderr, " -f, --file Use specified data file\n"); + fprintf(stderr, " -h, --help Show this message and exit\n"); + fprintf(stderr, " -n, --nodes Use specified DHTnodes file\n"); + fprintf(stderr, " -o, --noconnect Do not connect to the DHT network\n"); + fprintf(stderr, " -p, --SOCKS5-proxy Use SOCKS5 proxy: Requires [IP] [port]\n"); + fprintf(stderr, " -P, --HTTP-proxy Use HTTP proxy: Requires [IP] [port]\n"); + fprintf(stderr, " -r, --dnslist Use specified DNSservers file\n"); + fprintf(stderr, " -t, --force-tcp Force TCP connection (use this with proxies)\n"); + fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n"); } static void set_default_opts(void) @@ -929,20 +905,20 @@ static void parse_args(int argc, char *argv[]) case 'b': arg_opts.debug = 1; - queue_init_message(gettext("stderr enabled")); + queue_init_message("stderr enabled"); break; case 'c': snprintf(arg_opts.config_path, sizeof(arg_opts.config_path), "%s", optarg); if (!file_exists(arg_opts.config_path)) - queue_init_message(gettext("Config file not found")); + queue_init_message("Config file not found"); break; case 'd': arg_opts.default_locale = 1; - queue_init_message(gettext("Using default POSIX locale")); + queue_init_message("Using default POSIX locale"); break; case 'e': @@ -955,12 +931,12 @@ static void parse_args(int argc, char *argv[]) BLOCK_FILE = malloc(strlen(optarg) + strlen("-blocklist") + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err(gettext("failed in parse_args"), FATALERR_MEMORY); + exit_toxic_err("failed in parse_args", FATALERR_MEMORY); strcpy(BLOCK_FILE, optarg); strcat(BLOCK_FILE, "-blocklist"); - queue_init_message(gettext("Using '%s' data file"), DATA_FILE); + queue_init_message("Using '%s' data file", DATA_FILE); break; @@ -968,13 +944,13 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.nodes_path, sizeof(arg_opts.nodes_path), "%s", optarg); if (!file_exists(arg_opts.nodes_path)) - queue_init_message(gettext("DHTnodes file not found")); + queue_init_message("DHTnodes file not found"); break; case 'o': arg_opts.no_connect = 1; - queue_init_message(gettext("DHT disabled")); + queue_init_message("DHT disabled"); break; case 'p': @@ -982,7 +958,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); + exit_toxic_err("Proxy error", FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -992,7 +968,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.proxy_address, sizeof(arg_opts.proxy_address), "%s", optarg); if (++optind > argc || argv[optind-1][0] == '-') - exit_toxic_err(gettext("Proxy error"), FATALERR_PROXY); + exit_toxic_err("Proxy error", FATALERR_PROXY); arg_opts.proxy_port = (uint16_t) atoi(argv[optind-1]); break; @@ -1001,7 +977,7 @@ static void parse_args(int argc, char *argv[]) snprintf(arg_opts.dns_path, sizeof(arg_opts.dns_path), "%s", optarg); if (!file_exists(arg_opts.dns_path)) - queue_init_message(gettext("DNSservers file not found")); + queue_init_message("DNSservers file not found"); break; @@ -1036,13 +1012,13 @@ static int init_default_data_files(void) BLOCK_FILE = strdup(BLOCKNAME); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); + exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); } else { DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(DATANAME) + 1); BLOCK_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen(BLOCKNAME) + 1); if (DATA_FILE == NULL || BLOCK_FILE == NULL) - exit_toxic_err(gettext("failed in load_data_structures"), FATALERR_MEMORY); + exit_toxic_err("failed in load_data_structures", FATALERR_MEMORY); strcpy(DATA_FILE, user_config_dir); strcat(DATA_FILE, CONFIGDIR); @@ -1098,7 +1074,7 @@ int main(int argc, char *argv[]) if (arg_opts.encrypt_data && arg_opts.unencrypt_data) { arg_opts.encrypt_data = 0; arg_opts.unencrypt_data = 0; - queue_init_message(gettext("Warning: Using \"%s\" and \"%s\" simultaneously has no effect"), "--unencrypt-data", "--encrypt-data"); + queue_init_message("Warning: Using --unencrypt-data and --encrypt-data simultaneously has no effect"); } /* Make sure all written files are read/writeable only by the current user. */ @@ -1111,23 +1087,23 @@ int main(int argc, char *argv[]) last_bootstrap_time = get_unix_time(); if (!datafile_exists && !arg_opts.unencrypt_data) - first_time_encrypt(gettext("Creating new data file. Would you like to encrypt it? Y/n (q to quit)")); + first_time_encrypt("Creating new data file. Would you like to encrypt it? Y/n (q to quit)"); else if (arg_opts.encrypt_data) - first_time_encrypt(gettext("Encrypt existing data file? Y/n (q to quit)")); + first_time_encrypt("Encrypt existing data file? Y/n (q to quit)"); /* init user_settings struct and load settings from conf file */ user_settings = calloc(1, sizeof(struct user_settings)); if (user_settings == NULL) - exit_toxic_err(gettext("failed in main"), FATALERR_MEMORY); + exit_toxic_err("failed in main", FATALERR_MEMORY); const char *p = arg_opts.config_path[0] ? arg_opts.config_path : NULL; int settings_err = settings_load(user_settings, p); #ifdef X11 if (init_xtra(DnD_callback) == -1) - queue_init_message(gettext("X failed to initialize")); + queue_init_message("X failed to initialize"); #endif Tox *m = load_toxic(DATA_FILE); @@ -1143,14 +1119,14 @@ int main(int argc, char *argv[]) /* thread for ncurses stuff */ if (pthread_mutex_init(&Winthread.lock, NULL) != 0) - exit_toxic_err(gettext("failed in main"), FATALERR_MUTEX_INIT); + exit_toxic_err("failed in main", FATALERR_MUTEX_INIT); if (pthread_create(&Winthread.tid, NULL, thread_winref, (void *) m) != 0) - exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); + exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); /* thread for message queue */ if (pthread_create(&cqueue_thread.tid, NULL, thread_cqueue, (void *) m) != 0) - exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); + exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); #ifdef AUDIO @@ -1158,14 +1134,14 @@ int main(int argc, char *argv[]) /* audio thread */ if (pthread_create(&audio_thread.tid, NULL, thread_audio, (void *) av) != 0) - exit_toxic_err(gettext("failed in main"), FATALERR_THREAD_CREATE); + exit_toxic_err("failed in main", FATALERR_THREAD_CREATE); set_primary_device(input, user_settings->audio_in_dev); set_primary_device(output, user_settings->audio_out_dev); #elif SOUND_NOTIFY if ( init_devices() == de_InternalError ) - queue_init_message(gettext("Failed to init audio devices")); + queue_init_message("Failed to init audio devices"); #endif /* AUDIO */ @@ -1174,16 +1150,16 @@ int main(int argc, char *argv[]) const char *msg; if (config_err) { - msg = gettext("Unable to determine configuration directory. Defaulting to 'data' for data file..."); + msg = "Unable to determine configuration directory. Defaulting to 'data' for data file..."; queue_init_message("%s", msg); } if (settings_err == -1) - queue_init_message(gettext("Failed to load user settings")); + queue_init_message("Failed to load user settings"); /* screen/tmux auto-away timer */ if (init_mplex_away_timer(m) == -1) - queue_init_message(gettext("Failed to init mplex auto-away.")); + queue_init_message("Failed to init mplex auto-away."); print_init_messages(prompt); cleanup_init_messages(); @@ -1206,7 +1182,7 @@ int main(int argc, char *argv[]) if (timed_out(last_save, cur_time, AUTOSAVE_FREQ)) { pthread_mutex_lock(&Winthread.lock); if (store_data(m, DATA_FILE) != 0) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, gettext("WARNING: Failed to save to data file")); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "WARNING: Failed to save to data file"); pthread_mutex_unlock(&Winthread.lock); last_save = cur_time; diff --git a/src/toxic.h b/src/toxic.h index 0adb759..6129fab 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -40,8 +40,8 @@ #include -#define UNKNOWN_NAME gettext("Anonymous") -#define DEFAULT_TOX_NAME gettext("Tox User") /* should always be the same as toxcore's default name */ +#define UNKNOWN_NAME "Anonymous" +#define DEFAULT_TOX_NAME "Tox User" /* should always be the same as toxcore's default name */ #define MAX_STR_SIZE TOX_MAX_MESSAGE_LENGTH /* must be >= TOX_MAX_MESSAGE_LENGTH */ #define MAX_CMDNAME_SIZE 64 diff --git a/src/windows.c b/src/windows.c index f50ff10..142bebc 100644 --- a/src/windows.c +++ b/src/windows.c @@ -25,12 +25,6 @@ #include #include -#ifdef NO_GETTEXT -#define gettext(A) (A) -#else -#include -#endif - #include "friendlist.h" #include "prompt.h" #include "toxic.h" @@ -365,7 +359,7 @@ void set_next_window(int ch) return; if (active_window == inf) /* infinite loop check */ - exit_toxic_err(gettext("failed in set_next_window"), FATALERR_INFLOOP); + exit_toxic_err("failed in set_next_window", FATALERR_INFLOOP); } } @@ -387,7 +381,7 @@ ToxWindow *init_windows(Tox *m) int n_prompt = add_window(m, new_prompt()); if (n_prompt == -1 || add_window(m, new_friendlist()) == -1) - exit_toxic_err(gettext("failed in init_windows"), FATALERR_WININIT); + exit_toxic_err("failed in init_windows", FATALERR_WININIT); prompt = &windows[n_prompt]; active_window = prompt; diff --git a/translations/en.mo b/translations/en.mo deleted file mode 100644 index bc070ff8f499dac6ad89c8dcc545ca7de6f7f1a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28646 zcmeI4dz_qAdB^`~%jU9Kb~iUeSY~J5-5oMB?=bJo zZWiTIES0LLwV+Z_xoNFclvY}+R#2;QsYs<2ts_7c$ z=EK?Vd#>*}&w0*sF7F9HIPvgXJbsx&JnwXP(b1mw6wjBQtWeMU&KaIJ1%4ME4}T1o z!(YRdaQ>N|w+ZIp7Wi3s9z60a&zlKXz!`9-^OxW`_-}#@@H3ECdiOg%0#C*N1UwP` z0#1jA`L>)HQ1w{?kAW+o%Gv1r+nj#@oaQk* zatd4wr578a+M9ur!w8i8-UWN%-B9U%3#qbq;v6fd^PtMK{V&>pP+H-3^a~UxGBjdl0JqFG3$qn``C26e|5H zsCMje{t@T@bExt^0e$!gR5>p|jgu43wfW~m=|v}0zg-U1uIpUBo~$?fD(- zhG)cFt z-sboTsP})t`M(7bo%bWC@{eC)*$9utzZfe0D(Bzsn1Sk-5|rM2$c2Bw@nLu(;opI( z&+|~_Peb_PY^eTN2BkOKp!Bu`r^1_{#@lUB^0*V~J)eil|6Qnd{S>O7{|CzME?s8J z4dF@n-v!l=cSAGYpwhhv)xNn5R+YCLO3yby)nf=Y!0Vy<=O!q5z89)JA9H*Rs^5MK zRlk##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c?%aWTu8!}9`<5-)j`wgW?M_2u6X5AEQ`3v!e_=j*B^AIz<$qN z`^YqG*6AkAZs`kB`8MV(wijDEx2&x-Xb}x*$JR4#v}ieqfEa`eiaAUUyHLJzq5UgX z_qKO-*3!AlWi4wt1=Sv;%|CyDHF|fB1zWCV9fvCHmI_7VjaDqakeeZjSI~84D#Uj@)ZPvco)-P=`>)QRl=HmLL zO?~gL-O8+A+Dx3Mn8U#OrOo=K&HANH?L_LAHaP;&Sxx+vJ#kIZ1lKQZx_{!OBM*J1 z8Fv`5u67iwPbxYQ;c8JeuzqPXzJ*u6w5flAs3YO}rA_k*+1^`Pr|-}4cQbRwXg;DG z;HsiN&6{|8&{f+2*b+JUtY6x!U)t2a8P;KU{J~rrQ@^xnu9ej " -msgstr "Require: " - -#: ../src/global_commands.c:261 -msgid "Invalid port." -msgstr "Invalid port." - -#: ../src/global_commands.c:274 -msgid "Bootstrap failed: Invalid IP." -msgstr "Bootstrap failed: Invalid IP." - -#: ../src/global_commands.c:278 -msgid "Bootstrap failed: Invalid port." -msgstr "Bootstrap failed: Invalid port." - -#: ../src/global_commands.c:282 -msgid "Bootstrap failed." -msgstr "Bootstrap failed." - -#: ../src/global_commands.c:329 -#, c-format -msgid "Please specify group type: %s" -msgstr "Please specify group type: %s" - -#: ../src/global_commands.c:340 -#, c-format -msgid "Valid group types are: %s" -msgstr "Valid group types are: %s" - -#: ../src/global_commands.c:364 -#, c-format -msgid "Group chat [%d] created." -msgstr "Group chat [%d] created." - -#: ../src/global_commands.c:374 -msgid "Logging for this window is ON. Type \"/log off\" to disable." -msgstr "Logging for this window is ON. Type \"/log off\" to disable." - -#: ../src/global_commands.c:376 -msgid "Logging for this window is OFF. Type \"/log on\" to enable." -msgstr "Logging for this window is OFF. Type \"/log on\" to enable." - -#: ../src/global_commands.c:397 -msgid "Logging enabled" -msgstr "Logging enabled" - -#: ../src/global_commands.c:406 -msgid "Logging disabled" -msgstr "Logging disabled" - -#: ../src/global_commands.c:411 -#, c-format -msgid "Invalid option. Use \"%s\" to toggle logging." -msgstr "Invalid option. Use \"%s\" to toggle logging." - -#: ../src/global_commands.c:435 ../src/global_commands.c:468 -msgid "Input required." -msgstr "Input required." - -#: ../src/global_commands.c:452 -msgid "Invalid name." -msgstr "Invalid name." - -#: ../src/global_commands.c:473 ../src/global_commands.c:561 -msgid "Note must be enclosed in quotes." -msgstr "Note must be enclosed in quotes." - -#: ../src/global_commands.c:499 -msgid "No pending friend requests." -msgstr "No pending friend requests." - -#: ../src/global_commands.c:536 -#, c-format -msgid "Require a status. Statuses are: %s." -msgstr "Require a status. Statuses are: %s." - -#: ../src/global_commands.c:551 -#, c-format -msgid "Invalid status. Valid statuses are: %s." -msgstr "Invalid status. Valid statuses are: %s." - -#: ../src/groupchat.c:143 -msgid "failed in init_groupchat_win" -msgstr "failed in init_groupchat_win" - -#: ../src/groupchat.c:151 -#, c-format -msgid "Group Audio failed to init\n" -msgstr "Group Audio failed to init\n" - -#: ../src/groupchat.c:337 ../src/group_commands.c:80 -#, c-format -msgid " set the group title to: %s" -msgstr " set the group title to: %s" - -#: ../src/groupchat.c:340 ../src/group_commands.c:83 -#, c-format -msgid "set title to %s" -msgstr "set title to %s" - -#: ../src/groupchat.c:362 -msgid "failed in copy_peernames" -msgstr "failed in copy_peernames" - -#: ../src/groupchat.c:419 -msgid "has joined the room" -msgstr "has joined the room" - -#: ../src/groupchat.c:517 -msgid "has left the room" -msgstr "has left the room" - -#: ../src/groupchat.c:534 -msgid " is now known as " -msgstr " is now known as " - -#: ../src/groupchat.c:538 -#, c-format -msgid "is now known as %s" -msgstr "is now known as %s" - -#: ../src/groupchat.c:549 -msgid "Invalid syntax.\n" -msgstr "Invalid syntax.\n" - -#: ../src/groupchat.c:554 -msgid " * Failed to send action." -msgstr " * Failed to send action." - -#: ../src/groupchat.c:641 -msgid " * Failed to send message." -msgstr " * Failed to send message." - -#: ../src/groupchat.c:681 -#, c-format -msgid "Peers: %d\n" -msgstr "Peers: %d\n" - -#: ../src/groupchat.c:731 -msgid "failed in groupchat_onInit" -msgstr "failed in groupchat_onInit" - -#: ../src/groupchat.c:816 -#, c-format -msgid "source: %d, queued: %d, processed: %d\n" -msgstr "source: %d, queued: %d, processed: %d\n" - -#: ../src/groupchat.c:855 -#, c-format -msgid "dvhandle is null)\n" -msgstr "dvhandle is null)\n" - -#: ../src/groupchat.c:858 -#, c-format -msgid "ctx is null\n" -msgstr "ctx is null\n" - -#: ../src/groupchat.c:861 -#, c-format -msgid "write: %d\n" -msgstr "write: %d\n" - -#: ../src/groupchat.c:885 -#, c-format -msgid "Group %d" -msgstr "Group %d" - -#: ../src/groupchat.c:891 -msgid "failed in new_group_chat" -msgstr "failed in new_group_chat" - -#: ../src/group_commands.c:46 -#, c-format -msgid "Title is set to: %s" -msgstr "Title is set to: %s" - -#: ../src/group_commands.c:48 -msgid "Title is not set" -msgstr "Title is not set" - -#: ../src/group_commands.c:55 -msgid "Title must be enclosed in quotes." -msgstr "Title must be enclosed in quotes." - -#: ../src/group_commands.c:65 -msgid "Failed to set title." -msgstr "Failed to set title." - -#: ../src/help.c:148 -msgid "Global Commands:\n" -msgstr "Global Commands:\n" - -#: ../src/help.c:152 -msgid "Add contact with optional message\n" -msgstr "Add contact with optional message\n" - -#: ../src/help.c:154 -msgid "Accept friend request\n" -msgstr "Accept friend request\n" - -#: ../src/help.c:156 -msgid "Set an avatar (leave path empty to unset)\n" -msgstr "Set an avatar (leave path empty to unset)\n" - -#: ../src/help.c:158 -msgid "Decline friend request\n" -msgstr "Decline friend request\n" - -#: ../src/help.c:160 -msgid "List pending friend requests\n" -msgstr "List pending friend requests\n" - -#: ../src/help.c:162 -msgid "Manually connect to a DHT node\n" -msgstr "Manually connect to a DHT node\n" - -#: ../src/help.c:164 -msgid "Set status with optional note\n" -msgstr "Set status with optional note\n" - -#: ../src/help.c:166 -msgid "Set a personal note\n" -msgstr "Set a personal note\n" - -#: ../src/help.c:168 -msgid "Set your nickname\n" -msgstr "Set your nickname\n" - -#: ../src/help.c:170 -msgid "Enable/disable logging\n" -msgstr "Enable/disable logging\n" - -#: ../src/help.c:172 -msgid "Create a group chat where type: text | audio\n" -msgstr "Create a group chat where type: text | audio\n" - -#: ../src/help.c:174 -msgid "Print your Tox ID\n" -msgstr "Print your Tox ID\n" - -#: ../src/help.c:176 -msgid "Clear window history\n" -msgstr "Clear window history\n" - -#: ../src/help.c:178 -msgid "Close the current chat window\n" -msgstr "Close the current chat window\n" - -#: ../src/help.c:180 -msgid "Exit Toxic\n" -msgstr "Exit Toxic\n" - -#: ../src/help.c:184 ../src/help.c:224 -msgid "" -"\n" -" Audio:\n" -msgstr "" -"\n" -" Audio:\n" - -#: ../src/help.c:188 -msgid "List devices where type:" -msgstr "List devices where type:" - -#: ../src/help.c:191 -msgid "Set active device\n" -msgstr "Set active device\n" - -#: ../src/help.c:207 -msgid "Chat Commands:\n" -msgstr "Chat Commands:\n" - -#: ../src/help.c:211 -msgid "Invite contact to a group chat\n" -msgstr "Invite contact to a group chat\n" - -#: ../src/help.c:213 -msgid "Join a pending group chat\n" -msgstr "Join a pending group chat\n" - -#: ../src/help.c:215 -msgid "Send a file\n" -msgstr "Send a file\n" - -#: ../src/help.c:217 -msgid "Receive a file\n" -msgstr "Receive a file\n" - -#: ../src/help.c:219 -msgid "Cancel file transfer where type:" -msgstr "Cancel file transfer where type:" - -#: ../src/help.c:228 -msgid "Audio call\n" -msgstr "Audio call\n" - -#: ../src/help.c:230 -msgid "Answer incoming call\n" -msgstr "Answer incoming call\n" - -#: ../src/help.c:232 -msgid "Reject incoming call\n" -msgstr "Reject incoming call\n" - -#: ../src/help.c:234 -msgid "Hangup active call\n" -msgstr "Hangup active call\n" - -#: ../src/help.c:236 -msgid "Change active device\n" -msgstr "Change active device\n" - -#: ../src/help.c:238 -msgid "Mute active device if in call\n" -msgstr "Mute active device if in call\n" - -#: ../src/help.c:240 -msgid "VAD sensitivity threshold\n" -msgstr "VAD sensitivity threshold\n" - -#: ../src/help.c:256 -msgid "Key bindings:\n" -msgstr "Key bindings:\n" - -#: ../src/help.c:260 -msgid "Navigate through the tabs\n" -msgstr "Navigate through the tabs\n" - -#: ../src/help.c:262 -msgid "Scroll window history one line\n" -msgstr "Scroll window history one line\n" - -#: ../src/help.c:264 -msgid "Scroll window history half a page\n" -msgstr "Scroll window history half a page\n" - -#: ../src/help.c:266 -msgid "Move to the bottom of window history\n" -msgstr "Move to the bottom of window history\n" - -#: ../src/help.c:268 -msgid "Scroll peer list in groupchats\n" -msgstr "Scroll peer list in groupchats\n" - -#: ../src/help.c:270 -msgid "" -"Toggle the groupchat peerlist\n" -"\n" -msgstr "" -"Toggle the groupchat peerlist\n" -"\n" - -#: ../src/help.c:271 -msgid "" -" (Note: Custom keybindings override these defaults.)\n" -"\n" -msgstr "" -" (Note: Custom keybindings override these defaults.)\n" -"\n" - -#: ../src/help.c:286 -msgid "Group commands:\n" -msgstr "Group commands:\n" - -#: ../src/help.c:290 -msgid "" -"Set group title (show current title if no msg)\n" -"\n" -msgstr "" -"Set group title (show current title if no msg)\n" -"\n" - -#: ../src/help.c:305 -msgid "Friendlist controls:\n" -msgstr "Friendlist controls:\n" - -#: ../src/help.c:308 -msgid " Up and Down arrows : Scroll through list\n" -msgstr " Up and Down arrows : Scroll through list\n" - -#: ../src/help.c:309 -msgid "" -" Right and Left arrows : Switch between friendlist and blocked " -"list\n" -msgstr "" -" Right and Left arrows : Switch between friendlist and blocked " -"list\n" - -#: ../src/help.c:310 -msgid "" -" Enter : Open a chat window with selected contact\n" -msgstr "" -" Enter : Open a chat window with selected contact\n" - -#: ../src/help.c:311 -msgid " Delete : Permanently delete a contact\n" -msgstr " Delete : Permanently delete a contact\n" - -#: ../src/help.c:313 -msgid "Block or unblock a contact\n" -msgstr "Block or unblock a contact\n" - -#: ../src/line_info.c:50 -msgid "failed in line_info_init" -msgstr "failed in line_info_init" - -#: ../src/line_info.c:150 -msgid "failed in line_info_add" -msgstr "failed in line_info_add" - -#: ../src/log.c:189 -msgid "failed in load_chat_history" -msgstr "failed in load_chat_history" - -#: ../src/log.c:193 ../src/log.c:199 -msgid " * Failed to read log file" -msgstr " * Failed to read log file" - -#: ../src/message_queue.c:56 -msgid "failed in cqueue_message" -msgstr "failed in cqueue_message" - -#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 -msgid "failed in get_file_name" -msgstr "failed in get_file_name" - -#: ../src/prompt.c:139 -#, c-format -msgid "Failed to set note (error %d)\n" -msgstr "Failed to set note (error %d)\n" - -#: ../src/prompt.c:274 -msgid "ERROR" -msgstr "ERROR" - -#: ../src/prompt.c:278 -msgid "Online" -msgstr "Online" - -#: ../src/prompt.c:282 -msgid "Away" -msgstr "Away" - -#: ../src/prompt.c:286 -msgid "Busy" -msgstr "Busy" - -#: ../src/prompt.c:299 -msgid " [Offline]" -msgstr " [Offline]" - -#: ../src/prompt.c:369 ../src/prompt.c:372 -#, c-format -msgid "%s has come online" -msgstr "%s has come online" - -#: ../src/prompt.c:381 ../src/prompt.c:384 -#, c-format -msgid "%s has gone offline" -msgstr "%s has gone offline" - -#: ../src/prompt.c:395 ../src/prompt.c:396 -#, c-format -msgid "Friend request with the message '%s'" -msgstr "Friend request with the message '%s'" - -#: ../src/prompt.c:401 -msgid "Friend request queue is full. Discarding request." -msgstr "Friend request queue is full. Discarding request." - -#: ../src/prompt.c:406 -#, c-format -msgid "Type \"%s %d\" or \"%s %d\"" -msgstr "Type \"%s %d\" or \"%s %d\"" - -#: ../src/prompt.c:435 ../src/prompt.c:436 -#, c-format -msgid "Toxing on Toxic" -msgstr "Toxing on Toxic" - -#: ../src/prompt.c:458 -msgid "" -"Welcome to Toxic, a free, open source Tox-based instant messenging client." -msgstr "" -"Welcome to Toxic, a free, open source Tox-based instant messenging client." - -#: ../src/prompt.c:460 -#, c-format -msgid "Type \"%s\" for assistance. Further help may be found via the man page." -msgstr "" -"Type \"%s\" for assistance. Further help may be found via the man page." - -#: ../src/prompt.c:479 -msgid "failed in prompt_onInit" -msgstr "failed in prompt_onInit" - -#: ../src/prompt.c:517 -msgid "failed in new_prompt" -msgstr "failed in new_prompt" - -#: ../src/toxic.c:112 -#, c-format -msgid "Caught SIGSEGV: Aborting toxic session.\n" -msgstr "Caught SIGSEGV: Aborting toxic session.\n" - -#: ../src/toxic.c:161 -#, c-format -msgid "Toxic session aborted with error code %d (%s)\n" -msgstr "Toxic session aborted with error code %d (%s)\n" - -#: ../src/toxic.c:171 -msgid "" -"Could not set your locale, please check your locale settings or disable " -"unicode support with the -d flag." -msgstr "" -"Could not set your locale, please check your locale settings or disable " -"unicode support with the -d flag." - -#: ../src/toxic.c:231 ../src/toxic.c:236 -msgid "Failed in queue_init_message" -msgstr "Failed in queue_init_message" - -#: ../src/toxic.c:328 -#, c-format -msgid "Failed to bootstrap %s:%d\n" -msgstr "Failed to bootstrap %s:%d\n" - -#: ../src/toxic.c:335 -#, c-format -msgid "Failed to add TCP relay %s:%d\n" -msgstr "Failed to add TCP relay %s:%d\n" - -#: ../src/toxic.c:466 -#, c-format -msgid "Enter a new password (must be at least %d characters) " -msgstr "Enter a new password (must be at least %d characters) " - -#: ../src/toxic.c:476 -#, c-format -msgid "Password must be between %d and %d characters long. " -msgstr "Password must be between %d and %d characters long. " - -#: ../src/toxic.c:481 -#, c-format -msgid "Enter password again " -msgstr "Enter password again " - -#: ../src/toxic.c:489 -#, c-format -msgid "Passwords don't match. Try again. " -msgstr "Passwords don't match. Try again. " - -#: ../src/toxic.c:496 -#, c-format -msgid "Data file '%s' is encrypted" -msgstr "Data file '%s' is encrypted" - -#: ../src/toxic.c:533 -#, c-format -msgid "tox_pass_encrypt() failed with error %d\n" -msgstr "tox_pass_encrypt() failed with error %d\n" - -#: ../src/toxic.c:584 -msgid "Forcing IPv4 connection" -msgstr "Forcing IPv4 connection" - -#: ../src/toxic.c:592 -#, c-format -msgid "Using %s proxy %s : %d" -msgstr "Using %s proxy %s : %d" - -#: ../src/toxic.c:597 -msgid "UDP disabled" -msgstr "UDP disabled" - -#: ../src/toxic.c:599 -msgid "" -"WARNING: Using a proxy without disabling UDP may leak your real IP address." -msgstr "" -"WARNING: Using a proxy without disabling UDP may leak your real IP address." - -#: ../src/toxic.c:601 -msgid "Use the -t option to disable UDP." -msgstr "Use the -t option to disable UDP." - -#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 -#: ../src/toxic.c:722 -msgid "failed in load_toxic" -msgstr "failed in load_toxic" - -#: ../src/toxic.c:639 -#, c-format -msgid "Data file '%s' has been unencrypted" -msgstr "Data file '%s' has been unencrypted" - -#: ../src/toxic.c:641 -#, c-format -msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" -msgstr "" -"Warning: passed --unencrypt-data option with unencrypted data file '%s'" - -#: ../src/toxic.c:649 -#, c-format -msgid "Enter password (\"%s\" to quit) " -msgstr "Enter password (\"%s\" to quit) " - -#: ../src/toxic.c:666 ../src/toxic.c:690 -#, c-format -msgid "Invalid password. Try again. " -msgstr "Invalid password. Try again. " - -#: ../src/toxic.c:693 -msgid "tox_pass_decrypt() failed" -msgstr "tox_pass_decrypt() failed" - -#: ../src/toxic.c:737 -msgid "Falling back to ipv4" -msgstr "Falling back to ipv4" - -#: ../src/toxic.c:743 -msgid "tox_new returned fatal error" -msgstr "tox_new returned fatal error" - -#: ../src/toxic.c:746 -#, c-format -msgid "tox_new returned non-fatal error %d" -msgstr "tox_new returned non-fatal error %d" - -#: ../src/toxic.c:753 -msgid "Toxic User" -msgstr "Toxic User" - -#: ../src/toxic.c:779 -#, c-format -msgid "Auto-connect failed with error code %d" -msgstr "Auto-connect failed with error code %d" - -#: ../src/toxic.c:860 -#, c-format -msgid "usage: toxic [OPTION] [FILE ...]\n" -msgstr "usage: toxic [OPTION] [FILE ...]\n" - -#: ../src/toxic.c:862 -#, c-format -msgid "Force IPv4 connection\n" -msgstr "Force IPv4 connection\n" - -#: ../src/toxic.c:864 -#, c-format -msgid "Enable stderr for debugging\n" -msgstr "Enable stderr for debugging\n" - -#: ../src/toxic.c:866 -#, c-format -msgid "Use specified config file\n" -msgstr "Use specified config file\n" - -#: ../src/toxic.c:868 -#, c-format -msgid "Use default POSIX locale\n" -msgstr "Use default POSIX locale\n" - -#: ../src/toxic.c:870 -#, c-format -msgid "Encrypt an unencrypted data file\n" -msgstr "Encrypt an unencrypted data file\n" - -#: ../src/toxic.c:872 -#, c-format -msgid "Use specified data file\n" -msgstr "Use specified data file\n" - -#: ../src/toxic.c:874 -#, c-format -msgid "Show this message and exit\n" -msgstr "Show this message and exit\n" - -#: ../src/toxic.c:876 -#, c-format -msgid "Use specified DHTnodes file\n" -msgstr "Use specified DHTnodes file\n" - -#: ../src/toxic.c:878 -#, c-format -msgid "Do not connect to the DHT network\n" -msgstr "Do not connect to the DHT network\n" - -#: ../src/toxic.c:880 -#, c-format -msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" -msgstr "Use SOCKS5 proxy: Requires [IP] [port]\n" - -#: ../src/toxic.c:882 -#, c-format -msgid "Use HTTP proxy: Requires [IP] [port]\n" -msgstr "Use HTTP proxy: Requires [IP] [port]\n" - -#: ../src/toxic.c:884 -#, c-format -msgid "Use specified DNSservers file\n" -msgstr "Use specified DNSservers file\n" - -#: ../src/toxic.c:886 -#, c-format -msgid "Force TCP connection (use this with proxies)\n" -msgstr "Force TCP connection (use this with proxies)\n" - -#: ../src/toxic.c:888 -#, c-format -msgid "Unencrypt an encrypted data file\n" -msgstr "Unencrypt an encrypted data file\n" - -#: ../src/toxic.c:932 -msgid "stderr enabled" -msgstr "stderr enabled" - -#: ../src/toxic.c:939 -msgid "Config file not found" -msgstr "Config file not found" - -#: ../src/toxic.c:945 -msgid "Using default POSIX locale" -msgstr "Using default POSIX locale" - -#: ../src/toxic.c:958 -msgid "failed in parse_args" -msgstr "failed in parse_args" - -#: ../src/toxic.c:963 -#, c-format -msgid "Using '%s' data file" -msgstr "Using '%s' data file" - -#: ../src/toxic.c:971 -msgid "DHTnodes file not found" -msgstr "DHTnodes file not found" - -#: ../src/toxic.c:977 -msgid "DHT disabled" -msgstr "DHT disabled" - -#: ../src/toxic.c:985 ../src/toxic.c:995 -msgid "Proxy error" -msgstr "Proxy error" - -#: ../src/toxic.c:1004 -msgid "DNSservers file not found" -msgstr "DNSservers file not found" - -#: ../src/toxic.c:1101 -#, c-format -msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" -msgstr "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" - -#: ../src/toxic.c:1114 -msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" -msgstr "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" - -#: ../src/toxic.c:1116 -msgid "Encrypt existing data file? Y/n (q to quit)" -msgstr "Encrypt existing data file? Y/n (q to quit)" - -#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 -#: ../src/toxic.c:1153 ../src/toxic.c:1161 -msgid "failed in main" -msgstr "failed in main" - -#: ../src/toxic.c:1130 -msgid "X failed to initialize" -msgstr "X failed to initialize" - -#: ../src/toxic.c:1168 -msgid "Failed to init audio devices" -msgstr "Failed to init audio devices" - -#: ../src/toxic.c:1177 -msgid "" -"Unable to determine configuration directory. Defaulting to 'data' for data " -"file..." -msgstr "" -"Unable to determine configuration directory. Defaulting to 'data' for data " -"file..." - -#: ../src/toxic.c:1182 -msgid "Failed to load user settings" -msgstr "Failed to load user settings" - -#: ../src/toxic.c:1186 -msgid "Failed to init mplex auto-away." -msgstr "Failed to init mplex auto-away." - -#: ../src/toxic.c:1209 -msgid "WARNING: Failed to save to data file" -msgstr "WARNING: Failed to save to data file" - -#: ../src/toxic.h:43 -msgid "Anonymous" -msgstr "Anonymous" - -#: ../src/toxic.h:44 -msgid "Tox User" -msgstr "Tox User" - -#: ../src/windows.c:368 -msgid "failed in set_next_window" -msgstr "failed in set_next_window" - -#: ../src/windows.c:390 -msgid "failed in init_windows" -msgstr "failed in init_windows" diff --git a/translations/it.mo b/translations/it.mo deleted file mode 100644 index a7aaff16b0085e79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VJdcLHN7WKpNxg?)+e)+wIsp^HTuK^ z87~j(vsS&}OdCD6Ttl~?LJ-)3S>!_$zoC#7li#CVb!ymMj_LjHp~LIaJ+yhTsjI#2 z!e*%i<||n(fvWtb4!Loqj@*l|wT-P0fhXZCwI+ z{ErZe&x@Z?bmSC2q$p=$8u=?s)-r~rtkTC6<(!VsDN31gKg%Cf%+Ge8RFpFEk0HgIcDd#b#-xFy*z1NF@{cmgGTm)SX1BY#X|KHLSgvY6 z&FE;Lg4K&3YUFP(ZByHhF7&0wVigd9Zp|Q{M6k)N2}h?o z5i#FpgqC=Vm6NWvWucxeu2p;f4M*02LT2_EN0uqon!eh8$e}aN>1Q0qKDzHX>}MSM OOaNQsrhNZ " -msgstr "Richiede: " - -#: ../src/global_commands.c:261 -msgid "Invalid port." -msgstr "Porta non valida." - -#: ../src/global_commands.c:274 -msgid "Bootstrap failed: Invalid IP." -msgstr "Bootstrap fallito: IP non valido." - -#: ../src/global_commands.c:278 -msgid "Bootstrap failed: Invalid port." -msgstr "Bootstrap fallito: porta non valida." - -#: ../src/global_commands.c:282 -msgid "Bootstrap failed." -msgstr "Bootstrap fallito." - -#: ../src/global_commands.c:329 -#, c-format -msgid "Please specify group type: %s" -msgstr "Specifica il tipo di chat di gruppo: %s" - -#: ../src/global_commands.c:340 -#, c-format -msgid "Valid group types are: %s" -msgstr "I tipi di chat di gruppo permessi sono: %s" - -#: ../src/global_commands.c:364 -#, c-format -msgid "Group chat [%d] created." -msgstr "Chat di gruppo [%d] creata." - -#: ../src/global_commands.c:374 -msgid "Logging for this window is ON. Type \"/log off\" to disable." -msgstr "" -"La cronologia chat per questa finestra è ON. Usa \"/log off\" per " -"disabilitarla." - -#: ../src/global_commands.c:376 -msgid "Logging for this window is OFF. Type \"/log on\" to enable." -msgstr "" -"La cronologia chat per questa finestra è OFF. Usa \"/log on\" per abilitarla." - -#: ../src/global_commands.c:397 -msgid "Logging enabled" -msgstr "Cronologia chat abilitata" - -#: ../src/global_commands.c:406 -msgid "Logging disabled" -msgstr "Cronologia chat disabilitata" - -#: ../src/global_commands.c:411 -#, c-format -msgid "Invalid option. Use \"%s\" to toggle logging." -msgstr "Opzione non valida. Usa \"%s\" per impostare la cronologia chat." - -#: ../src/global_commands.c:435 ../src/global_commands.c:468 -msgid "Input required." -msgstr "Input richiesto." - -#: ../src/global_commands.c:452 -msgid "Invalid name." -msgstr "Nome non valido." - -#: ../src/global_commands.c:473 ../src/global_commands.c:561 -msgid "Note must be enclosed in quotes." -msgstr "Il messaggio di stato deve essere tra virgolette." - -#: ../src/global_commands.c:499 -msgid "No pending friend requests." -msgstr "Nessuna richiesta d'amicizia in sospeso." - -#: ../src/global_commands.c:536 -#, c-format -msgid "Require a status. Statuses are: %s." -msgstr "Richiede uno stato. Gli stati sono: %s." - -#: ../src/global_commands.c:551 -#, c-format -msgid "Invalid status. Valid statuses are: %s." -msgstr "Stato non valido. Gli stati disponibilit sono: %s." - -#: ../src/group_commands.c:46 -#, c-format -msgid "Title is set to: %s" -msgstr "Titolo impostato a: \"%s\"" - -#: ../src/group_commands.c:48 -msgid "Title is not set" -msgstr "Titolo non impostato" - -#: ../src/group_commands.c:55 -msgid "Title must be enclosed in quotes." -msgstr "Il titolo deve essere tra virgolette." - -#: ../src/group_commands.c:65 -msgid "Failed to set title." -msgstr "Errore nell'impostare il titolo." - -#: ../src/group_commands.c:80 ../src/groupchat.c:337 -#, c-format -msgid " set the group title to: %s" -msgstr " ha impostato il titolo a: \"%s\"" - -#: ../src/group_commands.c:83 ../src/groupchat.c:340 -#, c-format -msgid "set title to %s" -msgstr "ha impostato il titolo a \"%s\"" - -#: ../src/groupchat.c:143 -msgid "failed in init_groupchat_win" -msgstr "errore in \"init_groupchat_win\"" - -#: ../src/groupchat.c:151 -#, c-format -msgid "Group Audio failed to init\n" -msgstr "Inizializzazione fallita delle chat di gruppo audio\n" - -#: ../src/groupchat.c:362 -msgid "failed in copy_peernames" -msgstr "errore in \"copy_peernames\"" - -#: ../src/groupchat.c:419 -msgid "has joined the room" -msgstr "è entrato nella chat" - -#: ../src/groupchat.c:517 -msgid "has left the room" -msgstr "ha lasciato la chat" - -#: ../src/groupchat.c:534 -msgid " is now known as " -msgstr " è ora conosciuto come " - -#: ../src/groupchat.c:538 -#, c-format -msgid "is now known as %s" -msgstr "è ora conosciuto come %s" - -#: ../src/groupchat.c:549 -msgid "Invalid syntax.\n" -msgstr "Sintassi non valida.\n" - -#: ../src/groupchat.c:554 -msgid " * Failed to send action." -msgstr " * Errore nell'inviare l'azione." - -#: ../src/groupchat.c:641 -msgid " * Failed to send message." -msgstr " * Errore nell'inviare il messaggio." - -#: ../src/groupchat.c:678 -#, c-format -msgid "Peers: %d\n" -msgstr "Utenti: %d\n" - -#: ../src/groupchat.c:728 -msgid "failed in groupchat_onInit" -msgstr "errore in \"groupchat_onInit\"" - -#: ../src/groupchat.c:813 -#, c-format -msgid "source: %d, queued: %d, processed: %d\n" -msgstr "sorgente: %d, coda: %d, processati: %d\n" - -#: ../src/groupchat.c:852 -#, c-format -msgid "dvhandle is null)\n" -msgstr "\"dvhandle\" è null)\n" - -#: ../src/groupchat.c:855 -#, c-format -msgid "ctx is null\n" -msgstr "\"ctx\" è null\n" - -#: ../src/groupchat.c:858 -#, c-format -msgid "write: %d\n" -msgstr "scritto: %d\n" - -#: ../src/groupchat.c:882 -#, c-format -msgid "Group %d" -msgstr "Chat di gruppo %d" - -#: ../src/groupchat.c:888 -msgid "failed in new_group_chat" -msgstr "errore in \"new_group_chat\"" - -#: ../src/help.c:148 -msgid "Global Commands:\n" -msgstr "Comandi Globali:\n" - -#: ../src/help.c:152 -msgid "Add contact with optional message\n" -msgstr "Aggiungi contatto con un messaggio opzionale\n" - -#: ../src/help.c:154 -msgid "Accept friend request\n" -msgstr "Accetta richiesta d'amicizia\n" - -#: ../src/help.c:156 -msgid "Set an avatar (leave path empty to unset)\n" -msgstr "Imposta un avatar (lascia vuoto per resettare)\n" - -#: ../src/help.c:158 -msgid "Decline friend request\n" -msgstr "Rifiuta richiesta d'amicizia\n" - -#: ../src/help.c:160 -msgid "List pending friend requests\n" -msgstr "Mostra le richieste d'amicizia in sospeso\n" - -#: ../src/help.c:162 -msgid "Manually connect to a DHT node\n" -msgstr "Connettiti manualmente ad un nodo DHT\n" - -#: ../src/help.c:164 -msgid "Set status with optional note\n" -msgstr "Imposta lo stato con un messaggio opzionale\n" - -#: ../src/help.c:166 -msgid "Set a personal note\n" -msgstr "Imposta il messaggio di stato\n" - -#: ../src/help.c:168 -msgid "Set your nickname\n" -msgstr "Imposta il nickname\n" - -#: ../src/help.c:170 -msgid "Enable/disable logging\n" -msgstr "Abilita/disabilita cronologia chat\n" - -#: ../src/help.c:172 -msgid "Create a group chat where type: text | audio\n" -msgstr "Crea una caht di gruppo di tipo: text|audio\n" - -#: ../src/help.c:174 -msgid "Print your Tox ID\n" -msgstr "Mostra il tuo Tox ID\n" - -#: ../src/help.c:176 -msgid "Clear window history\n" -msgstr "Pulisce la cronologia della finestra\n" - -#: ../src/help.c:178 -msgid "Close the current chat window\n" -msgstr "Chiude la fiestra di chat corrente\n" - -#: ../src/help.c:180 -msgid "Exit Toxic\n" -msgstr "Esce da Toxic\n" - -#: ../src/help.c:184 ../src/help.c:224 -msgid "" -"\n" -" Audio:\n" -msgstr "" -"\n" -" Audio:\n" - -#: ../src/help.c:188 -msgid "List devices where type:" -msgstr "Mostra i dispositivi di tipo:" - -#: ../src/help.c:191 -msgid "Set active device\n" -msgstr "Imposta il device attivo\n" - -#: ../src/help.c:207 -msgid "Chat Commands:\n" -msgstr "Comandi Chat:\n" - -#: ../src/help.c:211 -msgid "Invite contact to a group chat\n" -msgstr "Invita un contatto ad una chat di gruppo\n" - -#: ../src/help.c:213 -msgid "Join a pending group chat\n" -msgstr "Unisciti ad una chat di gruppo a cui sei stato invitato\n" - -#: ../src/help.c:215 -msgid "Send a file\n" -msgstr "Invia un file\n" - -#: ../src/help.c:217 -msgid "Receive a file\n" -msgstr "Accetta la ricezione di un file\n" - -#: ../src/help.c:219 -msgid "Cancel file transfer where type:" -msgstr "Annulla trasferimento file di tipo:" - -#: ../src/help.c:228 -msgid "Audio call\n" -msgstr "Chiamata audio\n" - -#: ../src/help.c:230 -msgid "Answer incoming call\n" -msgstr "Rispondi ad una chiamata\n" - -#: ../src/help.c:232 -msgid "Reject incoming call\n" -msgstr "Rifiuta una chiamata\n" - -#: ../src/help.c:234 -msgid "Hangup active call\n" -msgstr "Termina una chiamata attiva\n" - -#: ../src/help.c:236 -msgid "Change active device\n" -msgstr "Cambia il dispositivo attivo\n" - -#: ../src/help.c:238 -msgid "Mute active device if in call\n" -msgstr "Disabilita il dispositivo attivo mentre sei in una chiamata\n" - -#: ../src/help.c:240 -msgid "VAD sensitivity threshold\n" -msgstr "Sensibilità VAD\n" - -#: ../src/help.c:256 -msgid "Key bindings:\n" -msgstr "Mappatura tasti:\n" - -#: ../src/help.c:260 -msgid "Navigate through the tabs\n" -msgstr "Naviga tra le schede\n" - -#: ../src/help.c:262 -msgid "Scroll window history one line\n" -msgstr "Scorri la cronologia della finestra di una riga\n" - -#: ../src/help.c:264 -msgid "Scroll window history half a page\n" -msgstr "Scorri la cronologia della finestra di metà pagina\n" - -#: ../src/help.c:266 -msgid "Move to the bottom of window history\n" -msgstr "Vai in fondo alla finestra\n" - -#: ../src/help.c:268 -msgid "Scroll peer list in groupchats\n" -msgstr "Scorre la lista utenti nelle chat di gruppo\n" - -#: ../src/help.c:270 -msgid "" -"Toggle the groupchat peerlist\n" -"\n" -msgstr "" -"Mostra/nasconde la lista degli utenti nelle chat di gruppo\n" -"\n" - -#: ../src/help.c:271 -msgid "" -" (Note: Custom keybindings override these defaults.)\n" -"\n" -msgstr "" -" (Nota: mappature personalizzate sovrascrivono i defaults.)\n" -"\n" - -#: ../src/help.c:286 -msgid "Group commands:\n" -msgstr "Comandi chat di gruppo:\n" - -#: ../src/help.c:290 -msgid "" -"Set group title (show current title if no msg)\n" -"\n" -msgstr "" -"Imposta il titolo (mostra il titolo corrente se non è specificato niente)\n" -"\n" - -#: ../src/help.c:305 -msgid "Friendlist controls:\n" -msgstr "Controllo lista contatti:\n" - -#: ../src/help.c:308 -msgid " Up and Down arrows : Scroll through list\n" -msgstr " Frecce Su e Giù : Scorri la lista\n" - -#: ../src/help.c:309 -msgid "" -" Right and Left arrows : Switch between friendlist and blocked " -"list\n" -msgstr "" -" Frecce Destra e Sinistra : Cambia tra lista contatti e lista " -"bloccati\n" - -#: ../src/help.c:310 -msgid "" -" Enter : Open a chat window with selected contact\n" -msgstr "" -" Invio : Apre una finestra di chat con il contatto " -"selezionato\n" - -#: ../src/help.c:311 -msgid " Delete : Permanently delete a contact\n" -msgstr "" -" Canc : Elimina un contatto definitivamente\n" - -#: ../src/help.c:313 -msgid "Block or unblock a contact\n" -msgstr "Blocca o sblocca un contatto\n" - -#: ../src/line_info.c:50 -msgid "failed in line_info_init" -msgstr "errore in \"line_info_init\"" - -#: ../src/line_info.c:150 -msgid "failed in line_info_add" -msgstr "errore in \"line_info_add\"" - -#: ../src/log.c:189 -msgid "failed in load_chat_history" -msgstr "errore in \"load_chat_history\"" - -#: ../src/log.c:193 ../src/log.c:199 -msgid " * Failed to read log file" -msgstr " * Errore nel leggere il file della cronologia chat" - -#: ../src/message_queue.c:56 -msgid "failed in cqueue_message" -msgstr "errore in \"cqueue_message\"" - -#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 -msgid "failed in get_file_name" -msgstr "errore in \"get_file_name\"" - -#: ../src/prompt.c:139 -#, c-format -msgid "Failed to set note (error %d)\n" -msgstr "Errore nell'impostare il messaggio di stato (errore %d)\n" - -#: ../src/prompt.c:271 -msgid "ERROR" -msgstr "ERRORE" - -#: ../src/prompt.c:275 -msgid "Online" -msgstr "Online" - -#: ../src/prompt.c:279 -msgid "Away" -msgstr "Assente" - -#: ../src/prompt.c:283 -msgid "Busy" -msgstr "Occupato" - -#: ../src/prompt.c:296 -msgid " [Offline]" -msgstr " [Offline]" - -#: ../src/prompt.c:366 ../src/prompt.c:369 -#, c-format -msgid "%s has come online" -msgstr "%s si è connesso" - -#: ../src/prompt.c:378 ../src/prompt.c:381 -#, c-format -msgid "%s has gone offline" -msgstr "%s si è disconnesso" - -#: ../src/prompt.c:392 ../src/prompt.c:393 -#, c-format -msgid "Friend request with the message '%s'" -msgstr "Richiesta d'amicizia con il messaggio '%s'" - -#: ../src/prompt.c:398 -msgid "Friend request queue is full. Discarding request." -msgstr "Coda delle richieste d'amicizia piena. Richiesta scartata." - -#: ../src/prompt.c:403 -#, c-format -msgid "Type \"%s %d\" or \"%s %d\"" -msgstr "Scrivi \"%s %d\" o \"%s %d\"" - -#: ../src/prompt.c:432 ../src/prompt.c:433 -#, c-format -msgid "Toxing on Toxic" -msgstr "Toxing on Toxic" - -#: ../src/prompt.c:455 -msgid "" -"Welcome to Toxic, a free, open source Tox-based instant messenging client." -msgstr "Benvenuto in Toxic, un client gratis e open source per la rete Tox." - -#: ../src/prompt.c:457 -#, c-format -msgid "Type \"%s\" for assistance. Further help may be found via the man page." -msgstr "" -"Usa \"%s\" per ricevere assistenza. Ulteriori aiuto può essere ottenuto " -"attraverso la pagina di manuale." - -#: ../src/prompt.c:476 -msgid "failed in prompt_onInit" -msgstr "errore in \"prompt_onInit\"" - -#: ../src/prompt.c:514 -msgid "failed in new_prompt" -msgstr "errore in \"new_prompt\"" - -#: ../src/toxic.c:112 -#, c-format -msgid "Caught SIGSEGV: Aborting toxic session.\n" -msgstr "Ricevuto segnale SIGSEGV: chiudo sessione.\n" - -#: ../src/toxic.c:161 -#, c-format -msgid "Toxic session aborted with error code %d (%s)\n" -msgstr "Sessio ciusa con errore %d (%s)\n" - -#: ../src/toxic.c:171 -msgid "" -"Could not set your locale, please check your locale settings or disable " -"unicode support with the -d flag." -msgstr "" -"Impossibile impostare la localizzazione, controlla le impostazione o " -"disabilita il supporto unicode con l'opzione \"-d\"." - -#: ../src/toxic.c:231 ../src/toxic.c:236 -msgid "Failed in queue_init_message" -msgstr "errore in \"queue_init_message\"" - -#: ../src/toxic.c:328 -#, c-format -msgid "Failed to bootstrap %s:%d\n" -msgstr "Bootstrap fallito %s:%d\n" - -#: ../src/toxic.c:335 -#, c-format -msgid "Failed to add TCP relay %s:%d\n" -msgstr "Errore aggiungendo relay TCP %s:%d\n" - -#: ../src/toxic.c:466 -#, c-format -msgid "Enter a new password (must be at least %d characters) " -msgstr "Inserisci una nuova password (deve contenere almeno %d caratteri) " - -#: ../src/toxic.c:476 -#, c-format -msgid "Password must be between %d and %d characters long. " -msgstr "La password deve essere lunga tra %d e %d caratteri. " - -#: ../src/toxic.c:481 -#, c-format -msgid "Enter password again " -msgstr "Reinserisci password " - -#: ../src/toxic.c:489 -#, c-format -msgid "Passwords don't match. Try again. " -msgstr "Le passwords non corrispondono. Riprova. " - -#: ../src/toxic.c:496 -#, c-format -msgid "Data file '%s' is encrypted" -msgstr "Il file dati '%s' è criptato" - -#: ../src/toxic.c:533 -#, c-format -msgid "tox_pass_encrypt() failed with error %d\n" -msgstr "\"tox_pass_encrypt()\" fallita con errore %d\n" - -#: ../src/toxic.c:584 -msgid "Forcing IPv4 connection" -msgstr "Forzata connessione IPv4" - -#: ../src/toxic.c:592 -#, c-format -msgid "Using %s proxy %s : %d" -msgstr "Uso %s proxy %s:%d" - -#: ../src/toxic.c:597 -msgid "UDP disabled" -msgstr "UDP disabilitato" - -#: ../src/toxic.c:599 -msgid "" -"WARNING: Using a proxy without disabling UDP may leak your real IP address." -msgstr "" -"ATTENZIONE: usare un proxy senza disabilitare UDP potrebbe portare alla " -"rivelazione del tuo vero IP." - -#: ../src/toxic.c:601 -msgid "Use the -t option to disable UDP." -msgstr "Usa l'optione \"-t\" per disabilitare UDP." - -#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 -#: ../src/toxic.c:722 -msgid "failed in load_toxic" -msgstr "errore in \"load_toxic\"" - -#: ../src/toxic.c:639 -#, c-format -msgid "Data file '%s' has been unencrypted" -msgstr "Il file di dati '%s' è stato decriptato" - -#: ../src/toxic.c:641 -#, c-format -msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" -msgstr "" -"Attenzione: opzione \"--unencrypt-data\" usata con un file di dati non " -"criptato (%s)" - -#: ../src/toxic.c:649 -#, c-format -msgid "Enter password (\"%s\" to quit) " -msgstr "Inserisci password (\"%s\" per uscire) " - -#: ../src/toxic.c:666 ../src/toxic.c:690 -#, c-format -msgid "Invalid password. Try again. " -msgstr "Password errata. Riprova. " - -#: ../src/toxic.c:693 -msgid "tox_pass_decrypt() failed" -msgstr "\"tox_pass_decrypt()\" fallita" - -#: ../src/toxic.c:737 -msgid "Falling back to ipv4" -msgstr "Ritorno a IPv4" - -#: ../src/toxic.c:743 -msgid "tox_new returned fatal error" -msgstr "\"tox_new\" ha ritornato un errore fatale" - -#: ../src/toxic.c:746 -#, c-format -msgid "tox_new returned non-fatal error %d" -msgstr "\"tox_new\" ha ritornato un errore non fatale %d" - -#: ../src/toxic.c:753 -msgid "Toxic User" -msgstr "Utente Toxic" - -#: ../src/toxic.c:779 -#, c-format -msgid "Auto-connect failed with error code %d" -msgstr "Connessione automatica fallita con errore %d" - -#: ../src/toxic.c:860 -#, c-format -msgid "usage: toxic [OPTION] [FILE ...]\n" -msgstr "uso: toxic [OPZIONE] [FILE...]\n" - -#: ../src/toxic.c:862 -#, c-format -msgid "Force IPv4 connection\n" -msgstr "Forza connessioni IPv4\n" - -#: ../src/toxic.c:864 -#, c-format -msgid "Enable stderr for debugging\n" -msgstr "Abilita stderr per il debugging\n" - -#: ../src/toxic.c:866 -#, c-format -msgid "Use specified config file\n" -msgstr "Usa il file di configurazione specificato\n" - -#: ../src/toxic.c:868 -#, c-format -msgid "Use default POSIX locale\n" -msgstr "Usa localizzazione POSIX di default\n" - -#: ../src/toxic.c:870 -#, c-format -msgid "Encrypt an unencrypted data file\n" -msgstr "Cripta un file di dati non criptato\n" - -#: ../src/toxic.c:872 -#, c-format -msgid "Use specified data file\n" -msgstr "Usa il file di dati specificato\n" - -#: ../src/toxic.c:874 -#, c-format -msgid "Show this message and exit\n" -msgstr "Mostra questo messaggio ed esce\n" - -#: ../src/toxic.c:876 -#, c-format -msgid "Use specified DHTnodes file\n" -msgstr "Usa il file DHTnodes specificato\n" - -#: ../src/toxic.c:878 -#, c-format -msgid "Do not connect to the DHT network\n" -msgstr "Non si connette alla rete DHT\n" - -#: ../src/toxic.c:880 -#, c-format -msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" -msgstr "Usa proxy SOCKS5: richiede [IP] [porta]\n" - -#: ../src/toxic.c:882 -#, c-format -msgid "Use HTTP proxy: Requires [IP] [port]\n" -msgstr "Usa proxy HTTP: richiede [IP] [porta]\n" - -#: ../src/toxic.c:884 -#, c-format -msgid "Use specified DNSservers file\n" -msgstr "Usa il file DNSservers specificato\n" - -#: ../src/toxic.c:886 -#, c-format -msgid "Force TCP connection (use this with proxies)\n" -msgstr "Forza connessioni TCP (usa questa opzione per i proxies)\n" - -#: ../src/toxic.c:888 -#, c-format -msgid "Unencrypt an encrypted data file\n" -msgstr "Decripta un file di dati criptato\n" - -#: ../src/toxic.c:932 -msgid "stderr enabled" -msgstr "stderr abilitato" - -#: ../src/toxic.c:939 -msgid "Config file not found" -msgstr "File di configurazione non trovato" - -#: ../src/toxic.c:945 -msgid "Using default POSIX locale" -msgstr "Uso localizzazione POSIX di default" - -#: ../src/toxic.c:958 -msgid "failed in parse_args" -msgstr "erorre in \"parse_args\"" - -#: ../src/toxic.c:963 -#, c-format -msgid "Using '%s' data file" -msgstr "Uso il file di dati '%s'" - -#: ../src/toxic.c:971 -msgid "DHTnodes file not found" -msgstr "File DHTnodes non trovato" - -#: ../src/toxic.c:977 -msgid "DHT disabled" -msgstr "DHT disabilitato" - -#: ../src/toxic.c:985 ../src/toxic.c:995 -msgid "Proxy error" -msgstr "Errore proxy" - -#: ../src/toxic.c:1004 -msgid "DNSservers file not found" -msgstr "File DNSservers non trovato" - -#: ../src/toxic.c:1101 -#, c-format -msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" -msgstr "Attenzione: usando \"%s\" e \"%s\" simultaneamente non avrà effetto" - -#: ../src/toxic.c:1114 -msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" -msgstr "" -"Creazione di un nuovo file di dati. Vuoi criptarlo? Y/n (\"q\" per uscire)" - -#: ../src/toxic.c:1116 -msgid "Encrypt existing data file? Y/n (q to quit)" -msgstr "Criptare il file di dati esistente? Y/n (\"q\" per uscire)" - -#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 -#: ../src/toxic.c:1153 ../src/toxic.c:1161 -msgid "failed in main" -msgstr "errore in \"main\"" - -#: ../src/toxic.c:1130 -msgid "X failed to initialize" -msgstr "Errore inizializzazione X" - -#: ../src/toxic.c:1168 -msgid "Failed to init audio devices" -msgstr "Inizializzazione dispositivi audio fallita" - -#: ../src/toxic.c:1177 -msgid "" -"Unable to determine configuration directory. Defaulting to 'data' for data " -"file..." -msgstr "" -"Impossibile determinare la directory delle configurazioni. Uso 'data' come " -"file di dati..." - -#: ../src/toxic.c:1182 -msgid "Failed to load user settings" -msgstr "Errore nel caricamento delle impostazioni utente" - -#: ../src/toxic.c:1186 -msgid "Failed to init mplex auto-away." -msgstr "Errore nell'inizializzazione di mplex auto-away." - -#: ../src/toxic.c:1209 -msgid "WARNING: Failed to save to data file" -msgstr "ATTENZIONE: salvataggio file di dati fallito" - -#: ../src/toxic.h:43 -msgid "Anonymous" -msgstr "Anonimo" - -#: ../src/toxic.h:44 -msgid "Tox User" -msgstr "Utente Toxic" - -#: ../src/windows.c:368 -msgid "failed in set_next_window" -msgstr "errore in \"set_next_window\"" - -#: ../src/windows.c:390 -msgid "failed in init_windows" -msgstr "errore in \"init_windows\"" diff --git a/translations/tools/create_mo.sh b/translations/tools/create_mo.sh deleted file mode 100755 index b0de40c..0000000 --- a/translations/tools/create_mo.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -loc="$1" -while [ -z "$1" -a -z "$loc" ]; do - echo -n "Insert locale (for example \"en\"): " - read loc -done - -cd .. - -if [ ! -e "$loc.po" ]; then - echo "File \"$loc.po\" not found" - echo "The translation file must exist" - exit 1 -else - msgfmt -c -o $loc.mo $loc.po -fi diff --git a/translations/tools/create_po.sh b/translations/tools/create_po.sh deleted file mode 100755 index 6a884a6..0000000 --- a/translations/tools/create_po.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -loc="$1" -while [ -z "$1" -a -z "$loc" ]; do - echo -n "Insert locale to create (for example \"en\"): " - read loc -done - -cd .. - -if [ -e "$loc.po" ]; then - echo "File \"$loc.po\" found" - echo "The translation file must not exist" - exit 1 -else - v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ") - echo "PACKAGE_NAME=Toxic" > configure - echo "PACKAGE_VERSION=$v" >> configure - msginit --no-translator -l $loc -o $loc.po -i toxic.pot - rm -f configure -fi diff --git a/translations/tools/update_po.sh b/translations/tools/update_po.sh deleted file mode 100755 index ee352ff..0000000 --- a/translations/tools/update_po.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -cd $(dirname $0) - -loc="$1" -while [ -z "$1" -a -z "$loc" ]; do - echo -n "Insert locale to update (for example \"en\"): " - read loc -done - -cd .. - -if [ ! -e "$loc.po" ]; then - echo "File \"$loc.po\" not found" - echo "The translation file must exist" - exit 1 -else - msgmerge -U --backup=none --previous $loc.po toxic.pot -fi diff --git a/translations/tools/update_pot.sh b/translations/tools/update_pot.sh deleted file mode 100755 index 3b595f4..0000000 --- a/translations/tools/update_pot.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd $(dirname $0)/.. -v=$(grep TOXIC_VERSION ../cfg/global_vars.mk | head -1 | cut -d "=" -f 2 | tr -d " ") -xgettext --default-domain="toxic" \ - --from-code="UTF-8" \ - --copyright-holder="Toxic Team" \ - --msgid-bugs-address="JFreegman@tox.chat" \ - --package-name="Toxic" \ - --package-version="$v" \ - --output="toxic.pot" \ - ../src/* diff --git a/translations/toxic.pot b/translations/toxic.pot deleted file mode 100644 index 0c0f461..0000000 --- a/translations/toxic.pot +++ /dev/null @@ -1,1575 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Toxic Team -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Toxic 0.6.0\n" -"Report-Msgid-Bugs-To: JFreegman@tox.chat\n" -"POT-Creation-Date: 2015-06-30 23:49-0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../src/audio_call.c:133 -msgid "Failed to init devices" -msgstr "" - -#: ../src/audio_call.c:195 ../src/audio_call.c:201 -msgid "Could not prepare transmission" -msgstr "" - -#: ../src/audio_call.c:217 -msgid "Failed to open input device!" -msgstr "" - -#: ../src/audio_call.c:222 -msgid "Failed to register input handler!" -msgstr "" - -#: ../src/audio_call.c:226 -msgid "Failed to open output device!" -msgstr "" - -#: ../src/audio_call.c:284 ../src/audio_call.c:303 -msgid "Error starting transmission!" -msgstr "" - -#: ../src/audio_call.c:357 ../src/audio_call.c:392 ../src/audio_call.c:423 -#: ../src/audio_call.c:454 -msgid "Unknown arguments." -msgstr "" - -#: ../src/audio_call.c:362 ../src/audio_call.c:397 ../src/audio_call.c:428 -#: ../src/audio_call.c:459 -msgid "Audio not supported!" -msgstr "" - -#: ../src/audio_call.c:367 -msgid "Friend is offline." -msgstr "" - -#: ../src/audio_call.c:374 -msgid "Already in a call!" -msgstr "" - -#: ../src/audio_call.c:375 ../src/audio_call.c:406 ../src/audio_call.c:437 -#: ../src/audio_call.c:479 -msgid "Internal error!" -msgstr "" - -#: ../src/audio_call.c:380 -#, c-format -msgid "Calling... idx: %d" -msgstr "" - -#: ../src/audio_call.c:404 -msgid "Cannot answer in invalid state!" -msgstr "" - -#: ../src/audio_call.c:405 ../src/audio_call.c:436 -msgid "No incoming call!" -msgstr "" - -#: ../src/audio_call.c:432 -msgid "Why not?" -msgstr "" - -#: ../src/audio_call.c:435 -msgid "Cannot reject in invalid state!" -msgstr "" - -#: ../src/audio_call.c:467 -msgid "Only those who appreciate small things know the beauty that is life" -msgstr "" - -#: ../src/audio_call.c:471 ../src/chat.c:653 -msgid "Call canceled!" -msgstr "" - -#: ../src/audio_call.c:477 -msgid "Cannot hangup in invalid state!" -msgstr "" - -#: ../src/audio_call.c:478 -msgid "No call!" -msgstr "" - -#: ../src/audio_call.c:494 ../src/audio_call.c:526 ../src/audio_call.c:570 -#: ../src/audio_call.c:643 -msgid "Type must be specified!" -msgstr "" - -#: ../src/audio_call.c:495 -msgid "Only one argument allowed!" -msgstr "" - -#: ../src/audio_call.c:509 ../src/audio_call.c:542 ../src/audio_call.c:586 -#: ../src/audio_call.c:658 -#, c-format -msgid "Invalid type: %s" -msgstr "" - -#: ../src/audio_call.c:527 ../src/audio_call.c:571 -msgid "Must have id!" -msgstr "" - -#: ../src/audio_call.c:528 ../src/audio_call.c:572 ../src/audio_call.c:644 -#: ../src/audio_call.c:690 -msgid "Only two arguments allowed!" -msgstr "" - -#: ../src/audio_call.c:551 ../src/audio_call.c:595 ../src/audio_call.c:699 -msgid "Invalid input" -msgstr "" - -#: ../src/audio_call.c:556 ../src/audio_call.c:600 -msgid "Invalid selection!" -msgstr "" - -#: ../src/audio_call.c:689 -msgid "Must have value!" -msgstr "" - -#: ../src/audio_call.c:728 -msgid "Not interested anymore" -msgstr "" - -#: ../src/audio_call.c:731 -msgid "Not interested" -msgstr "" - -#: ../src/autocomplete.c:126 -msgid "failed in complete_line" -msgstr "" - -#: ../src/avatars.c:68 -#, c-format -msgid "tox_file_send failed for friendnumber %d (error %d)\n" -msgstr "" - -#: ../src/avatars.c:212 -#, c-format -msgid "tox_file_send_chunk failed in avatar callback (error %d)\n" -msgstr "" - -#: ../src/chat.c:56 -msgid "yes" -msgstr "" - -#: ../src/chat.c:57 -msgid "no" -msgstr "" - -#: ../src/chat.c:223 ../src/prompt.c:363 -msgid "has come online" -msgstr "" - -#: ../src/chat.c:234 ../src/prompt.c:375 -msgid "has gone offline" -msgstr "" - -#: ../src/chat.c:319 -#, c-format -msgid "File '%s' successfully sent." -msgstr "" - -#: ../src/chat.c:326 -#, c-format -msgid "File transfer for '%s' failed: Null file pointer." -msgstr "" - -#: ../src/chat.c:333 -#, c-format -msgid "File transfer for '%s' failed: Seek fail." -msgstr "" - -#: ../src/chat.c:345 -#, c-format -msgid "File transfer for '%s' failed: Read fail." -msgstr "" - -#: ../src/chat.c:354 -#, c-format -msgid "tox_file_send_chunk failed in chat callback (error %d)\n" -msgstr "" - -#: ../src/chat.c:377 -#, c-format -msgid "File '%s' successfully received." -msgstr "" - -#: ../src/chat.c:384 -#, c-format -msgid "File transfer for '%s' failed: Invalid file pointer." -msgstr "" - -#: ../src/chat.c:390 -#, c-format -msgid "File transfer for '%s' failed: Write fail." -msgstr "" - -#: ../src/chat.c:416 -#, c-format -msgid "File transfer [%d] for '%s' accepted." -msgstr "" - -#: ../src/chat.c:434 -#, c-format -msgid "File transfer for '%s' was aborted." -msgstr "" - -#: ../src/chat.c:450 ../src/chat_commands.c:309 -msgid "File transfer failed: Too many concurrent file transfers." -msgstr "" - -#: ../src/chat.c:456 -#, c-format -msgid "File transfer request for '%s' (%s)" -msgstr "" - -#: ../src/chat.c:471 -msgid "File transfer faield: File path too long." -msgstr "" - -#: ../src/chat.c:497 -msgid "File transfer failed: invalid file path." -msgstr "" - -#: ../src/chat.c:502 -#, c-format -msgid "Type '%s %d' to accept the file transfer." -msgstr "" - -#: ../src/chat.c:515 ../src/chat.c:518 -#, c-format -msgid "Incoming file: %s" -msgstr "" - -#: ../src/chat.c:533 -msgid "Failed in chat_onGroupInvite" -msgstr "" - -#: ../src/chat.c:547 ../src/chat.c:549 -msgid "invites you to join group chat" -msgstr "" - -#: ../src/chat.c:551 -#, c-format -msgid "%s has invited you to a group chat." -msgstr "" - -#: ../src/chat.c:552 -#, c-format -msgid "Type \"%s\" to join the chat." -msgstr "" - -#: ../src/chat.c:566 -#, c-format -msgid "Incoming audio call! Type: \"%s\" or \"%s\"" -msgstr "" - -#: ../src/chat.c:573 ../src/chat.c:575 -msgid "Incoming audio call!" -msgstr "" - -#: ../src/chat.c:583 -#, c-format -msgid "Ringing...type \"%s\" to cancel it." -msgstr "" - -#: ../src/chat.c:598 ../src/chat.c:639 -#, c-format -msgid "Call started! Type: \"%s\" to end it." -msgstr "" - -#: ../src/chat.c:612 ../src/chat.c:680 -msgid "Call ended!" -msgstr "" - -#: ../src/chat.c:625 -msgid "Error!" -msgstr "" - -#: ../src/chat.c:666 -msgid "Rejected!" -msgstr "" - -#: ../src/chat.c:693 -msgid "No answer!" -msgstr "" - -#: ../src/chat.c:707 -msgid "Peer disconnected; call ended!" -msgstr "" - -#: ../src/chat.c:769 -msgid " Call Active\n" -msgstr "" - -#: ../src/chat.c:773 -msgid " Duration: " -msgstr "" - -#: ../src/chat.c:778 -msgid " In muted: " -msgstr "" - -#: ../src/chat.c:783 -msgid " Out muted: " -msgstr "" - -#: ../src/chat.c:788 -msgid " VAD level: " -msgstr "" - -#: ../src/chat.c:1083 -msgid "failed in chat_onInit" -msgstr "" - -#: ../src/chat.c:1155 -msgid "failed in new_chat" -msgstr "" - -#: ../src/chat_commands.c:48 -#, c-format -msgid "Requires type %s and the file ID." -msgstr "" - -#: ../src/chat_commands.c:57 ../src/chat_commands.c:74 -#: ../src/chat_commands.c:79 -msgid "Invalid file ID." -msgstr "" - -#: ../src/chat_commands.c:69 -#, c-format -msgid "Type must be '%s' or '%s'." -msgstr "" - -#: ../src/chat_commands.c:83 -#, c-format -msgid "File transfer for '%s' aborted." -msgstr "" - -#: ../src/chat_commands.c:90 -msgid "Group number required." -msgstr "" - -#: ../src/chat_commands.c:97 -msgid "Invalid group number." -msgstr "" - -#: ../src/chat_commands.c:102 -msgid "Failed to invite contact to group." -msgstr "" - -#: ../src/chat_commands.c:106 -#, c-format -msgid "Invited contact to Group %d." -msgstr "" - -#: ../src/chat_commands.c:112 ../src/global_commands.c:324 -msgid " * Warning: Too many windows are open." -msgstr "" - -#: ../src/chat_commands.c:121 -msgid "No pending group chat invite." -msgstr "" - -#: ../src/chat_commands.c:136 ../src/global_commands.c:354 -msgid "Group chat instance failed to initialize." -msgstr "" - -#: ../src/chat_commands.c:141 ../src/global_commands.c:359 -msgid "Group chat window failed to initialize." -msgstr "" - -#: ../src/chat_commands.c:151 -msgid "File ID required." -msgstr "" - -#: ../src/chat_commands.c:158 ../src/chat_commands.c:165 -#: ../src/chat_commands.c:170 -msgid "No pending file transfers with that ID." -msgstr "" - -#: ../src/chat_commands.c:175 -msgid "File transfer failed: Invalid file path." -msgstr "" - -#: ../src/chat_commands.c:186 -#, c-format -msgid "Saving file [%d] as: '%s'" -msgstr "" - -#: ../src/chat_commands.c:201 -msgid "File transfer failed: Friend not found." -msgstr "" - -#: ../src/chat_commands.c:205 -msgid "File transfer failed: Friend is not online." -msgstr "" - -#: ../src/chat_commands.c:209 -msgid "File transfer failed: Invalid filenumber." -msgstr "" - -#: ../src/chat_commands.c:213 -msgid "File transfer failed: Connection error." -msgstr "" - -#: ../src/chat_commands.c:217 -#, c-format -msgid "File transfer failed (error %d)\n" -msgstr "" - -#: ../src/chat_commands.c:227 -msgid "File path required." -msgstr "" - -#: ../src/chat_commands.c:232 -msgid "File path must be enclosed in quotes." -msgstr "" - -#: ../src/chat_commands.c:243 -msgid "File path exceeds character limit." -msgstr "" - -#: ../src/chat_commands.c:250 -msgid "File not found." -msgstr "" - -#: ../src/chat_commands.c:257 -msgid "Invalid file." -msgstr "" - -#: ../src/chat_commands.c:290 -#, c-format -msgid "Sending file [%d]: '%s' (%s)" -msgstr "" - -#: ../src/chat_commands.c:297 -msgid "File transfer failed: Invalid friend." -msgstr "" - -#: ../src/chat_commands.c:301 -msgid "File transfer failed: Friend is offline." -msgstr "" - -#: ../src/chat_commands.c:305 -msgid "File transfer failed: Filename is too long." -msgstr "" - -#: ../src/chat_commands.c:313 -msgid "File transfer failed." -msgstr "" - -#: ../src/configdir.c:125 ../src/toxic.c:1039 ../src/toxic.c:1045 -msgid "failed in load_data_structures" -msgstr "" - -#: ../src/dns.c:155 -#, c-format -msgid "User lookup failed: %s" -msgstr "" - -#: ../src/dns.c:181 -msgid "dn_expand failed." -msgstr "" - -#: ../src/dns.c:186 ../src/dns.c:209 -msgid "DNS reply was too short." -msgstr "" - -#: ../src/dns.c:192 -msgid "Broken DNS reply." -msgstr "" - -#: ../src/dns.c:204 -msgid "Second dn_expand failed." -msgstr "" - -#: ../src/dns.c:217 -msgid "RR overflow." -msgstr "" - -#: ../src/dns.c:222 -msgid "DNS response failed." -msgstr "" - -#: ../src/dns.c:227 -msgid "No record found." -msgstr "" - -#: ../src/dns.c:230 -msgid "Invalid DNS response." -msgstr "" - -#: ../src/dns.c:307 -msgid "Must be a Tox ID or an address in the form username@domain" -msgstr "" - -#: ../src/dns.c:317 -msgid "Domain not found." -msgstr "" - -#: ../src/dns.c:324 -msgid "Core failed to create DNS object." -msgstr "" - -#: ../src/dns.c:335 -msgid "Core failed to generate DNS3 string." -msgstr "" - -#: ../src/dns.c:349 -msgid "DNS query failed." -msgstr "" - -#: ../src/dns.c:364 -msgid "Bad DNS3 TXT response." -msgstr "" - -#: ../src/dns.c:372 -msgid "Core failed to decrypt DNS response." -msgstr "" - -#: ../src/dns.c:388 -msgid "DNS lookups are disabled." -msgstr "" - -#: ../src/dns.c:393 -msgid "Please wait for previous user lookup to finish." -msgstr "" - -#: ../src/dns.c:403 -#, c-format -msgid "" -"DNS server list failed to load with error code %d. Falling back to hard-" -"coded list." -msgstr "" - -#: ../src/dns.c:416 -msgid "Error: DNS thread attr failed to init" -msgstr "" - -#: ../src/dns.c:422 -msgid "Error: DNS thread attr failed to set" -msgstr "" - -#: ../src/dns.c:429 -msgid "Error: DNS thread failed to init" -msgstr "" - -#: ../src/execute.c:107 -msgid "failed in parse_command" -msgstr "" - -#: ../src/execute.c:121 -msgid "Invalid argument. Did you forget a closing \"?" -msgstr "" - -#: ../src/execute.c:192 -msgid "Invalid command." -msgstr "" - -#: ../src/friendlist.c:93 -msgid "failed in realloc_friends" -msgstr "" - -#: ../src/friendlist.c:113 -msgid "failed in realloc_blocklist" -msgstr "" - -#: ../src/friendlist.c:141 -msgid "Failed in save_blocklist" -msgstr "" - -#: ../src/friendlist.c:208 -msgid "Failed in load_blocklist" -msgstr "" - -#: ../src/friendlist.c:331 ../src/friendlist.c:766 ../src/friendlist.c:1076 -msgid "* Warning: Too many windows are open." -msgstr "" - -#: ../src/friendlist.c:346 -#, c-format -msgid "avatar_send failed for friend %d\n" -msgstr "" - -#: ../src/friendlist.c:421 -#, c-format -msgid "tox_friend_get_public_key failed (error %d)\n" -msgstr "" - -#: ../src/friendlist.c:500 -#, c-format -msgid "* File transfer from %s failed: too many windows are open." -msgstr "" - -#: ../src/friendlist.c:523 -#, c-format -msgid "* Group chat invite from %s failed: too many windows are open." -msgstr "" - -#: ../src/friendlist.c:546 -#, c-format -msgid "tox_friend_delete failed with error %d\n" -msgstr "" - -#: ../src/friendlist.c:626 -msgid "Delete contact " -msgstr "" - -#: ../src/friendlist.c:707 -#, c-format -msgid "Failed to unblock friend (error %d)\n" -msgstr "" - -#: ../src/friendlist.c:803 -msgid " Blocked: " -msgstr "" - -#: ../src/friendlist.c:855 ../src/friendlist.c:1035 -msgid "Key: " -msgstr "" - -#: ../src/friendlist.c:881 -msgid " Press the" -msgstr "" - -#: ../src/friendlist.c:885 -msgid "" -"key for help\n" -"\n" -msgstr "" - -#: ../src/friendlist.c:897 -msgid " Online: " -msgstr "" - -#: ../src/friendlist.c:1011 -#, c-format -msgid " Last seen: Today %s\n" -msgstr "" - -#: ../src/friendlist.c:1015 -#, c-format -msgid " Last seen: Yesterday %s\n" -msgstr "" - -#: ../src/friendlist.c:1019 -#, c-format -msgid " Last seen: %d days ago\n" -msgstr "" - -#: ../src/friendlist.c:1023 -msgid " Last seen: Never\n" -msgstr "" - -#: ../src/friendlist.c:1074 -#, c-format -msgid "Audio action from: %s!" -msgstr "" - -#: ../src/friendlist.c:1126 -msgid "failed in new_friendlist" -msgstr "" - -#: ../src/friendlist.c:1129 -msgid "contacts" -msgstr "" - -#: ../src/global_commands.c:55 ../src/global_commands.c:292 -msgid "Request ID required." -msgstr "" - -#: ../src/global_commands.c:62 ../src/global_commands.c:67 -#: ../src/global_commands.c:299 ../src/global_commands.c:304 -msgid "No pending friend request with that ID." -msgstr "" - -#: ../src/global_commands.c:75 -#, c-format -msgid "Failed to add friend (error %d)\n" -msgstr "" - -#: ../src/global_commands.c:78 -msgid "Friend request accepted." -msgstr "" - -#: ../src/global_commands.c:105 -msgid "Message is too long." -msgstr "" - -#: ../src/global_commands.c:109 -msgid "Please add a message to your request." -msgstr "" - -#: ../src/global_commands.c:113 -msgid "That appears to be your own ID." -msgstr "" - -#: ../src/global_commands.c:117 -msgid "Friend request has already been sent." -msgstr "" - -#: ../src/global_commands.c:121 -msgid "Bad checksum in address." -msgstr "" - -#: ../src/global_commands.c:125 -msgid "Nospam was different." -msgstr "" - -#: ../src/global_commands.c:129 -msgid "Core memory allocation failed." -msgstr "" - -#: ../src/global_commands.c:133 -msgid "Friend request sent." -msgstr "" - -#: ../src/global_commands.c:140 -msgid "Failed to add friend: Unknown error." -msgstr "" - -#: ../src/global_commands.c:150 -msgid "Tox ID or address required." -msgstr "" - -#: ../src/global_commands.c:159 -msgid "Message must be enclosed in quotes." -msgstr "" - -#: ../src/global_commands.c:175 -#, c-format -msgid "Hello, my name is %s. Care to Tox?" -msgstr "" - -#: ../src/global_commands.c:193 -msgid "Invalid Tox ID." -msgstr "" - -#: ../src/global_commands.c:210 -msgid "Avatar is not set." -msgstr "" - -#: ../src/global_commands.c:215 -msgid "Path must be enclosed in quotes." -msgstr "" - -#: ../src/global_commands.c:225 -msgid "Invalid path." -msgstr "" - -#: ../src/global_commands.c:235 -#, c-format -msgid "" -"Failed to set avatar. Avatars must be in PNG format and may not exceed %d " -"bytes." -msgstr "" - -#: ../src/global_commands.c:240 -#, c-format -msgid "Avatar set to '%s'" -msgstr "" - -#: ../src/global_commands.c:252 -msgid "Require: " -msgstr "" - -#: ../src/global_commands.c:261 -msgid "Invalid port." -msgstr "" - -#: ../src/global_commands.c:274 -msgid "Bootstrap failed: Invalid IP." -msgstr "" - -#: ../src/global_commands.c:278 -msgid "Bootstrap failed: Invalid port." -msgstr "" - -#: ../src/global_commands.c:282 -msgid "Bootstrap failed." -msgstr "" - -#: ../src/global_commands.c:329 -#, c-format -msgid "Please specify group type: %s" -msgstr "" - -#: ../src/global_commands.c:340 -#, c-format -msgid "Valid group types are: %s" -msgstr "" - -#: ../src/global_commands.c:364 -#, c-format -msgid "Group chat [%d] created." -msgstr "" - -#: ../src/global_commands.c:374 -msgid "Logging for this window is ON. Type \"/log off\" to disable." -msgstr "" - -#: ../src/global_commands.c:376 -msgid "Logging for this window is OFF. Type \"/log on\" to enable." -msgstr "" - -#: ../src/global_commands.c:397 -msgid "Logging enabled" -msgstr "" - -#: ../src/global_commands.c:406 -msgid "Logging disabled" -msgstr "" - -#: ../src/global_commands.c:411 -#, c-format -msgid "Invalid option. Use \"%s\" to toggle logging." -msgstr "" - -#: ../src/global_commands.c:435 ../src/global_commands.c:468 -msgid "Input required." -msgstr "" - -#: ../src/global_commands.c:452 -msgid "Invalid name." -msgstr "" - -#: ../src/global_commands.c:473 ../src/global_commands.c:561 -msgid "Note must be enclosed in quotes." -msgstr "" - -#: ../src/global_commands.c:499 -msgid "No pending friend requests." -msgstr "" - -#: ../src/global_commands.c:536 -#, c-format -msgid "Require a status. Statuses are: %s." -msgstr "" - -#: ../src/global_commands.c:551 -#, c-format -msgid "Invalid status. Valid statuses are: %s." -msgstr "" - -#: ../src/groupchat.c:143 -msgid "failed in init_groupchat_win" -msgstr "" - -#: ../src/groupchat.c:151 -#, c-format -msgid "Group Audio failed to init\n" -msgstr "" - -#: ../src/groupchat.c:337 ../src/group_commands.c:80 -#, c-format -msgid " set the group title to: %s" -msgstr "" - -#: ../src/groupchat.c:340 ../src/group_commands.c:83 -#, c-format -msgid "set title to %s" -msgstr "" - -#: ../src/groupchat.c:362 -msgid "failed in copy_peernames" -msgstr "" - -#: ../src/groupchat.c:419 -msgid "has joined the room" -msgstr "" - -#: ../src/groupchat.c:517 -msgid "has left the room" -msgstr "" - -#: ../src/groupchat.c:534 -msgid " is now known as " -msgstr "" - -#: ../src/groupchat.c:538 -#, c-format -msgid "is now known as %s" -msgstr "" - -#: ../src/groupchat.c:549 -msgid "Invalid syntax.\n" -msgstr "" - -#: ../src/groupchat.c:554 -msgid " * Failed to send action." -msgstr "" - -#: ../src/groupchat.c:641 -msgid " * Failed to send message." -msgstr "" - -#: ../src/groupchat.c:681 -#, c-format -msgid "Peers: %d\n" -msgstr "" - -#: ../src/groupchat.c:731 -msgid "failed in groupchat_onInit" -msgstr "" - -#: ../src/groupchat.c:816 -#, c-format -msgid "source: %d, queued: %d, processed: %d\n" -msgstr "" - -#: ../src/groupchat.c:855 -#, c-format -msgid "dvhandle is null)\n" -msgstr "" - -#: ../src/groupchat.c:858 -#, c-format -msgid "ctx is null\n" -msgstr "" - -#: ../src/groupchat.c:861 -#, c-format -msgid "write: %d\n" -msgstr "" - -#: ../src/groupchat.c:885 -#, c-format -msgid "Group %d" -msgstr "" - -#: ../src/groupchat.c:891 -msgid "failed in new_group_chat" -msgstr "" - -#: ../src/group_commands.c:46 -#, c-format -msgid "Title is set to: %s" -msgstr "" - -#: ../src/group_commands.c:48 -msgid "Title is not set" -msgstr "" - -#: ../src/group_commands.c:55 -msgid "Title must be enclosed in quotes." -msgstr "" - -#: ../src/group_commands.c:65 -msgid "Failed to set title." -msgstr "" - -#: ../src/help.c:148 -msgid "Global Commands:\n" -msgstr "" - -#: ../src/help.c:152 -msgid "Add contact with optional message\n" -msgstr "" - -#: ../src/help.c:154 -msgid "Accept friend request\n" -msgstr "" - -#: ../src/help.c:156 -msgid "Set an avatar (leave path empty to unset)\n" -msgstr "" - -#: ../src/help.c:158 -msgid "Decline friend request\n" -msgstr "" - -#: ../src/help.c:160 -msgid "List pending friend requests\n" -msgstr "" - -#: ../src/help.c:162 -msgid "Manually connect to a DHT node\n" -msgstr "" - -#: ../src/help.c:164 -msgid "Set status with optional note\n" -msgstr "" - -#: ../src/help.c:166 -msgid "Set a personal note\n" -msgstr "" - -#: ../src/help.c:168 -msgid "Set your nickname\n" -msgstr "" - -#: ../src/help.c:170 -msgid "Enable/disable logging\n" -msgstr "" - -#: ../src/help.c:172 -msgid "Create a group chat where type: text | audio\n" -msgstr "" - -#: ../src/help.c:174 -msgid "Print your Tox ID\n" -msgstr "" - -#: ../src/help.c:176 -msgid "Clear window history\n" -msgstr "" - -#: ../src/help.c:178 -msgid "Close the current chat window\n" -msgstr "" - -#: ../src/help.c:180 -msgid "Exit Toxic\n" -msgstr "" - -#: ../src/help.c:184 ../src/help.c:224 -msgid "" -"\n" -" Audio:\n" -msgstr "" - -#: ../src/help.c:188 -msgid "List devices where type:" -msgstr "" - -#: ../src/help.c:191 -msgid "Set active device\n" -msgstr "" - -#: ../src/help.c:207 -msgid "Chat Commands:\n" -msgstr "" - -#: ../src/help.c:211 -msgid "Invite contact to a group chat\n" -msgstr "" - -#: ../src/help.c:213 -msgid "Join a pending group chat\n" -msgstr "" - -#: ../src/help.c:215 -msgid "Send a file\n" -msgstr "" - -#: ../src/help.c:217 -msgid "Receive a file\n" -msgstr "" - -#: ../src/help.c:219 -msgid "Cancel file transfer where type:" -msgstr "" - -#: ../src/help.c:228 -msgid "Audio call\n" -msgstr "" - -#: ../src/help.c:230 -msgid "Answer incoming call\n" -msgstr "" - -#: ../src/help.c:232 -msgid "Reject incoming call\n" -msgstr "" - -#: ../src/help.c:234 -msgid "Hangup active call\n" -msgstr "" - -#: ../src/help.c:236 -msgid "Change active device\n" -msgstr "" - -#: ../src/help.c:238 -msgid "Mute active device if in call\n" -msgstr "" - -#: ../src/help.c:240 -msgid "VAD sensitivity threshold\n" -msgstr "" - -#: ../src/help.c:256 -msgid "Key bindings:\n" -msgstr "" - -#: ../src/help.c:260 -msgid "Navigate through the tabs\n" -msgstr "" - -#: ../src/help.c:262 -msgid "Scroll window history one line\n" -msgstr "" - -#: ../src/help.c:264 -msgid "Scroll window history half a page\n" -msgstr "" - -#: ../src/help.c:266 -msgid "Move to the bottom of window history\n" -msgstr "" - -#: ../src/help.c:268 -msgid "Scroll peer list in groupchats\n" -msgstr "" - -#: ../src/help.c:270 -msgid "" -"Toggle the groupchat peerlist\n" -"\n" -msgstr "" - -#: ../src/help.c:271 -msgid "" -" (Note: Custom keybindings override these defaults.)\n" -"\n" -msgstr "" - -#: ../src/help.c:286 -msgid "Group commands:\n" -msgstr "" - -#: ../src/help.c:290 -msgid "" -"Set group title (show current title if no msg)\n" -"\n" -msgstr "" - -#: ../src/help.c:305 -msgid "Friendlist controls:\n" -msgstr "" - -#: ../src/help.c:308 -msgid " Up and Down arrows : Scroll through list\n" -msgstr "" - -#: ../src/help.c:309 -msgid "" -" Right and Left arrows : Switch between friendlist and blocked " -"list\n" -msgstr "" - -#: ../src/help.c:310 -msgid "" -" Enter : Open a chat window with selected contact\n" -msgstr "" - -#: ../src/help.c:311 -msgid " Delete : Permanently delete a contact\n" -msgstr "" - -#: ../src/help.c:313 -msgid "Block or unblock a contact\n" -msgstr "" - -#: ../src/line_info.c:50 -msgid "failed in line_info_init" -msgstr "" - -#: ../src/line_info.c:150 -msgid "failed in line_info_add" -msgstr "" - -#: ../src/log.c:189 -msgid "failed in load_chat_history" -msgstr "" - -#: ../src/log.c:193 ../src/log.c:199 -msgid " * Failed to read log file" -msgstr "" - -#: ../src/message_queue.c:56 -msgid "failed in cqueue_message" -msgstr "" - -#: ../src/misc_tools.c:240 ../src/misc_tools.c:248 -msgid "failed in get_file_name" -msgstr "" - -#: ../src/prompt.c:139 -#, c-format -msgid "Failed to set note (error %d)\n" -msgstr "" - -#: ../src/prompt.c:274 -msgid "ERROR" -msgstr "" - -#: ../src/prompt.c:278 -msgid "Online" -msgstr "" - -#: ../src/prompt.c:282 -msgid "Away" -msgstr "" - -#: ../src/prompt.c:286 -msgid "Busy" -msgstr "" - -#: ../src/prompt.c:299 -msgid " [Offline]" -msgstr "" - -#: ../src/prompt.c:369 ../src/prompt.c:372 -#, c-format -msgid "%s has come online" -msgstr "" - -#: ../src/prompt.c:381 ../src/prompt.c:384 -#, c-format -msgid "%s has gone offline" -msgstr "" - -#: ../src/prompt.c:395 ../src/prompt.c:396 -#, c-format -msgid "Friend request with the message '%s'" -msgstr "" - -#: ../src/prompt.c:401 -msgid "Friend request queue is full. Discarding request." -msgstr "" - -#: ../src/prompt.c:406 -#, c-format -msgid "Type \"%s %d\" or \"%s %d\"" -msgstr "" - -#: ../src/prompt.c:435 ../src/prompt.c:436 -#, c-format -msgid "Toxing on Toxic" -msgstr "" - -#: ../src/prompt.c:458 -msgid "" -"Welcome to Toxic, a free, open source Tox-based instant messenging client." -msgstr "" - -#: ../src/prompt.c:460 -#, c-format -msgid "Type \"%s\" for assistance. Further help may be found via the man page." -msgstr "" - -#: ../src/prompt.c:479 -msgid "failed in prompt_onInit" -msgstr "" - -#: ../src/prompt.c:517 -msgid "failed in new_prompt" -msgstr "" - -#: ../src/toxic.c:112 -#, c-format -msgid "Caught SIGSEGV: Aborting toxic session.\n" -msgstr "" - -#: ../src/toxic.c:161 -#, c-format -msgid "Toxic session aborted with error code %d (%s)\n" -msgstr "" - -#: ../src/toxic.c:171 -msgid "" -"Could not set your locale, please check your locale settings or disable " -"unicode support with the -d flag." -msgstr "" - -#: ../src/toxic.c:231 ../src/toxic.c:236 -msgid "Failed in queue_init_message" -msgstr "" - -#: ../src/toxic.c:328 -#, c-format -msgid "Failed to bootstrap %s:%d\n" -msgstr "" - -#: ../src/toxic.c:335 -#, c-format -msgid "Failed to add TCP relay %s:%d\n" -msgstr "" - -#: ../src/toxic.c:466 -#, c-format -msgid "Enter a new password (must be at least %d characters) " -msgstr "" - -#: ../src/toxic.c:476 -#, c-format -msgid "Password must be between %d and %d characters long. " -msgstr "" - -#: ../src/toxic.c:481 -#, c-format -msgid "Enter password again " -msgstr "" - -#: ../src/toxic.c:489 -#, c-format -msgid "Passwords don't match. Try again. " -msgstr "" - -#: ../src/toxic.c:496 -#, c-format -msgid "Data file '%s' is encrypted" -msgstr "" - -#: ../src/toxic.c:533 -#, c-format -msgid "tox_pass_encrypt() failed with error %d\n" -msgstr "" - -#: ../src/toxic.c:584 -msgid "Forcing IPv4 connection" -msgstr "" - -#: ../src/toxic.c:592 -#, c-format -msgid "Using %s proxy %s : %d" -msgstr "" - -#: ../src/toxic.c:597 -msgid "UDP disabled" -msgstr "" - -#: ../src/toxic.c:599 -msgid "" -"WARNING: Using a proxy without disabling UDP may leak your real IP address." -msgstr "" - -#: ../src/toxic.c:601 -msgid "Use the -t option to disable UDP." -msgstr "" - -#: ../src/toxic.c:620 ../src/toxic.c:627 ../src/toxic.c:635 ../src/toxic.c:712 -#: ../src/toxic.c:722 -msgid "failed in load_toxic" -msgstr "" - -#: ../src/toxic.c:639 -#, c-format -msgid "Data file '%s' has been unencrypted" -msgstr "" - -#: ../src/toxic.c:641 -#, c-format -msgid "Warning: passed --unencrypt-data option with unencrypted data file '%s'" -msgstr "" - -#: ../src/toxic.c:649 -#, c-format -msgid "Enter password (\"%s\" to quit) " -msgstr "" - -#: ../src/toxic.c:666 ../src/toxic.c:690 -#, c-format -msgid "Invalid password. Try again. " -msgstr "" - -#: ../src/toxic.c:693 -msgid "tox_pass_decrypt() failed" -msgstr "" - -#: ../src/toxic.c:737 -msgid "Falling back to ipv4" -msgstr "" - -#: ../src/toxic.c:743 -msgid "tox_new returned fatal error" -msgstr "" - -#: ../src/toxic.c:746 -#, c-format -msgid "tox_new returned non-fatal error %d" -msgstr "" - -#: ../src/toxic.c:753 -msgid "Toxic User" -msgstr "" - -#: ../src/toxic.c:779 -#, c-format -msgid "Auto-connect failed with error code %d" -msgstr "" - -#: ../src/toxic.c:860 -#, c-format -msgid "usage: toxic [OPTION] [FILE ...]\n" -msgstr "" - -#: ../src/toxic.c:862 -#, c-format -msgid "Force IPv4 connection\n" -msgstr "" - -#: ../src/toxic.c:864 -#, c-format -msgid "Enable stderr for debugging\n" -msgstr "" - -#: ../src/toxic.c:866 -#, c-format -msgid "Use specified config file\n" -msgstr "" - -#: ../src/toxic.c:868 -#, c-format -msgid "Use default POSIX locale\n" -msgstr "" - -#: ../src/toxic.c:870 -#, c-format -msgid "Encrypt an unencrypted data file\n" -msgstr "" - -#: ../src/toxic.c:872 -#, c-format -msgid "Use specified data file\n" -msgstr "" - -#: ../src/toxic.c:874 -#, c-format -msgid "Show this message and exit\n" -msgstr "" - -#: ../src/toxic.c:876 -#, c-format -msgid "Use specified DHTnodes file\n" -msgstr "" - -#: ../src/toxic.c:878 -#, c-format -msgid "Do not connect to the DHT network\n" -msgstr "" - -#: ../src/toxic.c:880 -#, c-format -msgid "Use SOCKS5 proxy: Requires [IP] [port]\n" -msgstr "" - -#: ../src/toxic.c:882 -#, c-format -msgid "Use HTTP proxy: Requires [IP] [port]\n" -msgstr "" - -#: ../src/toxic.c:884 -#, c-format -msgid "Use specified DNSservers file\n" -msgstr "" - -#: ../src/toxic.c:886 -#, c-format -msgid "Force TCP connection (use this with proxies)\n" -msgstr "" - -#: ../src/toxic.c:888 -#, c-format -msgid "Unencrypt an encrypted data file\n" -msgstr "" - -#: ../src/toxic.c:932 -msgid "stderr enabled" -msgstr "" - -#: ../src/toxic.c:939 -msgid "Config file not found" -msgstr "" - -#: ../src/toxic.c:945 -msgid "Using default POSIX locale" -msgstr "" - -#: ../src/toxic.c:958 -msgid "failed in parse_args" -msgstr "" - -#: ../src/toxic.c:963 -#, c-format -msgid "Using '%s' data file" -msgstr "" - -#: ../src/toxic.c:971 -msgid "DHTnodes file not found" -msgstr "" - -#: ../src/toxic.c:977 -msgid "DHT disabled" -msgstr "" - -#: ../src/toxic.c:985 ../src/toxic.c:995 -msgid "Proxy error" -msgstr "" - -#: ../src/toxic.c:1004 -msgid "DNSservers file not found" -msgstr "" - -#: ../src/toxic.c:1101 -#, c-format -msgid "Warning: Using \"%s\" and \"%s\" simultaneously has no effect" -msgstr "" - -#: ../src/toxic.c:1114 -msgid "Creating new data file. Would you like to encrypt it? Y/n (q to quit)" -msgstr "" - -#: ../src/toxic.c:1116 -msgid "Encrypt existing data file? Y/n (q to quit)" -msgstr "" - -#: ../src/toxic.c:1123 ../src/toxic.c:1146 ../src/toxic.c:1149 -#: ../src/toxic.c:1153 ../src/toxic.c:1161 -msgid "failed in main" -msgstr "" - -#: ../src/toxic.c:1130 -msgid "X failed to initialize" -msgstr "" - -#: ../src/toxic.c:1168 -msgid "Failed to init audio devices" -msgstr "" - -#: ../src/toxic.c:1177 -msgid "" -"Unable to determine configuration directory. Defaulting to 'data' for data " -"file..." -msgstr "" - -#: ../src/toxic.c:1182 -msgid "Failed to load user settings" -msgstr "" - -#: ../src/toxic.c:1186 -msgid "Failed to init mplex auto-away." -msgstr "" - -#: ../src/toxic.c:1209 -msgid "WARNING: Failed to save to data file" -msgstr "" - -#: ../src/toxic.h:43 -msgid "Anonymous" -msgstr "" - -#: ../src/toxic.h:44 -msgid "Tox User" -msgstr "" - -#: ../src/windows.c:368 -msgid "failed in set_next_window" -msgstr "" - -#: ../src/windows.c:390 -msgid "failed in init_windows" -msgstr "" From 904f58c0e82bfca903304da760491ec4eb8e3cc5 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Wed, 8 Jul 2015 21:01:32 -0400 Subject: [PATCH 21/33] Add option to enable acting as TCP relay server --- doc/toxic.1 | 9 +++++++-- doc/toxic.1.asc | 3 +++ doc/toxic.conf.5 | 4 ++-- src/toxic.c | 14 ++++++++++++-- src/windows.h | 2 ++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/doc/toxic.1 b/doc/toxic.1 index 242072c..af74931 100644 --- a/doc/toxic.1 +++ b/doc/toxic.1 @@ -2,12 +2,12 @@ .\" Title: toxic .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 2014-12-27 +.\" Date: 2015-03-28 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC" "1" "2014\-12\-27" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC" "1" "2015\-03\-28" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -111,6 +111,11 @@ Use specified DNSservers file Force TCP connection (use this with proxies) .RE .PP +\-T, \-\-tcp\-relay +.RS 4 +Act as a TCP relay server for the network (Note: this uses significantly more bandwidth) +.RE +.PP \-u, \-\-unencrypt\-data .RS 4 Unencrypt a data file\&. A warning will appear if this option is used with a data file that is already unencrypted\&. diff --git a/doc/toxic.1.asc b/doc/toxic.1.asc index 0ee3c06..4950c6b 100644 --- a/doc/toxic.1.asc +++ b/doc/toxic.1.asc @@ -59,6 +59,9 @@ OPTIONS -t, --force-tcp:: Force TCP connection (use this with proxies) +-T, --tcp-relay:: + Act as a TCP relay server for the network (Note: this uses significantly more bandwidth) + -u, --unencrypt-data:: Unencrypt a data file. A warning will appear if this option is used with a data file that is already unencrypted. diff --git a/doc/toxic.conf.5 b/doc/toxic.conf.5 index c1a6073..ad7066f 100644 --- a/doc/toxic.conf.5 +++ b/doc/toxic.conf.5 @@ -2,12 +2,12 @@ .\" Title: toxic.conf .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 2015-02-26 +.\" Date: 2015-03-28 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC\&.CONF" "5" "2015\-02\-26" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC\&.CONF" "5" "2015\-03\-28" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/src/toxic.c b/src/toxic.c index 9d14328..82acc5a 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -569,10 +569,14 @@ static void init_tox_options(struct Tox_Options *tox_opts) tox_opts->ipv6_enabled = !arg_opts.use_ipv4; tox_opts->udp_enabled = !arg_opts.force_tcp; tox_opts->proxy_type = arg_opts.proxy_type; + tox_opts->tcp_port = arg_opts.tcp_port; if (!tox_opts->ipv6_enabled) queue_init_message("Forcing IPv4 connection"); + if (tox_opts->tcp_port) + queue_init_message("TCP relaying enabled on port %d", tox_opts->tcp_port); + if (tox_opts->proxy_type != TOX_PROXY_TYPE_NONE) { tox_opts->proxy_port = arg_opts.proxy_port; tox_opts->proxy_host = arg_opts.proxy_address; @@ -860,7 +864,8 @@ static void print_usage(void) fprintf(stderr, " -p, --SOCKS5-proxy Use SOCKS5 proxy: Requires [IP] [port]\n"); fprintf(stderr, " -P, --HTTP-proxy Use HTTP proxy: Requires [IP] [port]\n"); fprintf(stderr, " -r, --dnslist Use specified DNSservers file\n"); - fprintf(stderr, " -t, --force-tcp Force TCP connection (use this with proxies)\n"); + fprintf(stderr, " -t, --force-tcp Force toxic to use a TCP connection (use with proxies)\n"); + fprintf(stderr, " -T, --tcp-server Act as a TCP relay server: Requires [port]\n"); fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n"); } @@ -888,13 +893,14 @@ static void parse_args(int argc, char *argv[]) {"noconnect", no_argument, 0, 'o'}, {"dnslist", required_argument, 0, 'r'}, {"force-tcp", no_argument, 0, 't'}, + {"tcp-server", required_argument, 0, 'T'}, {"SOCKS5-proxy", required_argument, 0, 'p'}, {"HTTP-proxy", required_argument, 0, 'P'}, {"unencrypt-data", no_argument, 0, 'u'}, {NULL, no_argument, NULL, 0}, }; - const char *opts_str = "4bdehotuxc:f:n:r:p:P:"; + const char *opts_str = "4bdehotuxc:f:n:r:p:P:T:"; int opt, indexptr; while ((opt = getopt_long(argc, argv, opts_str, long_opts, &indexptr)) != -1) { @@ -985,6 +991,10 @@ static void parse_args(int argc, char *argv[]) arg_opts.force_tcp = 1; break; + case 'T': + arg_opts.tcp_port = (uint16_t) atoi(optarg); + break; + case 'u': arg_opts.unencrypt_data = 1; break; diff --git a/src/windows.h b/src/windows.h index a3c9e8d..21e90bf 100644 --- a/src/windows.h +++ b/src/windows.h @@ -97,6 +97,8 @@ struct arg_opts { char proxy_address[256]; uint8_t proxy_type; uint16_t proxy_port; + + uint16_t tcp_port; }; typedef struct ToxWindow ToxWindow; From 688ea927f8b7741966693f86d43c0fc2de2e1923 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Wed, 8 Jul 2015 22:40:17 -0400 Subject: [PATCH 22/33] Update dht nodes list and fix URL's --- README.md | 4 ++-- misc/DHTnodes | 10 ++++++++-- src/toxic.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dd78dae..3e2dedb 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Toxic [![Build Status](https://travis-ci.org/Tox/toxic.png?branch=master)](https://travis-ci.org/Tox/toxic) -Toxic is a [Tox](https://tox.im)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. +Toxic is a [Tox](https://tox.chat)-based instant messenging client which formerly resided in the [Tox core repository](https://github.com/irungentoo/toxcore), and is now available as a standalone application. [![Toxic Screenshot](https://i.imgur.com/san99Z2.png "Home Screen")](https://i.imgur.com/san99Z2.png) ## Installation -[Use our repositories](https://wiki.tox.im/Binaries#Linux)
+[Use our repositories](https://wiki.tox.chat/doku.php?id=developers:binaries#other_linux)
[Compile it yourself](/INSTALL.md) ## Downloads diff --git a/misc/DHTnodes b/misc/DHTnodes index 3423527..cd1c92c 100644 --- a/misc/DHTnodes +++ b/misc/DHTnodes @@ -16,5 +16,11 @@ 192.3.173.88 33445 3E1FFDEB667BFF549F619EC6737834762124F50A89C8D0DBF1DDF64A2DD6CD1B 205.185.116.116 33445 A179B09749AC826FF01F37A9613F6B57118AE014D4196A0E1105A98F93A54702 198.98.51.198 33445 1D5A5F2F5D6233058BF0259B09622FB40B482E4FA0931EB8FD3AB8E7BF7DAF6F -80.232.246.79 33445 0B8DCEAA7BDDC44BB11173F987CAE3566A2D7057D8DD3CC642BD472B9391002A - +80.232.246.79 33445 A7A060D553B017D9D8F038E265C7AFB6C70BAAC55070197F9C007432D0038E0F +108.61.165.198 33445 8E7D0B859922EF569298B4D261A8CCB5FEA14FB91ED412A7603A585A25698832 +212.71.252.109 33445 C4CEB8C7AC607C6B374E2E782B3C00EA3A63B80D4910B8649CCACDD19F260819 +194.249.212.109 33445 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B +194.249.212.109 443 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B +103.38.216.87 33445 601AEE6FC8C17E8CD8F8F1FFC4D4AD84E59A73BE451F037194E7A404E3795320 +185.25.116.107 33445 DA4E4ED4B697F2E9B000EEFE3A34B554ACD3F45F5C96EAEA2516DD7FF9AF7B43 +192.99.168.140 33445 6A4D0607A296838434A6A7DDF99F50EF9D60A2C510BBF31FE538A25CB6B4652F diff --git a/src/toxic.c b/src/toxic.c index 82acc5a..1d64efc 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -251,7 +251,7 @@ static void print_init_messages(ToxWindow *toxwin) line_info_add(toxwin, NULL, NULL, NULL, SYS_MSG, 0, 0, init_messages.msgs[i]); } -#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.im = 6) */ +#define MIN_NODE_LINE 50 /* IP: 7 + port: 5 + key: 38 + spaces: 2 = 70. ! (& e.g. tox.chat = 8) */ #define MAX_NODE_LINE 256 /* Approx max number of chars in a sever line (name + port + key) */ #define MAXNODES 50 #define NODELEN (MAX_NODE_LINE - TOX_PUBLIC_KEY_SIZE - 7) From e83b397494f005e0ba5450dc0e9f75a939807774 Mon Sep 17 00:00:00 2001 From: Mykola Orliuk Date: Tue, 14 Jul 2015 08:27:07 +0300 Subject: [PATCH 23/33] Makefile: allow overriding pkg-config --- cfg/checks/av.mk | 4 ++-- cfg/checks/check_features.mk | 8 ++++---- cfg/checks/desktop_notifications.mk | 4 ++-- cfg/checks/sound_notifications.mk | 4 ++-- cfg/checks/x11.mk | 4 ++-- cfg/global_vars.mk | 3 +++ 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cfg/checks/av.mk b/cfg/checks/av.mk index 4d3837e..338cb4c 100644 --- a/cfg/checks/av.mk +++ b/cfg/checks/av.mk @@ -8,13 +8,13 @@ else endif # Check if we can build audio support -CHECK_AUDIO_LIBS = $(shell pkg-config --exists $(AUDIO_LIBS) || echo -n "error") +CHECK_AUDIO_LIBS = $(shell $(PKG_CONFIG) --exists $(AUDIO_LIBS) || echo -n "error") ifneq ($(CHECK_AUDIO_LIBS), error) LIBS += $(AUDIO_LIBS) CFLAGS += $(AUDIO_CFLAGS) OBJ += $(AUDIO_OBJ) else ifneq ($(MAKECMDGOALS), clean) - MISSING_AUDIO_LIBS = $(shell for lib in $(AUDIO_LIBS) ; do if ! pkg-config --exists $$lib ; then echo $$lib ; fi ; done) + MISSING_AUDIO_LIBS = $(shell for lib in $(AUDIO_LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done) $(warning WARNING -- Toxic will be compiled without audio support) $(warning WARNING -- You need these libraries for audio support) $(warning WARNING -- $(MISSING_AUDIO_LIBS)) diff --git a/cfg/checks/check_features.mk b/cfg/checks/check_features.mk index 430d1af..1b613db 100644 --- a/cfg/checks/check_features.mk +++ b/cfg/checks/check_features.mk @@ -25,12 +25,12 @@ ifneq ($(DESK_NOTIFY), disabled) endif # Check if we can build Toxic -CHECK_LIBS = $(shell pkg-config --exists $(LIBS) || echo -n "error") +CHECK_LIBS = $(shell $(PKG_CONFIG) --exists $(LIBS) || echo -n "error") ifneq ($(CHECK_LIBS), error) - CFLAGS += $(shell pkg-config --cflags $(LIBS)) - LDFLAGS += $(shell pkg-config --libs $(LIBS)) + CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBS)) + LDFLAGS += $(shell $(PKG_CONFIG) --libs $(LIBS)) else ifneq ($(MAKECMDGOALS), clean) - MISSING_LIBS = $(shell for lib in $(LIBS) ; do if ! pkg-config --exists $$lib ; then echo $$lib ; fi ; done) + MISSING_LIBS = $(shell for lib in $(LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done) $(warning ERROR -- Cannot compile Toxic) $(warning ERROR -- You need these libraries) $(warning ERROR -- $(MISSING_LIBS)) diff --git a/cfg/checks/desktop_notifications.mk b/cfg/checks/desktop_notifications.mk index 97d2531..edcdc4f 100644 --- a/cfg/checks/desktop_notifications.mk +++ b/cfg/checks/desktop_notifications.mk @@ -3,12 +3,12 @@ DESK_NOTIFY_LIBS = libnotify DESK_NOTIFY_CFLAGS = -DBOX_NOTIFY # Check if we can build desktop notifications support -CHECK_DESK_NOTIFY_LIBS = $(shell pkg-config --exists $(DESK_NOTIFY_LIBS) || echo -n "error") +CHECK_DESK_NOTIFY_LIBS = $(shell $(PKG_CONFIG) --exists $(DESK_NOTIFY_LIBS) || echo -n "error") ifneq ($(CHECK_DESK_NOTIFY_LIBS), error) LIBS += $(DESK_NOTIFY_LIBS) CFLAGS += $(DESK_NOTIFY_CFLAGS) else ifneq ($(MAKECMDGOALS), clean) - MISSING_DESK_NOTIFY_LIBS = $(shell for lib in $(DESK_NOTIFY_LIBS) ; do if ! pkg-config --exists $$lib ; then echo $$lib ; fi ; done) + MISSING_DESK_NOTIFY_LIBS = $(shell for lib in $(DESK_NOTIFY_LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done) $(warning WARNING -- Toxic will be compiled without desktop notifications support) $(warning WARNING -- You need these libraries for desktop notifications support) $(warning WARNING -- $(MISSING_DESK_NOTIFY_LIBS)) diff --git a/cfg/checks/sound_notifications.mk b/cfg/checks/sound_notifications.mk index e8dc699..b1a2d94 100644 --- a/cfg/checks/sound_notifications.mk +++ b/cfg/checks/sound_notifications.mk @@ -8,13 +8,13 @@ else endif # Check if we can build sound notifications support -CHECK_SND_NOTIFY_LIBS = $(shell pkg-config --exists $(SND_NOTIFY_LIBS) || echo -n "error") +CHECK_SND_NOTIFY_LIBS = $(shell $(PKG_CONFIG) --exists $(SND_NOTIFY_LIBS) || echo -n "error") ifneq ($(CHECK_SND_NOTIFY_LIBS), error) LIBS += $(SND_NOTIFY_LIBS) CFLAGS += $(SND_NOTIFY_CFLAGS) OBJ += $(SND_NOTIFY_OBJ) else ifneq ($(MAKECMDGOALS), clean) - MISSING_SND_NOTIFY_LIBS = $(shell for lib in $(SND_NOTIFY_LIBS) ; do if ! pkg-config --exists $$lib ; then echo $$lib ; fi ; done) + MISSING_SND_NOTIFY_LIBS = $(shell for lib in $(SND_NOTIFY_LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done) $(warning WARNING -- Toxic will be compiled without sound notifications support) $(warning WARNING -- You need these libraries for sound notifications support) $(warning WARNING -- $(MISSING_SND_NOTIFY_LIBS)) diff --git a/cfg/checks/x11.mk b/cfg/checks/x11.mk index 94c2f97..ba36831 100644 --- a/cfg/checks/x11.mk +++ b/cfg/checks/x11.mk @@ -4,13 +4,13 @@ X11_CFLAGS = -DX11 X11_OBJ = xtra.o # Check if we can build X11 support -CHECK_X11_LIBS = $(shell pkg-config --exists $(X11_LIBS) || echo -n "error") +CHECK_X11_LIBS = $(shell $(PKG_CONFIG) --exists $(X11_LIBS) || echo -n "error") ifneq ($(CHECK_X11_LIBS), error) LIBS += $(X11_LIBS) CFLAGS += $(X11_CFLAGS) OBJ += $(X11_OBJ) else ifneq ($(MAKECMDGOALS), clean) - MISSING_X11_LIBS = $(shell for lib in $(X11_LIBS) ; do if ! pkg-config --exists $$lib ; then echo $$lib ; fi ; done) + MISSING_X11_LIBS = $(shell for lib in $(X11_LIBS) ; do if ! $(PKG_CONFIG) --exists $$lib ; then echo $$lib ; fi ; done) $(warning WARNING -- Toxic will be compiled without x11 support (needed for focus tracking and drag&drop support)) $(warning WARNING -- You need these libraries for x11 support) $(warning WARNING -- $(MISSING_X11_LIBS)) diff --git a/cfg/global_vars.mk b/cfg/global_vars.mk index d5c7b57..5d192de 100644 --- a/cfg/global_vars.mk +++ b/cfg/global_vars.mk @@ -28,3 +28,6 @@ BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic MANDIR = $(PREFIX)/share/man APPDIR = $(PREFIX)/share/applications + +# Platform tools +PKG_CONFIG = pkg-config From 0047ba0e9f664b4c2ca202b7aa6c2dd63ed4ca81 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sat, 8 Aug 2015 12:55:46 -0400 Subject: [PATCH 24/33] fix rare bug preventing toxcore from sleeping --- src/toxic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toxic.c b/src/toxic.c index 1d64efc..9258c47 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -1048,7 +1048,7 @@ static int init_default_data_files(void) /* Adjusts usleep value so that tox_do runs close to the recommended number of times per second */ static useconds_t optimal_msleepval(uint64_t *looptimer, uint64_t *loopcount, uint64_t cur_time, useconds_t msleepval) { - useconds_t new_sleep = msleepval; + useconds_t new_sleep = MAX(msleepval, 3); ++(*loopcount); if (*looptimer == cur_time) From f559bdabfe28cf63b217c32cd6c8ec208bfb5536 Mon Sep 17 00:00:00 2001 From: JFreegman Date: Sat, 8 Aug 2015 16:51:04 -0400 Subject: [PATCH 25/33] Remove links to libtoxcore.so from readme --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index 3e2dedb..4301139 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,6 @@ Toxic is a [Tox](https://tox.chat)-based instant messenging client which formerl [Use our repositories](https://wiki.tox.chat/doku.php?id=developers:binaries#other_linux)
[Compile it yourself](/INSTALL.md) -## Downloads -If you don't like installation methods listed above, you can still download precompiled binaries from [jenkins](https://jenkins.libtoxcore.so): -* [Linux 32 bit](https://jenkins.libtoxcore.so/job/toxic_linux_i386/lastSuccessfulBuild/artifact/toxic_linux_i386.tar.xz) [![Build Status](https://jenkins.libtoxcore.so/job/toxic_linux_i386/badge/icon)](https://jenkins.libtoxcore.so/job/toxic_linux_i386/lastSuccessfulBuild/artifact/toxic_linux_i386.tar.xz) -* [Linux 64 bit](https://jenkins.libtoxcore.so/job/toxic_linux_amd64/lastSuccessfulBuild/artifact/toxic_linux_amd64.tar.xz) [![Build Status](https://jenkins.libtoxcore.so/job/toxic_linux_amd64/badge/icon)](https://jenkins.libtoxcore.so/job/toxic_linux_amd64/lastSuccessfulBuild/artifact/toxic_linux_amd64.tar.xz) -* [~~Linux ARMv6~~](https://jenkins.libtoxcore.so/job/toxic_linux_armv6/lastSuccessfulBuild/artifact/toxic_linux_armv6.tar.xz) **CURRENTLY DISABLED** [![Build Status](https://jenkins.libtoxcore.so/job/toxic_linux_armv6/badge/icon)](https://jenkins.libtoxcore.so/job/toxic_linux_armv6/lastSuccessfulBuild/artifact/toxic_linux_armv6.tar.xz) - -#### DEBs packages -* [toxic-i386.deb](https://jenkins.libtoxcore.so/job/toxic-linux-pkg/lastSuccessfulBuild/artifact/toxic-i386.deb) -* [toxic-x86_64.deb](https://jenkins.libtoxcore.so/job/toxic-linux-pkg/lastSuccessfulBuild/artifact/toxic-x86_64.deb) - -#### RPMs packages -* [toxic-i386.rpm](https://jenkins.libtoxcore.so/job/toxic-linux-pkg/lastSuccessfulBuild/artifact/toxic-i386.rpm) -* [toxic-x86_64.rpm](https://jenkins.libtoxcore.so/job/toxic-linux-pkg/lastSuccessfulBuild/artifact/toxic-x86_64.rpm) - ## Settings Running Toxic for the first time creates an empty file called toxic.conf in your home configuration directory ("~/.config/tox" for Linux users). Adding options to this file allows you to enable auto-logging, change the time format (12/24 hour), and much more. You can view our example config file [here](misc/toxic.conf.example). From 32e541bd1cf291dcfb7726315f73739f453685c1 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 10 Aug 2015 14:22:13 -0400 Subject: [PATCH 26/33] Fix file transfers breaking when friends go offline --- src/chat.c | 101 ++++++++++++++++++++++++++++++++++++++----- src/chat_commands.c | 1 + src/file_transfers.c | 4 +- src/file_transfers.h | 7 +-- 4 files changed, 97 insertions(+), 16 deletions(-) diff --git a/src/chat.c b/src/chat.c index f41958d..89cbe93 100644 --- a/src/chat.c +++ b/src/chat.c @@ -188,8 +188,8 @@ static void chat_onMessage(ToxWindow *self, Tox *m, uint32_t num, TOX_MESSAGE_TY return recv_action_helper(self, m, num, msg, len, nick, timefrmt); } -static void chat_resume_file_transfers(Tox *m, uint32_t fnum); -static void chat_stop_file_senders(Tox *m, uint32_t friendnum); +static void chat_pause_file_transfers(Tox *m, uint32_t friendnum); +static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t fnum); static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_CONNECTION connection_status) { @@ -209,7 +209,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C if (connection_status != TOX_CONNECTION_NONE && statusbar->connection == TOX_CONNECTION_NONE) { Friends.list[num].is_typing = user_settings->show_typing_other == SHOW_TYPING_ON ? tox_friend_get_typing(m, num, NULL) : false; - chat_resume_file_transfers(m, num); + chat_resume_file_senders(self, m, num); msg = "has come online"; line_info_add(self, timefrmt, nick, NULL, CONNECTION, 0, GREEN, msg); @@ -220,7 +220,7 @@ static void chat_onConnectionChange(ToxWindow *self, Tox *m, uint32_t num, TOX_C if (self->chatwin->self_is_typing) set_self_typingstatus(self, m, 0); - chat_stop_file_senders(m, num); + chat_pause_file_transfers(m, num); msg = "has gone offline"; line_info_add(self, timefrmt, nick, NULL, DISCONNECTION, 0, RED, msg); @@ -277,17 +277,44 @@ static void chat_onReadReceipt(ToxWindow *self, Tox *m, uint32_t num, uint32_t r cqueue_remove(self, m, receipt); } -/* Stops active file senders for this friend. Call when a friend goes offline */ -static void chat_stop_file_senders(Tox *m, uint32_t friendnum) +/* Stops active file transfers for this friend. Called when a friend goes offline */ +static void chat_pause_file_transfers(Tox *m, uint32_t friendnum) { - // TODO: core purges file transfers when a friend goes offline. Ideally we want to repair/resume - kill_all_file_transfers_friend(m, friendnum); + ToxicFriend *friend = &Friends.list[friendnum]; + + size_t i; + + for (i = 0; i < MAX_FILES; ++i) { + if (friend->file_sender[i].state >= FILE_TRANSFER_STARTED) + friend->file_sender[i].state = FILE_TRANSFER_PAUSED; + + if (friend->file_receiver[i].state >= FILE_TRANSFER_STARTED) + friend->file_receiver[i].state = FILE_TRANSFER_PAUSED; + } } -/* Tries to resume broken file transfers. Call when a friend comes online */ -static void chat_resume_file_transfers(Tox *m, uint32_t fnum) +/* Tries to resume broken file senders. Called when a friend comes online */ +static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t friendnum) { - // TODO + size_t i; + + for (i = 0; i < MAX_FILES; ++i) { + struct FileTransfer *ft = &Friends.list[friendnum].file_sender[i]; + + if (ft->state != FILE_TRANSFER_PAUSED) + continue; + + TOX_ERR_FILE_SEND err; + ft->filenum = tox_file_send(m, friendnum, TOX_FILE_KIND_DATA, ft->file_size, ft->file_id, + (uint8_t *) ft->file_name, strlen(ft->file_name), &err); + + if (err != TOX_ERR_FILE_SEND_OK) { + char msg[MAX_STR_SIZE]; + snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); + close_file_transfer(self, m, ft, -1, msg, notif_error); + continue; + } + } } static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, uint64_t position, @@ -428,12 +455,63 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint } } +/* Attempts to resume a broken inbound file transfer. + * + * Returns true if resume is successful. + */ +static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum) +{ + char msg[MAX_STR_SIZE]; + uint8_t file_id[TOX_FILE_ID_LENGTH]; + + if (!tox_file_get_file_id(m, friendnum, filenum, file_id, NULL)) + return false; + + bool resuming = false; + struct FileTransfer *ft = NULL; + size_t i; + + for (i = 0; i < MAX_FILES; ++i) { + ft = &Friends.list[friendnum].file_receiver[i]; + + if (ft->state == FILE_TRANSFER_INACTIVE) + continue; + + if (memcmp(ft->file_id, file_id, TOX_FILE_ID_LENGTH) == 0) { + ft->filenum = filenum; + resuming = true; + break; + } + } + + if (!resuming || !ft) + return false; + + if (!tox_file_seek(m, ft->friendnum, ft->filenum, ft->position, NULL)) + goto on_error; + + if (!tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_RESUME, NULL)) + goto on_error; + + ft->state = FILE_TRANSFER_STARTED; + return true; + +on_error: + snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); + close_file_transfer(self, m, ft, -1, msg, notif_error); + return false; +} + static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, uint64_t file_size, const char *filename, size_t name_length) { if (self->num != friendnum) return; + /* first check if we need to resume a broken transfer */ + if (chat_resume_broken_ft(self, m, friendnum, filenum)) + return; + struct FileTransfer *ft = get_new_file_receiver(friendnum); if (!ft) { @@ -500,6 +578,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ ft->file_type = TOX_FILE_KIND_DATA; snprintf(ft->file_path, sizeof(ft->file_path), "%s", file_path); snprintf(ft->file_name, sizeof(ft->file_name), "%s", filename); + tox_file_get_file_id(m, friendnum, filenum, ft->file_id, NULL); if (self->active_box != -1) box_notify2(self, transfer_pending, NT_WNDALERT_0 | NT_NOFOCUS, self->active_box, diff --git a/src/chat_commands.c b/src/chat_commands.c index 3352f47..ef9dbe0 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -278,6 +278,7 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv ft->friendnum = self->num; ft->direction = FILE_TRANSFER_SEND; ft->file_type = TOX_FILE_KIND_DATA; + tox_file_get_file_id(m, self->num, filenum, ft->file_id, NULL); char sizestr[32]; bytes_convert_str(sizestr, sizeof(sizestr), filesize); diff --git a/src/file_transfers.c b/src/file_transfers.c index 771f958..f4ce0e5 100644 --- a/src/file_transfers.c +++ b/src/file_transfers.c @@ -209,8 +209,6 @@ void close_file_transfer(ToxWindow *self, Tox *m, struct FileTransfer *ft, int C if (ft->file) fclose(ft->file); - memset(ft, 0, sizeof(struct FileTransfer)); - if (CTRL >= 0) tox_file_control(m, ft->friendnum, ft->filenum, (TOX_FILE_CONTROL) CTRL, NULL); @@ -222,6 +220,8 @@ void close_file_transfer(ToxWindow *self, Tox *m, struct FileTransfer *ft, int C line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s", message); } + + memset(ft, 0, sizeof(struct FileTransfer)); } /* Kills all active file transfers for friendnum */ diff --git a/src/file_transfers.h b/src/file_transfers.h index 52b19e1..39b2c30 100644 --- a/src/file_transfers.h +++ b/src/file_transfers.h @@ -30,8 +30,8 @@ #include "notify.h" #define KiB 1024 -#define MiB 1048576 /* 1024 ^ 2 */ -#define GiB 1073741824 /* 1024 ^ 3 */ +#define MiB 1048576 /* 1024^2 */ +#define GiB 1073741824 /* 1024^3 */ #define MAX_FILES 32 #define TIMEOUT_FILESENDER 120 @@ -40,7 +40,7 @@ typedef enum FILE_TRANSFER_STATE { FILE_TRANSFER_INACTIVE, FILE_TRANSFER_PENDING, FILE_TRANSFER_STARTED, - FILE_TRANSFER_PAUSED + FILE_TRANSFER_PAUSED, } FILE_TRANSFER_STATE; typedef enum FILE_TRANSFER_DIRECTION { @@ -63,6 +63,7 @@ struct FileTransfer { uint64_t position; uint64_t last_progress; uint32_t line_id; + uint8_t file_id[TOX_FILE_ID_LENGTH]; }; /* creates initial progress line that will be updated during file transfer. From c39f8909cd284c0480e7f2516bd42a7feef6a796 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Mon, 10 Aug 2015 20:41:11 -0400 Subject: [PATCH 27/33] Send file control cancel on failure to resume transfer --- src/chat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chat.c b/src/chat.c index 89cbe93..640c908 100644 --- a/src/chat.c +++ b/src/chat.c @@ -311,7 +311,7 @@ static void chat_resume_file_senders(ToxWindow *self, Tox *m, uint32_t friendnum if (err != TOX_ERR_FILE_SEND_OK) { char msg[MAX_STR_SIZE]; snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); - close_file_transfer(self, m, ft, -1, msg, notif_error); + close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); continue; } } @@ -490,7 +490,7 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u if (!tox_file_seek(m, ft->friendnum, ft->filenum, ft->position, NULL)) goto on_error; - if (!tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_RESUME, NULL)) + if (!tox_file_control(m, ft->friendnum, ft->filenum, TOX_FILE_CONTROL_RESUME, NULL)) goto on_error; ft->state = FILE_TRANSFER_STARTED; @@ -498,7 +498,7 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u on_error: snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", ft->file_name); - close_file_transfer(self, m, ft, -1, msg, notif_error); + close_file_transfer(self, m, ft, TOX_FILE_CONTROL_CANCEL, msg, notif_error); return false; } From 48ffae68a9f2c15ddcd0719654f768a8f8687648 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 11 Aug 2015 19:22:57 -0400 Subject: [PATCH 28/33] msg[0] == '>') wattron(win, COLOR_PAIR(GREEN)); + else if (line->msg[0] == '<') + wattron(win, COLOR_PAIR(RED)); wprintw(win, "%s", line->msg); if (line->msg[0] == '>') wattroff(win, COLOR_PAIR(GREEN)); + else if (line->msg[0] == '<') + wattroff(win, COLOR_PAIR(RED)); if (type == OUT_MSG && timed_out(line->timestamp, get_unix_time(), NOREAD_FLAG_TIMEOUT)) { wattron(win, COLOR_PAIR(RED)); From 083611f18eb5e927d6bd041d2d4923b3307804e4 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Thu, 13 Aug 2015 15:03:02 -0400 Subject: [PATCH 29/33] Update DHTnodes --- misc/DHTnodes | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/DHTnodes b/misc/DHTnodes index cd1c92c..705f56a 100644 --- a/misc/DHTnodes +++ b/misc/DHTnodes @@ -5,7 +5,6 @@ 178.21.112.187 33445 4B2C19E924972CB9B57732FB172F8A8604DE13EEDA2A6234E348983344B23057 195.154.119.113 33445 E398A69646B8CEACA9F0B84F553726C1C49270558C57DF5F3C368F05A7D71354 192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67 -104.219.184.206 443 8CD087E31C67568103E8C2A28653337E90E6B8EDA0D765D57C6B5172B4F1F04C 76.191.23.96 33445 93574A3FAB7D612FEA29FD8D67D3DD10DFD07A075A5D62E8AF3DD9F5D0932E11 46.38.239.179 33445 F5A1A38EFB6BD3C2C8AF8B10D85F0F89E931704D349F1D0720C3C4059AF2440A 178.62.250.138 33445 788236D34978D1D5BD822F0A5BEBD2C53C64CC31CD3149350EE27D4D9A2F9B6B From 48eaf8a14f5f72f0a9989f05baed837344a4234b Mon Sep 17 00:00:00 2001 From: Khalikin Viachaslau Date: Sat, 15 Aug 2015 15:42:32 +0000 Subject: [PATCH 30/33] fix a broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4301139..f4bbaee 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Toxic is a [Tox](https://tox.chat)-based instant messenging client which formerl [![Toxic Screenshot](https://i.imgur.com/san99Z2.png "Home Screen")](https://i.imgur.com/san99Z2.png) ## Installation -[Use our repositories](https://wiki.tox.chat/doku.php?id=developers:binaries#other_linux)
+[Use our repositories](https://wiki.tox.chat/binaries#other_linux)
[Compile it yourself](/INSTALL.md) ## Settings From 327259c4c823acb924ea79ff788c0b2e72168d4b Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 18 Aug 2015 01:46:22 -0400 Subject: [PATCH 31/33] simplify timeout function --- src/file_transfers.c | 11 +++++------ src/groupchat.c | 8 ++++---- src/line_info.c | 4 ++-- src/log.c | 6 ++---- src/message_queue.c | 6 ++---- src/misc_tools.c | 4 ++-- src/misc_tools.h | 2 +- src/toxic.c | 7 +++---- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/file_transfers.c b/src/file_transfers.c index f4ce0e5..3b1db20 100644 --- a/src/file_transfers.c +++ b/src/file_transfers.c @@ -80,13 +80,13 @@ void print_progress_bar(ToxWindow *self, double bps, double pct_done, uint32_t l line_info_set(self, line_id, msg); } -static void refresh_progress_helper(ToxWindow *self, struct FileTransfer *ft, uint64_t curtime) +static void refresh_progress_helper(ToxWindow *self, struct FileTransfer *ft) { if (ft->state == FILE_TRANSFER_INACTIVE) return; /* Timeout must be set to 1 second to show correct bytes per second */ - if (!timed_out(ft->last_progress, curtime, 1)) + if (!timed_out(ft->last_progress, 1)) return; double remain = ft->file_size - ft->position; @@ -94,18 +94,17 @@ static void refresh_progress_helper(ToxWindow *self, struct FileTransfer *ft, ui print_progress_bar(self, ft->bps, pct_done, ft->line_id); ft->bps = 0; - ft->last_progress = curtime; + ft->last_progress = get_unix_time(); } /* refreshes active file receiver status bars for friendnum */ void refresh_file_transfer_progress(ToxWindow *self, Tox *m, uint32_t friendnum) { - uint64_t curtime = get_unix_time(); size_t i; for (i = 0; i < MAX_FILES; ++i) { - refresh_progress_helper(self, &Friends.list[friendnum].file_receiver[i], curtime); - refresh_progress_helper(self, &Friends.list[friendnum].file_sender[i], curtime); + refresh_progress_helper(self, &Friends.list[friendnum].file_receiver[i]); + refresh_progress_helper(self, &Friends.list[friendnum].file_sender[i]); } } diff --git a/src/groupchat.c b/src/groupchat.c index 751679e..9eeac25 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -323,7 +323,7 @@ static void groupchat_onGroupTitleChange(ToxWindow *self, Tox *m, int groupnum, get_time_str(timefrmt, sizeof(timefrmt)); /* don't announce title when we join the room */ - if (!timed_out(groupchats[self->num].start_time, get_unix_time(), GROUP_EVENT_WAIT)) + if (!timed_out(groupchats[self->num].start_time, GROUP_EVENT_WAIT)) return; char nick[TOX_MAX_NAME_LENGTH]; @@ -402,7 +402,7 @@ void *group_add_wait(void *data) pthread_mutex_lock(&Winthread.lock); get_group_nick_truncate(m, peername, thrd->peernum, thrd->groupnum); - if (strcmp(peername, DEFAULT_TOX_NAME) || timed_out(thrd->timestamp, get_unix_time(), GROUP_EVENT_WAIT)) { + if (strcmp(peername, DEFAULT_TOX_NAME) || timed_out(thrd->timestamp, GROUP_EVENT_WAIT)) { pthread_mutex_unlock(&Winthread.lock); break; } @@ -478,7 +478,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu switch (change) { case TOX_CHAT_CHANGE_PEER_ADD: - if (!timed_out(groupchats[groupnum].start_time, get_unix_time(), GROUP_EVENT_WAIT)) + if (!timed_out(groupchats[groupnum].start_time, GROUP_EVENT_WAIT)) break; struct group_add_thrd *thrd = malloc(sizeof(struct group_add_thrd)); @@ -518,7 +518,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu break; case TOX_CHAT_CHANGE_PEER_NAME: - if (!timed_out(groupchats[self->num].start_time, get_unix_time(), GROUP_EVENT_WAIT)) + if (!timed_out(groupchats[self->num].start_time, GROUP_EVENT_WAIT)) return; /* ignore initial name change (TODO: this is a bad way to do this) */ diff --git a/src/line_info.c b/src/line_info.c index 05bbcb7..2283908 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -332,7 +332,7 @@ void line_info_print(ToxWindow *self) else if (line->msg[0] == '<') wattroff(win, COLOR_PAIR(RED)); - if (type == OUT_MSG && timed_out(line->timestamp, get_unix_time(), NOREAD_FLAG_TIMEOUT)) { + if (type == OUT_MSG && timed_out(line->timestamp, NOREAD_FLAG_TIMEOUT)) { wattron(win, COLOR_PAIR(RED)); wprintw(win, " x", line->msg); wattroff(win, COLOR_PAIR(RED)); @@ -359,7 +359,7 @@ void line_info_print(ToxWindow *self) wprintw(win, "%s %s %s", user_settings->line_normal, line->name1, line->msg); wattroff(win, COLOR_PAIR(YELLOW)); - if (type == OUT_ACTION && timed_out(line->timestamp, get_unix_time(), NOREAD_FLAG_TIMEOUT)) { + if (type == OUT_ACTION && timed_out(line->timestamp, NOREAD_FLAG_TIMEOUT)) { wattron(win, COLOR_PAIR(RED)); wprintw(win, " x", line->msg); wattroff(win, COLOR_PAIR(RED)); diff --git a/src/log.c b/src/log.c index f04c83d..0924eb1 100644 --- a/src/log.c +++ b/src/log.c @@ -139,11 +139,9 @@ void write_to_log(const char *msg, const char *name, struct chatlog *log, bool e strftime(s, MAX_STR_SIZE, t, get_time()); fprintf(log->file, "%s %s %s\n", s, name_frmt, msg); - uint64_t curtime = get_unix_time(); - - if (timed_out(log->lastwrite, curtime, LOG_FLUSH_LIMIT)) { + if (timed_out(log->lastwrite, LOG_FLUSH_LIMIT)) { fflush(log->file); - log->lastwrite = curtime; + log->lastwrite = get_unix_time(); } } diff --git a/src/message_queue.c b/src/message_queue.c index 70ccadb..881e512 100644 --- a/src/message_queue.c +++ b/src/message_queue.c @@ -140,9 +140,7 @@ void cqueue_try_send(ToxWindow *self, Tox *m) if (!msg) return; - uint64_t curtime = get_unix_time(); - - if (msg->receipt != 0 && !timed_out(msg->last_send_try, curtime, CQUEUE_TRY_SEND_INTERVAL)) + if (msg->receipt != 0 && !timed_out(msg->last_send_try, CQUEUE_TRY_SEND_INTERVAL)) return; uint32_t receipt = 0; @@ -150,7 +148,7 @@ void cqueue_try_send(ToxWindow *self, Tox *m) TOX_MESSAGE_TYPE type = msg->type == OUT_MSG ? TOX_MESSAGE_TYPE_NORMAL : TOX_MESSAGE_TYPE_ACTION; receipt = tox_friend_send_message(m, self->num, type, (uint8_t *) msg->message, msg->len, NULL); - msg->last_send_try = curtime; + msg->last_send_try = get_unix_time(); msg->receipt = receipt; return; } diff --git a/src/misc_tools.c b/src/misc_tools.c index 0d0a749..3734aa2 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -65,9 +65,9 @@ uint64_t get_unix_time(void) } /* Returns 1 if connection has timed out, 0 otherwise */ -int timed_out(uint64_t timestamp, uint64_t curtime, uint64_t timeout) +int timed_out(uint64_t timestamp, uint64_t timeout) { - return timestamp + timeout <= curtime; + return timestamp + timeout <= get_unix_time(); } /* Get the current local time */ diff --git a/src/misc_tools.h b/src/misc_tools.h index 6b20862..325411c 100644 --- a/src/misc_tools.h +++ b/src/misc_tools.h @@ -75,7 +75,7 @@ int wcs_to_mbs_buf(char *buf, const wchar_t *string, size_t n); int mbs_to_wcs_buf(wchar_t *buf, const char *string, size_t n); /* Returns 1 if connection has timed out, 0 otherwise */ -int timed_out(uint64_t timestamp, uint64_t timeout, uint64_t curtime); +int timed_out(uint64_t timestamp, uint64_t timeout); /* Colours the window tab according to type. Beeps if is_beep is true */ void alert_window(ToxWindow *self, int type, bool is_beep); diff --git a/src/toxic.c b/src/toxic.c index 9258c47..29cc80a 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -755,9 +755,8 @@ static uint64_t last_bootstrap_time = 0; static void do_bootstrap(Tox *m) { static int conn_err = 0; - uint64_t curtime = get_unix_time(); - if (!timed_out(last_bootstrap_time, curtime, TRY_BOOTSTRAP_INTERVAL)) + if (!timed_out(last_bootstrap_time, TRY_BOOTSTRAP_INTERVAL)) return; if (tox_self_get_connection_status(m) != TOX_CONNECTION_NONE) @@ -766,7 +765,7 @@ static void do_bootstrap(Tox *m) if (conn_err != 0) return; - last_bootstrap_time = curtime; + last_bootstrap_time = get_unix_time(); conn_err = init_connection(m); if (conn_err != 0) @@ -1189,7 +1188,7 @@ int main(int argc, char *argv[]) do_toxic(m, prompt); uint64_t cur_time = get_unix_time(); - if (timed_out(last_save, cur_time, AUTOSAVE_FREQ)) { + if (timed_out(last_save, AUTOSAVE_FREQ)) { pthread_mutex_lock(&Winthread.lock); if (store_data(m, DATA_FILE) != 0) line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, RED, "WARNING: Failed to save to data file"); From 2a787c109725731fba6cc2a07d1577a1dfffa1cf Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Tue, 18 Aug 2015 15:12:48 -0400 Subject: [PATCH 32/33] Fix some filetransfer issues - File transfers now timeout properly - Small refactor related to creating new transfers --- src/avatars.c | 8 +--- src/chat.c | 27 ++++++------- src/chat_commands.c | 9 +---- src/file_transfers.c | 93 +++++++++++++++++++++++++++++++++++++++----- src/file_transfers.h | 27 ++++++------- src/toxic.c | 1 + 6 files changed, 116 insertions(+), 49 deletions(-) diff --git a/src/avatars.c b/src/avatars.c index a17c3be..d58b27e 100644 --- a/src/avatars.c +++ b/src/avatars.c @@ -63,7 +63,7 @@ int avatar_send(Tox *m, uint32_t friendnum) return -1; } - struct FileTransfer *ft = get_new_file_sender(friendnum); + struct FileTransfer *ft = new_file_transfer(NULL, friendnum, filenum, FILE_TRANSFER_SEND, TOX_FILE_KIND_AVATAR); if (!ft) return -1; @@ -75,11 +75,6 @@ int avatar_send(Tox *m, uint32_t friendnum) snprintf(ft->file_name, sizeof(ft->file_name), "%s", Avatar.name); ft->file_size = Avatar.size; - ft->state = FILE_TRANSFER_PENDING; - ft->filenum = filenum; - ft->friendnum = friendnum; - ft->direction = FILE_TRANSFER_SEND; - ft->file_type = TOX_FILE_KIND_AVATAR; return 0; } @@ -206,4 +201,5 @@ void on_avatar_chunk_request(Tox *m, struct FileTransfer *ft, uint64_t position, fprintf(stderr, "tox_file_send_chunk failed in avatar callback (error %d)\n", err); ft->position += send_length; + ft->last_keep_alive = get_unix_time(); } diff --git a/src/chat.c b/src/chat.c index 640c908..720c86c 100644 --- a/src/chat.c +++ b/src/chat.c @@ -373,6 +373,7 @@ static void chat_onFileChunkRequest(ToxWindow *self, Tox *m, uint32_t friendnum, ft->position += send_length; ft->bps += send_length; + ft->last_keep_alive = get_unix_time(); } static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, uint64_t position, @@ -412,6 +413,7 @@ static void chat_onFileRecvChunk(ToxWindow *self, Tox *m, uint32_t friendnum, ui ft->bps += length; ft->position += length; + ft->last_keep_alive = get_unix_time(); } static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_t filenum, TOX_FILE_CONTROL control) @@ -427,14 +429,16 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint char msg[MAX_STR_SIZE]; switch (control) { - case TOX_FILE_CONTROL_RESUME: + case TOX_FILE_CONTROL_RESUME: { + ft->last_keep_alive = get_unix_time(); + /* transfer is accepted */ if (ft->state == FILE_TRANSFER_PENDING) { ft->state = FILE_TRANSFER_STARTED; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.", ft->index, ft->file_name); char progline[MAX_STR_SIZE]; - prep_prog_line(progline); + init_progress_bar(progline); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s", progline); sound_notify(self, silent, NT_NOFOCUS | NT_BEEP | NT_WNDALERT_2, NULL); ft->line_id = self->chatwin->hst->line_end->id + 2; @@ -443,15 +447,16 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, uint32_t friendnum, uint } break; - - case TOX_FILE_CONTROL_PAUSE: + } + case TOX_FILE_CONTROL_PAUSE: { ft->state = FILE_TRANSFER_PAUSED; break; - - case TOX_FILE_CONTROL_CANCEL: + } + case TOX_FILE_CONTROL_CANCEL: { snprintf(msg, sizeof(msg), "File transfer for '%s' was aborted.", ft->file_name); close_file_transfer(self, m, ft, -1, msg, notif_error); break; + } } } @@ -479,6 +484,8 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u if (memcmp(ft->file_id, file_id, TOX_FILE_ID_LENGTH) == 0) { ft->filenum = filenum; + ft->state = FILE_TRANSFER_STARTED; + ft->last_keep_alive = get_unix_time(); resuming = true; break; } @@ -493,7 +500,6 @@ static bool chat_resume_broken_ft(ToxWindow *self, Tox *m, uint32_t friendnum, u if (!tox_file_control(m, ft->friendnum, ft->filenum, TOX_FILE_CONTROL_RESUME, NULL)) goto on_error; - ft->state = FILE_TRANSFER_STARTED; return true; on_error: @@ -512,7 +518,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ if (chat_resume_broken_ft(self, m, friendnum, filenum)) return; - struct FileTransfer *ft = get_new_file_receiver(friendnum); + struct FileTransfer *ft = new_file_transfer(self, friendnum, filenum, FILE_TRANSFER_RECV, TOX_FILE_KIND_DATA); if (!ft) { tox_file_control(m, friendnum, filenum, TOX_FILE_CONTROL_CANCEL, NULL); @@ -570,12 +576,7 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_ line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Type '/savefile %d' to accept the file transfer.", ft->index); - ft->state = FILE_TRANSFER_PENDING; - ft->direction = FILE_TRANSFER_RECV; ft->file_size = file_size; - ft->friendnum = friendnum; - ft->filenum = filenum; - ft->file_type = TOX_FILE_KIND_DATA; snprintf(ft->file_path, sizeof(ft->file_path), "%s", file_path); snprintf(ft->file_name, sizeof(ft->file_name), "%s", filename); tox_file_get_file_id(m, friendnum, filenum, ft->file_id, NULL); diff --git a/src/chat_commands.c b/src/chat_commands.c index ef9dbe0..2a4b8e7 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -181,7 +181,7 @@ void cmd_savefile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv /* prep progress bar line */ char progline[MAX_STR_SIZE]; - prep_prog_line(progline); + init_progress_bar(progline); line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%s", progline); ft->line_id = self->chatwin->hst->line_end->id + 2; @@ -263,7 +263,7 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv if (err != TOX_ERR_FILE_SEND_OK) goto on_send_error; - struct FileTransfer *ft = get_new_file_sender(self->num); + struct FileTransfer *ft = new_file_transfer(self, self->num, filenum, FILE_TRANSFER_SEND, TOX_FILE_KIND_DATA); if (!ft) { err = TOX_ERR_FILE_SEND_TOO_MANY; @@ -271,13 +271,8 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv } memcpy(ft->file_name, file_name, namelen + 1); - ft->state = FILE_TRANSFER_PENDING; ft->file = file_to_send; ft->file_size = filesize; - ft->filenum = filenum; - ft->friendnum = self->num; - ft->direction = FILE_TRANSFER_SEND; - ft->file_type = TOX_FILE_KIND_DATA; tox_file_get_file_id(m, self->num, filenum, ft->file_id, NULL); char sizestr[32]; diff --git a/src/file_transfers.c b/src/file_transfers.c index 3b1db20..7cd915f 100644 --- a/src/file_transfers.c +++ b/src/file_transfers.c @@ -35,11 +35,52 @@ extern FriendsList Friends; -#define NUM_PROG_MARKS 50 /* number of "#"'s in file transfer progress bar. Keep well below MAX_STR_SIZE */ +/* number of "#"'s in file transfer progress bar. Keep well below MAX_STR_SIZE */ +#define NUM_PROG_MARKS 50 + +/* Checks for timed out file transfers and closes them. */ +#define CHECK_FILE_TIMEOUT_INTERAVAL 5 +void check_file_transfer_timeouts(Tox *m) +{ + char msg[MAX_STR_SIZE]; + static uint64_t last_check = 0; + + if (!timed_out(last_check, CHECK_FILE_TIMEOUT_INTERAVAL)) + return; + + last_check = get_unix_time(); + + size_t i, j; + + for (i = 0; i < Friends.max_idx; ++i) { + if (!Friends.list[i].active) + continue; + + for (j = 0; j < MAX_FILES; ++j) { + struct FileTransfer *ft_send = &Friends.list[i].file_sender[j]; + + if (ft_send->state > FILE_TRANSFER_PAUSED) { + if (timed_out(ft_send->last_keep_alive, TIMEOUT_FILESENDER)) { + snprintf(msg, sizeof(msg), "File transfer for '%s' timed out.", ft_send->file_name); + close_file_transfer(ft_send->window, m, ft_send, TOX_FILE_CONTROL_CANCEL, msg, notif_error); + } + } + + struct FileTransfer *ft_recv = &Friends.list[i].file_receiver[j]; + + if (ft_recv->state > FILE_TRANSFER_PAUSED) { + if (timed_out(ft_recv->last_keep_alive, TIMEOUT_FILESENDER)) { + snprintf(msg, sizeof(msg), "File transfer for '%s' timed out.", ft_recv->file_name); + close_file_transfer(ft_recv->window, m, ft_recv, TOX_FILE_CONTROL_CANCEL, msg, notif_error); + } + } + } + } +} /* creates initial progress line that will be updated during file transfer. Assumes progline is of size MAX_STR_SIZE */ -void prep_prog_line(char *progline) +void init_progress_bar(char *progline) { strcpy(progline, "0.0 B/s ["); int i; @@ -80,13 +121,13 @@ void print_progress_bar(ToxWindow *self, double bps, double pct_done, uint32_t l line_info_set(self, line_id, msg); } -static void refresh_progress_helper(ToxWindow *self, struct FileTransfer *ft) +static void refresh_progress_helper(ToxWindow *self, Tox *m, struct FileTransfer *ft) { if (ft->state == FILE_TRANSFER_INACTIVE) return; /* Timeout must be set to 1 second to show correct bytes per second */ - if (!timed_out(ft->last_progress, 1)) + if (!timed_out(ft->last_line_progress, 1)) return; double remain = ft->file_size - ft->position; @@ -94,17 +135,17 @@ static void refresh_progress_helper(ToxWindow *self, struct FileTransfer *ft) print_progress_bar(self, ft->bps, pct_done, ft->line_id); ft->bps = 0; - ft->last_progress = get_unix_time(); + ft->last_line_progress = get_unix_time(); } -/* refreshes active file receiver status bars for friendnum */ +/* refreshes active file transfer status bars. */ void refresh_file_transfer_progress(ToxWindow *self, Tox *m, uint32_t friendnum) { size_t i; for (i = 0; i < MAX_FILES; ++i) { - refresh_progress_helper(self, &Friends.list[friendnum].file_receiver[i]); - refresh_progress_helper(self, &Friends.list[friendnum].file_sender[i]); + refresh_progress_helper(self, m, &Friends.list[friendnum].file_receiver[i]); + refresh_progress_helper(self, m, &Friends.list[friendnum].file_sender[i]); } } @@ -156,7 +197,7 @@ struct FileTransfer *get_file_transfer_struct_index(uint32_t friendnum, uint32_t /* Returns a pointer to an unused file sender. * Returns NULL if all file senders are in use. */ -struct FileTransfer *get_new_file_sender(uint32_t friendnum) +static struct FileTransfer *new_file_sender(ToxWindow *window, uint32_t friendnum, uint32_t filenum, uint8_t type) { size_t i; @@ -164,7 +205,15 @@ struct FileTransfer *get_new_file_sender(uint32_t friendnum) struct FileTransfer *ft = &Friends.list[friendnum].file_sender[i]; if (ft->state == FILE_TRANSFER_INACTIVE) { + memset(ft, 0, sizeof(struct FileTransfer)); + ft->window = window; ft->index = i; + ft->friendnum = friendnum; + ft->filenum = filenum; + ft->file_type = type; + ft->last_keep_alive = get_unix_time(); + ft->state = FILE_TRANSFER_PENDING; + ft->direction = FILE_TRANSFER_SEND; return ft; } } @@ -175,7 +224,7 @@ struct FileTransfer *get_new_file_sender(uint32_t friendnum) /* Returns a pointer to an unused file receiver. * Returns NULL if all file receivers are in use. */ -struct FileTransfer *get_new_file_receiver(uint32_t friendnum) +static struct FileTransfer *new_file_receiver(ToxWindow *window, uint32_t friendnum, uint32_t filenum, uint8_t type) { size_t i; @@ -183,7 +232,15 @@ struct FileTransfer *get_new_file_receiver(uint32_t friendnum) struct FileTransfer *ft = &Friends.list[friendnum].file_receiver[i]; if (ft->state == FILE_TRANSFER_INACTIVE) { + memset(ft, 0, sizeof(struct FileTransfer)); + ft->window = window; ft->index = i; + ft->friendnum = friendnum; + ft->filenum = filenum; + ft->file_type = type; + ft->last_keep_alive = get_unix_time(); + ft->state = FILE_TRANSFER_PENDING; + ft->direction = FILE_TRANSFER_RECV; return ft; } } @@ -191,6 +248,22 @@ struct FileTransfer *get_new_file_receiver(uint32_t friendnum) return NULL; } +/* Initializes an unused file transfer and returns its pointer. + * Returns NULL on failure. + */ +struct FileTransfer *new_file_transfer(ToxWindow *window, uint32_t friendnum, uint32_t filenum, + FILE_TRANSFER_DIRECTION direction, uint8_t type) +{ + if (direction == FILE_TRANSFER_RECV) + return new_file_receiver(window, friendnum, filenum, type); + + if (direction == FILE_TRANSFER_SEND) + return new_file_sender(window, friendnum, filenum, type); + + return NULL; +} + + /* Closes file transfer ft. * * Set CTRL to -1 if we don't want to send a control signal. diff --git a/src/file_transfers.h b/src/file_transfers.h index 39b2c30..f5181a6 100644 --- a/src/file_transfers.h +++ b/src/file_transfers.h @@ -38,9 +38,9 @@ typedef enum FILE_TRANSFER_STATE { FILE_TRANSFER_INACTIVE, + FILE_TRANSFER_PAUSED, FILE_TRANSFER_PENDING, FILE_TRANSFER_STARTED, - FILE_TRANSFER_PAUSED, } FILE_TRANSFER_STATE; typedef enum FILE_TRANSFER_DIRECTION { @@ -49,31 +49,36 @@ typedef enum FILE_TRANSFER_DIRECTION { } FILE_TRANSFER_DIRECTION; struct FileTransfer { + ToxWindow *window; FILE *file; FILE_TRANSFER_STATE state; FILE_TRANSFER_DIRECTION direction; uint8_t file_type; char file_name[TOX_MAX_FILENAME_LENGTH + 1]; char file_path[PATH_MAX + 1]; /* Not used by senders */ - double bps; + double bps; uint32_t filenum; uint32_t friendnum; size_t index; uint64_t file_size; uint64_t position; - uint64_t last_progress; + uint64_t last_line_progress; /* The last time we updated the progress bar */ + uint64_t last_keep_alive; /* The last time we sent or received data */ uint32_t line_id; uint8_t file_id[TOX_FILE_ID_LENGTH]; }; +/* Checks for timed out file transfers and closes them. */ +void check_file_transfer_timeouts(Tox *m); + /* creates initial progress line that will be updated during file transfer. progline must be at lesat MAX_STR_SIZE bytes */ -void prep_prog_line(char *progline); +void init_progress_bar(char *progline); /* prints a progress bar for file transfers */ void print_progress_bar(ToxWindow *self, double pct_done, double bps, uint32_t line_id); -/* refreshes active file transfer status bars for friendnum */ +/* refreshes active file transfer status bars. */ void refresh_file_transfer_progress(ToxWindow *self, Tox *m, uint32_t friendnum); /* Returns a pointer to friendnum's FileTransfer struct associated with filenum. @@ -88,15 +93,11 @@ struct FileTransfer *get_file_transfer_struct(uint32_t friendnum, uint32_t filen struct FileTransfer *get_file_transfer_struct_index(uint32_t friendnum, uint32_t index, FILE_TRANSFER_DIRECTION direction); -/* Returns a pointer to an unused file sender. - * Returns NULL if all file senders are in use. +/* Initializes an unused file transfer and returns its pointer. + * Returns NULL on failure. */ -struct FileTransfer *get_new_file_sender(uint32_t friendnum); - -/* Returns a pointer to an unused file receiver. - * Returns NULL if all file receivers are in use. - */ -struct FileTransfer *get_new_file_receiver(uint32_t friendnum); +struct FileTransfer *new_file_transfer(ToxWindow *window, uint32_t friendnum, uint32_t filenum, + FILE_TRANSFER_DIRECTION direction, uint8_t type); /* Closes file transfer ft. * diff --git a/src/toxic.c b/src/toxic.c index 29cc80a..c6d1f55 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -780,6 +780,7 @@ static void do_toxic(Tox *m, ToxWindow *prompt) pthread_mutex_lock(&Winthread.lock); tox_iterate(m); do_bootstrap(m); + check_file_transfer_timeouts(m); pthread_mutex_unlock(&Winthread.lock); } From 92d76c7f99f22f0ab9b4e91c508857c22cfdf62a Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Wed, 19 Aug 2015 00:42:28 -0400 Subject: [PATCH 33/33] Display a user warning when log fails to initialize --- src/chat.c | 4 +++- src/global_commands.c | 12 +++++++----- src/groupchat.c | 4 +++- src/log.c | 10 +++++++--- src/log.h | 8 ++++++-- src/prompt.c | 4 +++- 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/chat.c b/src/chat.c index 720c86c..2671feb 100644 --- a/src/chat.c +++ b/src/chat.c @@ -1158,11 +1158,13 @@ static void chat_onInit(ToxWindow *self, Tox *m) char myid[TOX_ADDRESS_SIZE]; tox_self_get_address(m, (uint8_t *) myid); - log_enable(nick, myid, Friends.list[self->num].pub_key, ctx->log, LOG_CHAT); + int log_ret = log_enable(nick, myid, Friends.list[self->num].pub_key, ctx->log, LOG_CHAT); load_chat_history(self, ctx->log); if (!Friends.list[self->num].logging_on) log_disable(ctx->log); + else if (log_ret == -1) + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Warning: Log failed to initialize."); execute(ctx->history, self, m, "/log", GLOBAL_COMMAND_MODE); diff --git a/src/global_commands.c b/src/global_commands.c index fc7e3b8..b823b80 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -379,16 +379,18 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX char myid[TOX_ADDRESS_SIZE]; tox_self_get_address(m, (uint8_t *) myid); + int log_ret = -1; + if (self->is_chat) { Friends.list[self->num].logging_on = true; - log_enable(self->name, myid, Friends.list[self->num].pub_key, log, LOG_CHAT); + log_ret = log_enable(self->name, myid, Friends.list[self->num].pub_key, log, LOG_CHAT); } else if (self->is_prompt) { - log_enable(self->name, myid, NULL, log, LOG_PROMPT); + log_ret = log_enable(self->name, myid, NULL, log, LOG_PROMPT); } else if (self->is_groupchat) { - log_enable(self->name, myid, NULL, log, LOG_GROUP); + log_ret = log_enable(self->name, myid, NULL, log, LOG_GROUP); } - msg = "Logging enabled"; + msg = log_ret == 0 ? "Logging enabled." : "Warning: Log failed to initialize."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } else if (!strcmp(swch, "0") || !strcmp(swch, "off")) { @@ -397,7 +399,7 @@ void cmd_log(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX log_disable(log); - msg = "Logging disabled"; + msg = "Logging disabled."; line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); return; } diff --git a/src/groupchat.c b/src/groupchat.c index 9eeac25..9375e2d 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -729,7 +729,9 @@ static void groupchat_onInit(ToxWindow *self, Tox *m) if (user_settings->autolog == AUTOLOG_ON) { char myid[TOX_ADDRESS_SIZE]; tox_self_get_address(m, (uint8_t *) myid); - log_enable(self->name, myid, NULL, ctx->log, LOG_GROUP); + + if (log_enable(self->name, myid, NULL, ctx->log, LOG_GROUP) == -1) + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Warning: Log failed to initialize."); } execute(ctx->history, self, m, "/log", GLOBAL_COMMAND_MODE); diff --git a/src/log.c b/src/log.c index 0924eb1..edd49ea 100644 --- a/src/log.c +++ b/src/log.c @@ -153,15 +153,19 @@ void log_disable(struct chatlog *log) memset(log, 0, sizeof(struct chatlog)); } -void log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype) +int log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype) { log->log_on = true; if (log->file != NULL) - return; + return 0; - if (init_logging_session(name, selfkey, otherkey, log, logtype) == -1) + if (init_logging_session(name, selfkey, otherkey, log, logtype) == -1) { log_disable(log); + return -1; + } + + return 0; } /* Loads previous history from chat log */ diff --git a/src/log.h b/src/log.h index 103aafd..4bfa708 100644 --- a/src/log.h +++ b/src/log.h @@ -39,8 +39,12 @@ enum { /* formats/writes line to log file */ void write_to_log(const char *msg, const char *name, struct chatlog *log, bool event); -/* enables logging for specified log and creates/fetches file if necessary */ -void log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype); +/* enables logging for specified log and creates/fetches file if necessary. + * + * Returns 0 on success. + * Returns -1 on failure. + */ +int log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype); /* disables logging for specified log and closes file */ void log_disable(struct chatlog *log); diff --git a/src/prompt.c b/src/prompt.c index 7a189b0..17369de 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -477,7 +477,9 @@ static void prompt_onInit(ToxWindow *self, Tox *m) if (user_settings->autolog == AUTOLOG_ON) { char myid[TOX_ADDRESS_SIZE]; tox_self_get_address(m, (uint8_t *) myid); - log_enable(self->name, myid, NULL, ctx->log, LOG_PROMPT); + + if (log_enable(self->name, myid, NULL, ctx->log, LOG_PROMPT) == -1) + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Warning: Log failed to initialize."); } scrollok(ctx->history, 0);