mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
cmake: add gettext support
This commit is contained in:
parent
7e24c14f8c
commit
32714021f5
4 changed files with 23 additions and 4 deletions
|
@ -59,6 +59,7 @@ SET(FBVF "FISH-BUILD-VERSION-FILE")
|
|||
|
||||
# Set up config.h
|
||||
INCLUDE(cmake/ConfigureChecks.cmake)
|
||||
INCLUDE(cmake/gettext.cmake)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
|
|
@ -84,4 +84,3 @@ ENDIF()
|
|||
CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX)
|
||||
|
||||
# Not checked yet: non-varargs tparm ("Solaris tparm kludge")
|
||||
# Not checked yet: gettext
|
||||
|
|
22
cmake/gettext.cmake
Normal file
22
cmake/gettext.cmake
Normal file
|
@ -0,0 +1,22 @@
|
|||
SET(languages de en fr nb nn pl pt_BR sv zh_CN)
|
||||
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
OPTION(WITH_GETTEXT "translate messages if gettext is available" ON)
|
||||
IF(WITH_GETTEXT)
|
||||
FIND_PACKAGE(Intl)
|
||||
FIND_PACKAGE(Gettext)
|
||||
IF(GETTEXT_FOUND)
|
||||
SET(HAVE_GETTEXT 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ADD_FEATURE_INFO(gettext GETTEXT_FOUND "translate messages with gettext")
|
||||
|
||||
# Define translations
|
||||
IF(GETTEXT_FOUND)
|
||||
FOREACH(lang ${languages})
|
||||
GETTEXT_PROCESS_PO_FILES(${lang} ALL
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR}
|
||||
PO_FILES po/${lang}.po)
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
|
@ -139,9 +139,6 @@
|
|||
/* Define to 1 if tparm accepts a fixed amount of paramters. */
|
||||
// #cmakedefine TPARM_SOLARIS_KLUDGE 1
|
||||
|
||||
/* Perform string translations with gettext */
|
||||
// #cmakedefine USE_GETTEXT 1
|
||||
|
||||
/* The size of wchar_t in bits. */
|
||||
#define WCHAR_T_BITS ${WCHAR_T_BITS}
|
||||
|
||||
|
|
Loading…
Reference in a new issue