Enable runtime translations

This commit is contained in:
Mario Fetka
2026-07-15 07:01:01 +02:00
parent 5bac50f36f
commit 00473056a9
4 changed files with 12 additions and 8 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
project(prozilla VERSION 2.2.4 LANGUAGES C CXX)
project(prozilla VERSION 2.2.5 LANGUAGES C CXX)
include(GNUInstallDirs)
@@ -19,6 +19,8 @@ find_package(Curses REQUIRED)
find_package(Intl)
find_package(libprozilla CONFIG REQUIRED)
set(ENABLE_NLS ${Intl_FOUND})
option(PROZILLA_BUILD_CLI "Build the proz command-line client" ON)
set(CMAKE_C_STANDARD 11)
+1 -1
View File
@@ -33,6 +33,7 @@
#cmakedefine01 HAVE_STRERROR
#cmakedefine01 HAVE_STRNCASECMP
#cmakedefine01 HAVE_VSNPRINTF
#cmakedefine01 ENABLE_NLS
#define PACKAGE "@PACKAGE@"
#define PACKAGE_NAME "@PACKAGE_NAME@"
@@ -40,4 +41,3 @@
#define VERSION "@VERSION@"
#define LOCALEDIR "@LOCALEDIR@"
#define GLOBAL_CONF_FILE "@GLOBAL_CONF_FILE@"
+1 -1
View File
@@ -6,7 +6,7 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: prozilla 2.2.4\n"
"Project-Id-Version: prozilla 2.2.5\n"
"Report-Msgid-Bugs-To: prozilla-dev@disconnected-by-peer.at\n"
"POT-Creation-Date: 2026-07-14 20:35+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+7 -5
View File
@@ -220,6 +220,13 @@ main(int argc, char **argv)
int ret;
char *opt_file = NULL;
/* Initialise gettext before parsing options so --help, --version and
command-line errors use the selected locale as well. */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
bind_textdomain_codeset(PACKAGE, "UTF-8");
textdomain(PACKAGE);
proz_init(argc, argv); //init libprozilla
set_defaults(); //set some reasonable defaults
load_prefs(); //load values from the config file
@@ -498,11 +505,6 @@ main(int argc, char **argv)
}
else
{
/* Gettext stuff */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
/*delete the ~/.prozilla/debug.log file if present at the start of each run */
proz_debug_delete_log();