Add framework for translating ZNC to different languages

This commit is contained in:
Alexey Sokolov
2016-01-21 08:19:20 +00:00
parent 10785ee90e
commit 8eeeaf71a0
26 changed files with 797 additions and 54 deletions
+14 -1
View File
@@ -75,10 +75,19 @@ else()
set(moddisable_modtcl true)
endif()
set(actual_modules)
foreach(modpath ${all_modules})
string(REGEX MATCH "/([-a-zA-Z0-9_]+)\\.([a-z]+)$" unused "${modpath}")
if(NOT "${modpath}" MATCHES "/([-a-zA-Z0-9_]+)\\.([a-z]+)$")
continue()
endif()
set(mod "${CMAKE_MATCH_1}")
set(modtype "${CMAKE_MATCH_2}")
if(mod STREQUAL "CMakeLists" OR mod STREQUAL "Makefile")
continue()
endif()
list(APPEND actual_modules "${modpath}")
set(modenabled true)
@@ -107,5 +116,9 @@ foreach(modpath ${all_modules})
endif()
endforeach()
if(HAVE_I18N)
add_subdirectory(po)
endif()
install(DIRECTORY data/
DESTINATION "${CMAKE_INSTALL_DATADIR}/znc/modules")
+24
View File
@@ -0,0 +1,24 @@
#
# Copyright (C) 2004-2016 ZNC, see the NOTICE file for details.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
include(translation)
foreach(modpath ${actual_modules})
get_filename_component(mod "${modpath}" NAME_WE)
get_filename_component(module "${modpath}" NAME)
translation(SHORT "${mod}" FULL "znc-${mod}" SOURCES "${module}"
TMPLDIRS "${CMAKE_CURRENT_SOURCE_DIR}/../data/${mod}/tmpl")
endforeach()