2015-09-20 18:22:40 +00:00
|
|
|
if( UNIX AND KICAD_I18N_UNIX_STRICT_PATH )
|
2015-09-19 09:00:02 +00:00
|
|
|
set( KICAD_I18N_PATH ${CMAKE_INSTALL_PREFIX}/share/locale
|
|
|
|
CACHE PATH "Location of KiCad i18n files." )
|
2022-01-31 23:57:56 +00:00
|
|
|
elseif( APPLE )
|
2021-02-20 23:54:40 +00:00
|
|
|
set( KICAD_I18N_PATH ${KICAD_DATA}/internat
|
|
|
|
CACHE PATH "Location of KiCad i18n files." )
|
2015-09-19 09:00:02 +00:00
|
|
|
else()
|
2015-09-19 09:17:40 +00:00
|
|
|
# Default Unix inconvenient locale lookup path
|
2015-09-19 09:00:02 +00:00
|
|
|
set( KICAD_I18N_PATH share/kicad/internat
|
|
|
|
CACHE PATH "Location of KiCad i18n files." )
|
|
|
|
endif()
|
|
|
|
|
2021-12-08 00:34:49 +00:00
|
|
|
file(STRINGS pofiles/LINGUAS_INSTALL LANG_ARRAY REGEX "^[^#].*")
|
2015-09-18 20:16:34 +00:00
|
|
|
|
2020-12-03 23:56:26 +00:00
|
|
|
# Add the commands to translate each language file
|
2015-09-18 16:53:02 +00:00
|
|
|
foreach( LANG ${LANG_ARRAY} )
|
2020-12-03 23:56:26 +00:00
|
|
|
set( OUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${LANG}/kicad.mo" )
|
2015-09-18 16:45:43 +00:00
|
|
|
|
2020-12-03 23:56:26 +00:00
|
|
|
translate_language( ${LANG} ${OUT_FILE} )
|
2015-09-18 16:53:02 +00:00
|
|
|
|
2020-12-03 23:56:26 +00:00
|
|
|
# Keep a list of the language files that are created to add to the target
|
|
|
|
list( APPEND LANG_FILES "${OUT_FILE}" )
|
2015-09-18 16:45:43 +00:00
|
|
|
endforeach()
|
|
|
|
|
2020-12-03 23:56:26 +00:00
|
|
|
# Add the target that executes the translation commands
|
|
|
|
add_custom_target( i18n ALL
|
|
|
|
DEPENDS ${LANG_FILES} )
|