From 8119713e4814251f4a7940a24efd157b15612c50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 20 Oct 2010 10:12:49 +0000 Subject: [PATCH] - Set LANGUAGES dynamically at build time, this allows easily add new languages just by placing .po into src/translations dir Changed files: build-languages-dynamic.patch -> 1.1 --- build-languages-dynamic.patch | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 build-languages-dynamic.patch diff --git a/build-languages-dynamic.patch b/build-languages-dynamic.patch new file mode 100644 index 0000000..2a6841e --- /dev/null +++ b/build-languages-dynamic.patch @@ -0,0 +1,54 @@ +Set LANGUAGES dynamically at build time, this allows easily add new languages +just by placing .po into src/translations dir + +Author: Elan Ruusamäe +--- clementine-0.5.3/src/CMakeLists.txt~ 2010-10-20 13:10:28.276756134 +0300 ++++ clementine-0.5.3/src/CMakeLists.txt 2010-10-20 13:10:33.456551043 +0300 +@@ -327,41 +327,12 @@ + + set(LINGUAS "All" CACHE STRING "A space-seperated list of translations to compile in to Clementine, or \"None\".") + if (LINGUAS STREQUAL "All") +- set (LANGUAGES +- ar +- bg +- ca +- cs +- da +- de +- el +- en_CA +- en_GB +- es +- fi +- fr +- gl +- hu +- it +- kk +- lt +- nb +- nl +- oc +- pl +- pt +- pt_BR +- ro +- ru +- sk +- sl +- sr +- sv +- tr +- uk +- zh_CN +- zh_TW +- ) ++ # build LANGUAGES from all existing .po files ++ file(GLOB pofiles translations/*.po) ++ foreach(pofile ${pofiles}) ++ get_filename_component(lang ${pofile} NAME_WE) ++ list(APPEND LANGUAGES ${lang}) ++ endforeach(pofile) + else (LINGUAS STREQUAL "All") + if (NOT LINGUAS OR LINGUAS STREQUAL "None") + set (LANGUAGES "") -- 2.43.0