bindtextdomain point to relative path to bin directory

This commit is contained in:
Luis Díaz Más 2018-11-09 14:39:07 +01:00
parent 7485bb54d7
commit d1c2e2f64f
3 changed files with 15 additions and 11 deletions

View File

@ -217,8 +217,7 @@ set_target_properties( exiv2lib_int PROPERTIES
target_compile_definitions(exiv2lib
PUBLIC
EXV_LOCALEDIR="../${CMAKE_INSTALL_LOCALEDIR}"
#EXV_LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
EXV_LOCALEDIR="/../${CMAKE_INSTALL_LOCALEDIR}"
)
if ( UNIX AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )

View File

@ -29,12 +29,13 @@
#include <exiv2/exiv2.hpp>
// include local header files which are not part of libexiv2
#include "exiv2app.hpp"
#include "getopt.hpp"
#include "actions.hpp"
#include "utils.hpp"
#include "convert.hpp"
#include "i18n.h" // NLS support.
#include "exiv2app.hpp"
#include "futils.hpp"
#include "getopt.hpp"
#include "i18n.h" // NLS support.
#include "utils.hpp"
#include "xmp_exiv2.hpp"
#include <iostream>
@ -128,7 +129,8 @@ int main(int argc, char* const argv[])
{
#ifdef EXV_ENABLE_NLS
setlocale(LC_ALL, "");
bindtextdomain(EXV_PACKAGE_NAME, EXV_LOCALEDIR);
const std::string localeDir = Exiv2::getProcessPath() + EXV_LOCALEDIR;
bindtextdomain(EXV_PACKAGE_NAME, localeDir.c_str());
textdomain(EXV_PACKAGE_NAME);
#endif

View File

@ -26,10 +26,11 @@
// *****************************************************************************
// included header files
#include "types.hpp"
#include "i18n.h" // for _exvGettext
#include "unused.h"
#include "safe_op.hpp"
#include "enforce.hpp"
#include "futils.hpp"
#include "i18n.h" // for _exvGettext
#include "safe_op.hpp"
#include "unused.h"
// + standard includes
#ifdef EXV_UNICODE_PATH
@ -727,7 +728,9 @@ const char* _exvGettext(const char* str)
static bool exvGettextInitialized = false;
if (!exvGettextInitialized) {
bindtextdomain(EXV_PACKAGE_NAME, EXV_LOCALEDIR);
//bindtextdomain(EXV_PACKAGE_NAME, EXV_LOCALEDIR);
const std::string localeDir = Exiv2::getProcessPath() + EXV_LOCALEDIR;
bindtextdomain(EXV_PACKAGE_NAME, localeDir.c_str());
# ifdef EXV_HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (EXV_PACKAGE_NAME, "UTF-8");
# endif