diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-07-24 01:50:03 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-07-26 11:33:25 +0200 |
commit | ebcfca6def3541ee7d302fb4669ed969b596e0be (patch) | |
tree | 71d8caaec3ac05c4e21f84cb93891cf60b96d72f /translations/messages/CMakeLists.txt | |
parent | 3fc75f4d0a82dd095d40d38f5fe79684249b101d (diff) | |
download | tde-style-baghira-ebcfca6def3541ee7d302fb4669ed969b596e0be.tar.gz tde-style-baghira-ebcfca6def3541ee7d302fb4669ed969b596e0be.zip |
Move translations to a new directory layout.
Add support for LINGUAS for listing translations to install.
Rename translation catalogs to avoid potential collisions.
Fix UTF-8 in author name and strings.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e695196df6e48da48a7a4d99e55481c0a6b1d8fb)
Diffstat (limited to 'translations/messages/CMakeLists.txt')
-rw-r--r-- | translations/messages/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/translations/messages/CMakeLists.txt b/translations/messages/CMakeLists.txt new file mode 100644 index 0000000..75c89f8 --- /dev/null +++ b/translations/messages/CMakeLists.txt @@ -0,0 +1,14 @@ +file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po ) +string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" ) + +foreach( _po ${po_files} ) + get_filename_component( _lang ${_po} NAME_WE ) + if( "${_linguas}" MATCHES "^;*$" OR ";${_linguas};" MATCHES ";${_lang};" ) + if( "${_po}" MATCHES "^([^/]*)/.*" ) + string( REGEX REPLACE "^([^/]*)/.*" "\\1" _component "${_po}" ) + else( ) + set( _component "${PROJECT_NAME}" ) + endif( ) + tde_create_translation( FILES ${_po} LANG ${_lang} OUTPUT_NAME ${_component} ) + endif( ) +endforeach( ) |