diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-08-13 16:25:27 (GMT) |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-08-13 16:25:27 (GMT) |
commit | 4e1516ca5f41fa8f20824156a78a81aa7443bf10 (patch) | |
tree | 84665aa18be2bf9a025c85740ce785e3f1e857b7 /Makefile.common | |
parent | 261a26a95bc16d22c148d1ba78253dae4eee2b70 (diff) | |
download | kolab-docs-4e1516ca5f41fa8f20824156a78a81aa7443bf10.tar.gz |
The final update to allow automatic interaction with our localization platform
Diffstat (limited to 'Makefile.common')
-rw-r--r-- | Makefile.common | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/Makefile.common b/Makefile.common index 6800206..3894eaa 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,6 +1,6 @@ all: clean clean_ids update-language @publican build --embedtoc --publish --langs=all --formats=html,html-single,pdf - @for lang in $$(ls -d *-*/); do \ + @for lang in $$(ls -d *-*); do \ publican install_book --site_config=../site.cfg --lang=$$lang; \ done @@ -23,56 +23,55 @@ tx-init: fi update-language: tx-init - @publican update_pot - for file in `find pot/ -type f \ - ! -name "Author_Group.pot" -a \ - ! -name "Book_Info.pot" -a \ - ! -name "Community_$(PACKAGE).pot" -a \ - ! -name "Enterprise_$(PACKAGE).pot" -a \ - ! -name "$(PACKAGE).pot"`; do \ - if [ -f "../Common_Content/en-US/$$(echo $$file | sed -e 's/.pot/.xml/g' -e 's/^pot\///g')" ]; then \ - echo "FOUND FILE IN UPPER COMMON CONTENT ../Common_Content/en-US/$$(echo $$file | sed -e 's/.pot/.xml/g' -e 's/^pot\///g')"; \ + @if [ "$(SKIP_UPDATE_LANG)" != "1" ]; then \ + publican update_pot; \ + for file in `find pot/ -type f \ + ! -name "Author_Group.pot" -a \ + ! -name "Book_Info.pot" -a \ + ! -name "Community_$(PACKAGE).pot" -a \ + ! -name "Enterprise_$(PACKAGE).pot" -a \ + \( ! -name "$(PACKAGE).pot" -o -name "About_Kolab_Groupware.pot" \)`; do \ + if [ -f "../Common_Content/en-US/$$(echo $$file | sed -e 's/.pot/.xml/g' -e 's/^pot\///g')" ]; then \ + tx set \ + --auto-local \ + -r "kolab.$$(echo $$file | sed -e 's/.pot//g' -e 's/^pot\///g')" \ + "<lang>/$$(echo $$file | sed -e 's/^pot\///g' -e 's/.pot/.po/g')" \ + --source-lang en_US \ + --source-file $$file \ + --execute; \ + continue; \ + fi; \ + slug=$$(echo $$file | sed -e 's/^pot\///g' -e 's/.pot//g'); \ + pkg="$(PACKAGE)"; \ + while [ $$(echo $$slug | wc -c) -gt $$(( 50 - $$(echo $$pkg | wc -c) )) ]; do \ + previous_length=$$(echo $$slug | wc -c); \ + slug=$$(echo $$slug | cut -d'-' -f2-); \ + if [ $$(echo $$slug | wc -c) -ge $$previous_length ]; then \ + unset pkg; \ + fi; \ + done; \ + if [ ! -z "$$pkg" -a $$(echo $$pkg | wc -c) -ne 1 ]; then \ + pkgprefix="$$pkg-"; \ + else \ + pkgprefix=""; \ + fi; \ + if [ $$(echo $$pkgprefix$$slug | wc -c) -gt 50 ]; then \ + exit 1; \ + fi; \ tx set \ --auto-local \ - -r "kolab.$$(echo $$file | sed -e 's/.pot//g' -e 's/^pot\///g')" \ + -r "kolab.$$pkgprefix$$slug" \ "<lang>/$$(echo $$file | sed -e 's/^pot\///g' -e 's/.pot/.po/g')" \ --source-lang en_US \ --source-file $$file \ --execute; \ - continue; \ - else \ - echo "DID NOT FIND FILE IN UPPER COMMON CONTENT ../Common_Content/en-US/$$(echo $$file | sed -e 's/.pot/.xml/g' -e 's/^pot\///g')"; \ - fi; \ - slug=$$(echo $$file | sed -e 's/^pot\///g' -e 's/.pot//g'); \ - pkg="$(PACKAGE)"; \ - while [ $$(echo $$slug | wc -c) -gt $$(( 50 - $$(echo $$pkg | wc -c) )) ]; do \ - previous_length=$$(echo $$slug | wc -c); \ - slug=$$(echo $$slug | cut -d'-' -f2-); \ - if [ $$(echo $$slug | wc -c) -ge $$previous_length ]; then \ - unset pkg; \ - fi; \ done; \ - if [ ! -z "$$pkg" -a $$(echo $$pkg | wc -c) -ne 1 ]; then \ - pkgprefix="$$pkg-"; \ - else \ - pkgprefix=""; \ - fi; \ - if [ $$(echo $$pkgprefix$$slug | wc -c) -gt 50 ]; then \ - exit 1; \ - fi; \ - tx set \ - --auto-local \ - -r "kolab.$$pkgprefix$$slug" \ - "<lang>/$$(echo $$file | sed -e 's/^pot\///g' -e 's/.pot/.po/g')" \ - --source-lang en_US \ - --source-file $$file \ - --execute; \ - done - @tx push -s - @publican update_po --langs=all - @for lang in $$(ls -d *-*); do \ - tx pull -l $$lang -f; \ - done + tx push -s; \ + publican update_po --langs=all; \ + for lang in $$(ls -d *-*); do \ + tx pull -l $$lang -f; \ + done; \ + fi add-language: tx-init @publican update_pot @@ -86,4 +85,7 @@ add-language: tx-init lang_map="$$lang_map, $$lang_short: $$lang"; \ fi; \ done; sed -i -e '/^lang_map/d' -e "2 i\lang_map = $$lang_map" .tx/config + @git add $(LANGUAGE) + @git commit $(LANGUAGE) -m "Add language $(LANGUAGE)" + |