Clean and update locales (#1402)
* Remove untranslated languages * Add country prefix to some locales * Remove locale template file * Prepare nl_NL and tr_TR locale for future use * Sort locales list and put en_Us at the top * Enhance locale Makefile Add clean target for locales Set locale all target to clean and build Ensure we keep issue tracker on po updates * Update locales headers * Scan sources files and update locales
This commit is contained in:
parent
a2312ddfce
commit
1efa0742c9
38 changed files with 78481 additions and 163131 deletions
|
@ -1,9 +1,12 @@
|
|||
.PHONY: .locale-update build
|
||||
.DEFAULT: build
|
||||
.ONESHELL:
|
||||
|
||||
all: clean build
|
||||
|
||||
SHELL = bash
|
||||
|
||||
DOMAIN = libretime
|
||||
ISSUE_TRACKER = https://github.com/LibreTime/libretime/issues
|
||||
PO_FILE = $(DOMAIN).po
|
||||
PO_FILES = $(wildcard */LC_MESSAGES/$(PO_FILE))
|
||||
MO_FILES = $(PO_FILES:.po=.mo)
|
||||
|
@ -11,6 +14,7 @@ MO_FILES = $(PO_FILES:.po=.mo)
|
|||
SRC = application build public
|
||||
|
||||
XGETTEXT_ARGS = --default-domain=$(DOMAIN) \
|
||||
--msgid-bugs-address=$(ISSUE_TRACKER) \
|
||||
--language=php \
|
||||
--from-code=UTF-8 \
|
||||
--no-wrap \
|
||||
|
@ -21,8 +25,8 @@ MSGMERGE_ARGS = --no-fuzzy-matching \
|
|||
--no-wrap \
|
||||
--sort-by-file
|
||||
|
||||
# This target is run by another Makefile
|
||||
.locale-update:
|
||||
update:
|
||||
cd ..
|
||||
find $(SRC) -name "*.phtml" -o -name "*.php" -type f -print0 | xargs -0 xgettext $(XGETTEXT_ARGS)
|
||||
sed -i 's/CHARSET/UTF-8/g' $(PO_FILE)
|
||||
find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \;
|
||||
|
@ -32,3 +36,6 @@ MSGMERGE_ARGS = --no-fuzzy-matching \
|
|||
msgfmt $< -o $@
|
||||
|
||||
build: $(MO_FILES)
|
||||
|
||||
clean:
|
||||
git clean -xdf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue