From 779bcb955c583e633e790f9f6b2c8333378ddec2 Mon Sep 17 00:00:00 2001 From: "jan@dwrox.net" Date: Thu, 9 Feb 2017 23:04:40 +0100 Subject: [PATCH] Fixing path for gettext context --- kiss-front-jessie.c | 6 +++++- kiss-front.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kiss-front-jessie.c b/kiss-front-jessie.c index c5ef4b3..4e4cf26 100644 --- a/kiss-front-jessie.c +++ b/kiss-front-jessie.c @@ -155,8 +155,12 @@ int main(int argc, char *argv[]) { setlocale(LC_ALL, ""); // TODO: Setup the bindtextdomain to look in "/usr/share/locale" instead of current folder // NOTE: Translations have to set at bindtextdomain path + "de_DE/LC_MESSAGES/KISSebook.mo" for german translation - bindtextdomain("KISSebook", ""); + char *localPath = malloc(2048 * sizeof(char)); + getcwd(localPath, 2048); + + bindtextdomain("KISSebook", localPath); textdomain("KISSebook"); + free(localPath); char homePath[512]; sprintf(homePath, "%s/.kissebook", getenv("HOME")); diff --git a/kiss-front.c b/kiss-front.c index a51b632..56607e1 100644 --- a/kiss-front.c +++ b/kiss-front.c @@ -155,8 +155,12 @@ int main(int argc, char *argv[]) { setlocale(LC_ALL, ""); // TODO: Setup the bindtextdomain to look in "/usr/share/locale" instead of current folder // NOTE: Translations have to set at bindtextdomain path + "de_DE/LC_MESSAGES/KISSebook.mo" for german translation - bindtextdomain("KISSebook", ""); + char *localPath = malloc(2048 * sizeof(char)); + getcwd(localPath, 2048); + + bindtextdomain("KISSebook", localPath); textdomain("KISSebook"); + free(localPath); char homePath[512]; sprintf(homePath, "%s/.kissebook", getenv("HOME"));