diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-26 10:24:48 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-26 10:24:48 -0500 |
commit | 23f8696317143da03c3cd3688478b32b6912a351 (patch) | |
tree | fac5c14a25344630aff866b3caef8137084b4961 /src | |
parent | bb56564900b600a6c19acffa950615eb87dba42e (diff) | |
parent | 1a15cf84c29c984d600f438122edc70be2ac91a1 (diff) | |
download | rneovim-23f8696317143da03c3cd3688478b32b6912a351.tar.gz rneovim-23f8696317143da03c3cd3688478b32b6912a351.tar.bz2 rneovim-23f8696317143da03c3cd3688478b32b6912a351.zip |
Merge pull request #4277 from Jun-T/lang2locale
build: install *.mo into the "standard" directory
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/main.c | 8 | ||||
-rw-r--r-- | src/nvim/mbyte.c | 4 | ||||
-rw-r--r-- | src/nvim/os/env.c | 10 | ||||
-rw-r--r-- | src/nvim/po/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/nvim/vim.h | 6 |
5 files changed, 15 insertions, 17 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index d3cdfe3edf..a2aca65001 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -657,6 +657,9 @@ static void init_locale(void) setlocale(LC_NUMERIC, "C"); # endif +# ifdef LOCALE_INSTALL_DIR // gnu/linux standard: $prefix/share/locale + bindtextdomain(PROJECT_NAME, LOCALE_INSTALL_DIR); +# else // old vim style: $runtime/lang { char_u *p; @@ -665,11 +668,12 @@ static void init_locale(void) p = (char_u *)vim_getenv("VIMRUNTIME"); if (p != NULL && *p != NUL) { vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p); - bindtextdomain(VIMPACKAGE, (char *)NameBuff); + bindtextdomain(PROJECT_NAME, (char *)NameBuff); } xfree(p); - textdomain(VIMPACKAGE); } +# endif + textdomain(PROJECT_NAME); TIME_MSG("locale set"); } #endif diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index fdd83f9dac..f0a249919f 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -571,8 +571,8 @@ char_u * mb_init(void) #ifdef HAVE_WORKING_LIBINTL /* GNU gettext 0.10.37 supports this feature: set the codeset used for * translated messages independently from the current locale. */ - (void)bind_textdomain_codeset(VIMPACKAGE, - enc_utf8 ? "utf-8" : (char *)p_enc); + (void)bind_textdomain_codeset(PROJECT_NAME, + enc_utf8 ? "utf-8" : (char *)p_enc); #endif diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 41ce8ddbc2..384a17004e 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -759,15 +759,15 @@ char_u * home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET void vim_setenv(const char *name, const char *val) { os_setenv(name, val, 1); - /* - * When setting $VIMRUNTIME adjust the directory to find message - * translations to $VIMRUNTIME/lang. - */ +#ifndef LOCALE_INSTALL_DIR + // When setting $VIMRUNTIME adjust the directory to find message + // translations to $VIMRUNTIME/lang. if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0) { char *buf = (char *)concat_str((char_u *)val, (char_u *)"/lang"); - bindtextdomain(VIMPACKAGE, buf); + bindtextdomain(PROJECT_NAME, buf); xfree(buf); } +#endif } diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index d1e08db65e..184c4894b9 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -72,8 +72,8 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG) install_helper( FILES ${moFile} - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/lang/${name}/LC_MESSAGES - RENAME nvim.mo) + DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${name}/LC_MESSAGES + RENAME ${PROJECT_NAME}.mo) list(APPEND LANGUAGE_MO_FILES ${moFile}) endmacro() diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 762d349470..545b903d2f 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -27,12 +27,6 @@ Error: configure did not run properly.Check auto/config.log. # endif #endif - -/* Can't use "PACKAGE" here, conflicts with a Perl include file. */ -#ifndef VIMPACKAGE -# define VIMPACKAGE "nvim" -#endif - #include "nvim/os/os_defs.h" /* bring lots of system header files */ /// length of a buffer to store a number in ASCII (64 bits binary + NUL) |