diff --git a/CMakeLists.txt b/CMakeLists.txt index 598f997..f9523f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/config.h.in b/cmake/config.h.in index 673cdec..4a33c84 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -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@" - diff --git a/po/prozilla.pot b/po/prozilla.pot index 5e448ec..6ad580b 100644 --- a/po/prozilla.pot +++ b/po/prozilla.pot @@ -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" diff --git a/src/main.cpp b/src/main.cpp index ede383e..c9b3321 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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();