Skip to content

Commit

Permalink
Sync locale Makefile from plugin template
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Sep 19, 2024
1 parent 37b701e commit f816a22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ file_filter = locale/<lang>/foreman_templates.edit.po
source_file = locale/foreman_templates.pot
source_lang = en
type = PO
minimum_perc = 50
minimum_perc = 0
resource_name = foreman_templates
14 changes: 12 additions & 2 deletions locale/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ all-mo: $(MOFILES)
cat $@
! grep -q msgid $@

%.edit.po:
%.edit.po: %.po.time_stamp
touch $@

# gettext will trash the .edit.po file if the time stamp doesn't exist or is older than the po file
%.po.time_stamp: %.po
touch --reference $< $@

# Prevent make from treating this as an intermediate file to be cleaned up
.PRECIOUS: %.po.time_stamp

check: $(POXFILES)

# Unify duplicate translations
Expand All @@ -43,7 +50,10 @@ uniq-po:
done

tx-pull: $(EDITFILES)
cd .. && tx pull -f --all
# Initialize new languages
cd .. && tx pull -f --all --minimum-perc 50
# Force update all existing languages
cd .. && tx pull -f --minimum-perc 0
for f in $(EDITFILES) ; do \
sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
done
Expand Down

0 comments on commit f816a22

Please sign in to comment.