summaryrefslogtreecommitdiff
path: root/manager/res/po/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'manager/res/po/CMakeLists.txt')
-rwxr-xr-xmanager/res/po/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/manager/res/po/CMakeLists.txt b/manager/res/po/CMakeLists.txt
new file mode 100755
index 0000000..e07b7e2
--- /dev/null
+++ b/manager/res/po/CMakeLists.txt
@@ -0,0 +1,23 @@
+# for i18n
+
+FILE(GLOB POFILES *.po)
+
+SET(MSGFMT "${TZ_SYS_BIN}/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION ${APP_LOCALEDIR}/${lang}/LC_MESSAGES RENAME message.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})