############################################
#                                          #
#  Improvements and feedback are welcome   #
#                                          #
#  This file is released under GPL >= 2    #
#                                          #
############################################


##### translation languages #################

string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )

file( GLOB _po_languages RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" )
foreach( _lang IN LISTS _po_languages )
  if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_lang}" )
    if( "${_linguas}" MATCHES "^;*$"
        OR ";${_linguas};" MATCHES ";${_lang};" )
      file( GLOB _po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${_lang}/*.po" )
      if( _po_files )
        tde_create_translation( FILES ${_po_files} LANG ${_lang} )
      endif()
    endif( )
  endif()
endforeach( )
