summaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common90
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)"
+