mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-12 17:06:45 +02:00
Add localization system (gettext)
This commit is contained in:
@ -24,6 +24,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef NO_GETTEXT
|
||||
#define gettext(A) (A)
|
||||
#else
|
||||
#include <libintl.h>
|
||||
#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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user