-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile.locale
51 lines (38 loc) · 1.93 KB
/
Makefile.locale
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
XGETTEXT = xgettext
XGETTEXT_JS = tools/xgettext_php_js.py
XGETTEXT_ARGS = --no-wrap
MSGMERGE = msgmerge
MSGFMT = msgfmt
POJSON = pojson
LC_AUTHOR = FABtotum
LC_PACKAGE_NAME = FABUI
LC_FABUI_PHP_INPUT = $(wildcard fabui/application/*/*.php fabui/application/views/*/*.php fabui/application/views/*/*/*.php fabui/application/views/*/*/*/*.php fabui/application/views/*/*/*/*/*.php)
LC_FABUI_PY_INPUT = $(wildcard fabui/ext/py/*.py fabui/ext/py/fabtotum/*.py fabui/ext/py/fabtotum/*/*.py fabui/ext/py/fabtotum/*/*/*.py )
LC_FABUI_JS_INPUT = $(wildcard fabui/assets/js/fab.app.js fabui/application/*/*_js.php fabui/application/views/*/*_js.php fabui/application/views/*/*/*_js.php fabui/application/views/*/*/*/*_js.php fabui/application/views/*/*/*/*/*_js.php fabui/assets/js/std/jogcontrols.js fabui/assets/js/tours/*.js)
LC_FABUI_ALL_INPUT = $(LC_FABUI_PHP_INPUT) $(LC_FABUI_PY_INPUT) $(LC_FABUI_JS_INPUT)
LC_FABUI_PHP_PY_INPUT = $(LC_FABUI_PHP_INPUT) $(LC_FABUI_PY_INPUT)
LC_FABUI_OUTPUT = fabui/locale/fabui.pot
LC_LANGUAGES = locale.it locale.de
LC_JSON = fabui/locale/it/LC_MESSAGES/fabui.json fabui/locale/de/LC_MESSAGES/fabui.json
fabui/locale/fabui.pot: $(LC_FABUI_ALL_INPUT)
@echo "Creating" $@
$(XGETTEXT_JS) $(LC_FABUI_JS_INPUT) > fabui/locale/fabui_js.pot
@$(XGETTEXT) $(XGETTEXT_ARGS) \
-o $@ \
--copyright-holder=$(LC_AUTHOR) \
--package-name=$(LC_PACKAGE_NAME) \
$(LC_FABUI_PHP_PY_INPUT)
@$(XGETTEXT) $(XGETTEXT_ARGS) -j fabui/locale/fabui_js.pot \
-o $@ \
--copyright-holder=$(LC_AUTHOR) \
--package-name=$(LC_PACKAGE_NAME) \
$(LC_FABUI_PHP_PY_INPUT)
locale: $(LC_LANGUAGES) $(LC_JSON)
locale.%: fabui/locale/%/LC_MESSAGES/fabui.po fabui/locale/fabui.pot
$(MSGMERGE) $< $(LC_FABUI_OUTPUT) > new.po
cp new.po $<
rm new.po
fabui/locale/%/LC_MESSAGES/fabui.mo: fabui/locale/%/LC_MESSAGES/fabui.po
$(MSGFMT) $< -o $@
fabui/locale/%/LC_MESSAGES/fabui.json: fabui/locale/%/LC_MESSAGES/fabui.po
$(POJSON) $< > $@