diff options
| author | Adam <Adam@anope.org> | 2011-08-05 05:35:31 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-08-05 05:35:31 -0400 |
| commit | e66063e6304538d34c40460ca0aa2be5ddb6bdec (patch) | |
| tree | f50fe31097160f8f794669809e4f4ef87f477672 /modules/third | |
| parent | 9ec18a3b020932eee6242c878149c484f49b13cb (diff) | |
Rewrote the example configurations and split them
up into seperate files for each pseudo client.
Also reorganized how the modules are stored, and
made most of the old "extra" modules "core"
Diffstat (limited to 'modules/third')
| -rw-r--r-- | modules/third/README | 2 | ||||
| -rw-r--r-- | modules/third/language/CMakeLists.txt | 38 | ||||
| -rw-r--r-- | modules/third/language/README | 1 | ||||
| -rwxr-xr-x | modules/third/language/update.sh | 14 |
4 files changed, 55 insertions, 0 deletions
diff --git a/modules/third/README b/modules/third/README new file mode 100644 index 000000000..f960fba3e --- /dev/null +++ b/modules/third/README @@ -0,0 +1,2 @@ +Third party modules, eg, modules not shipped with Anope are to be placed here. +After doing so, run ./Config, make, make install and with some luck your module will work! diff --git a/modules/third/language/CMakeLists.txt b/modules/third/language/CMakeLists.txt new file mode 100644 index 000000000..af4dd90a6 --- /dev/null +++ b/modules/third/language/CMakeLists.txt @@ -0,0 +1,38 @@ +# Only do this if gettext is installed +if(GETTEXT_FOUND) + # Get all of the .po files + file(GLOB LANG_SRCS_PO RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.*.po") + sort_list(LANG_SRCS_PO) + + foreach(LANG_PO ${LANG_SRCS_PO}) + # Get the domain for this language file + string(LENGTH ${LANG_PO} LANG_PO_LENGTH) + math(EXPR DOMAIN_LENGTH "${LANG_PO_LENGTH} - 9") + string(SUBSTRING ${LANG_PO} 0 ${DOMAIN_LENGTH} LANG_DOMAIN) + + # Get the language for this language file + math(EXPR DOMAIN_LENGTH "${LANG_PO_LENGTH} - 8") + string(SUBSTRING ${LANG_PO} ${DOMAIN_LENGTH} 5 LANG_LANG) + + # Get the .mo file name + string(REGEX REPLACE "\\.po$" ".mo" LANG_MO ${LANG_PO}) + # Add the .mo file to a list for use later with add_custom_target + set(LANG_SRCS_MO ${LANG_SRCS_MO} ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO}) + # Run msgfmt on the language file, depends on the .po file + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -c ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_PO} -o ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} + MAIN_DEPENDENCY ${LANG_PO} + ) + # Add to cpack ignored files if not on Windows. + if(NOT WIN32) + add_to_cpack_ignored_files("${LANG_MO}") + endif(NOT WIN32) + + # Install the new language file + install(CODE "FILE(MAKE_DIRECTORY \${CMAKE_INSTALL_PREFIX}/data/languages/${LANG_LANG}/LC_MESSAGES/)") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION data/languages/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS}) + endforeach(LANG_PO) + + # Generate languages, depends on the mo files + add_custom_target(module_language DEPENDS ${LANG_SRCS_MO}) +endif(GETTEXT_FOUND) diff --git a/modules/third/language/README b/modules/third/language/README new file mode 100644 index 000000000..c86eeefba --- /dev/null +++ b/modules/third/language/README @@ -0,0 +1 @@ +Language files for third party modules are to go here. diff --git a/modules/third/language/update.sh b/modules/third/language/update.sh new file mode 100755 index 000000000..1f16ea961 --- /dev/null +++ b/modules/third/language/update.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +for f in `ls ../*.cpp` +do + BASE=`basename $f | cut -d'.' -f1` + xgettext -C -s -d $BASE -o $BASE.pot --from-code=utf-8 --keyword --keyword=_ $f +done + +for f in `ls *.po` +do + msgmerge -v -s -U $f `basename $f | cut -d'.' -f1`.pot +done + +rm -f *~ |
