Ignore:
Timestamp:
2012-08-01T10:00:21+02:00 (3 years ago)
Author:
moo
Message:

devel: use gettext to scan translate string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/devel/prepare.mak

    r1095 r1101  
    66.PHONY: dummy
    77.PHONY: all
    8 all: xcache/xc_opcode_spec_def.h xc_const_string tags
     8all: xcache/xc_opcode_spec_def.h xc_const_string tags po
    99
    1010.PHONY: clean
    11 clean: clean_xc_const_string
     11clean: clean_xc_const_string clean_po
    1212    rm -f tags xcache/xc_opcode_spec_def.h
    1313
     
    9797    "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
    9898endif
     99
     100.PHONY: po
     101define htdocspo
     102  po: \
     103    htdocs/$(1)/lang/en.po \
     104    htdocs/$(1)/lang/en.po-merged \
     105    htdocs/$(1)/lang/zh-simplified.po-merged \
     106    htdocs/$(1)/lang/zh-simplified.po \
     107    htdocs/$(1)/lang/zh-traditional.po \
     108    htdocs/$(1)/lang/zh-traditional.po-merged
     109
     110  htdocs/$(1)/lang/%.po-merged: htdocs/$(1)/lang/%.po htdocs/$(1)/lang/$(1).pot
     111    msgmerge -o "$$@".tmp $$^
     112    mv "$$@".tmp "$$@"
     113
     114  htdocs/$(1)/lang/%.po:
     115    touch "$$@"
     116
     117  htdocs/$(1)/lang/$(1).pot:
     118    xgettext --keyword=_T --keyword=N_ --from-code=UTF-8 -F -D htdocs/$(1)/ $$(subst htdocs/$(1)/,,$$^) -o "$$@".tmp
     119    mv "$$@".tmp "$$@"
     120
     121  htdocs/$(1)/lang/$(1).pot: $(shell find htdocs/$(1) -type f | grep php | grep -v lang | grep -v config)
     122
     123endef
     124
     125$(eval $(call htdocspo,cacher))
     126$(eval $(call htdocspo,common))
     127$(eval $(call htdocspo,coverager))
     128$(eval $(call htdocspo,diagnosis))
     129
     130.PHONY: clean_po
     131clean_po: clean_pot
     132    rm -f htdocs/*/lang/*.po-merged
     133
     134.PHONY: clean_pot
     135clean_pot:
     136    rm -f htdocs/*/lang/*.pot
Note: See TracChangeset for help on using the changeset viewer.