1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 20:26:46 +02:00

Add localization system (gettext)

This commit is contained in:
Ansa89
2015-05-25 16:38:52 +02:00
parent d0a7ca17d2
commit 85d3c18ba6
36 changed files with 5535 additions and 437 deletions

View File

@ -28,6 +28,12 @@
#include <dirent.h>
#include <sys/stat.h>
#ifdef NO_GETTEXT
#define gettext(A) (A)
#else
#include <libintl.h>
#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, '/');