diff options
author | dundargoc <gocdundar@gmail.com> | 2025-02-27 20:03:26 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2025-03-02 02:29:25 +0100 |
commit | 188ec19894e4d3abadec7b9a43fecf62dd77b376 (patch) | |
tree | f2d2383fdc5dfcb8ccba3eda14263c59cba2fceb | |
parent | 13513835798c732554de277229d4c6744df11502 (diff) | |
download | rneovim-188ec19894e4d3abadec7b9a43fecf62dd77b376.tar.gz rneovim-188ec19894e4d3abadec7b9a43fecf62dd77b376.tar.bz2 rneovim-188ec19894e4d3abadec7b9a43fecf62dd77b376.zip |
build!: turn off translations by default
The translation step prolongs the build time too much to be enabled by
default. Enable it by passing cmake flag `ENABLE_TRANSLATIONS=ON`.
-rw-r--r-- | runtime/doc/news.txt | 4 | ||||
-rw-r--r-- | src/nvim/po/CMakeLists.txt | 10 | ||||
-rw-r--r-- | test/cmakeconfig/paths.lua.in | 1 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 1 | ||||
-rw-r--r-- | test/testutil.lua | 4 |
5 files changed, 15 insertions, 5 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index b9c1e55305..1a6537fa8d 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -66,7 +66,9 @@ API BUILD -On Windows, only building with the UCRT runtime is supported. +• On Windows, only building with the UCRT runtime is supported. +• Translations are turned off by default. Enable by building Nvim with the + CMake flag `ENABLE_TRANSLATIONS=ON`. DEFAULTS diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index 348ba2881c..f0436a2743 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -1,3 +1,8 @@ +option(ENABLE_TRANSLATIONS "Localizations to build" OFF) +if(NOT ENABLE_TRANSLATIONS) + return() +endif() + find_package(Gettext REQUIRED) find_program(XGETTEXT_PRG xgettext) find_program(ICONV_PRG iconv) @@ -7,8 +12,7 @@ mark_as_advanced( ICONV_PRG XGETTEXT_PRG) -option(ENABLE_LANGUAGES "Localizations to build" ON) -if(ENABLE_LANGUAGES) +if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG) set(LANGUAGES af ca @@ -36,9 +40,7 @@ if(ENABLE_LANGUAGES) vi zh_CN.UTF-8 zh_TW.UTF-8) -endif() -if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG) set(ENV{OLD_PO_FILE_INPUT} yes) set(ENV{OLD_PO_FILE_OUTPUT} yes) diff --git a/test/cmakeconfig/paths.lua.in b/test/cmakeconfig/paths.lua.in index 78c66a4eac..334b5517b5 100644 --- a/test/cmakeconfig/paths.lua.in +++ b/test/cmakeconfig/paths.lua.in @@ -5,6 +5,7 @@ for p in ("${TEST_INCLUDE_DIRS}" .. ";"):gmatch("[^;]+") do table.insert(M.include_paths, p) end +M.translations_enabled = "${ENABLE_TRANSLATIONS}" == "ON" M.vterm_test_file = "${VTERM_TEST_FILE}" M.test_build_dir = "${CMAKE_BINARY_DIR}" M.test_source_path = "${CMAKE_SOURCE_DIR}" diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 83abf77ae6..4770c5e143 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -2424,6 +2424,7 @@ end) describe('ui/msg_puts_printf', function() it('output multibyte characters correctly', function() + skip(not t.translations_enabled(), 'Nvim not built with ENABLE_TRANSLATIONS') local screen local cmd = '' local locale_dir = test_build_dir .. '/share/locale/ja/LC_MESSAGES' diff --git a/test/testutil.lua b/test/testutil.lua index 3655a87d93..cb8ff5ed49 100644 --- a/test/testutil.lua +++ b/test/testutil.lua @@ -840,4 +840,8 @@ function M.skip_fragile(pending_fn, cond) return false end +function M.translations_enabled() + return M.paths.translations_enabled +end + return M |