diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-06-14 19:14:10 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-06-14 19:14:10 +0200 |
commit | be945de33c794a449c5fcbf991db4bf0d49b1fb7 (patch) | |
tree | 477c5f4b708e37200f9042e206e4d7874d2eeae7 /locale |
Diffstat (limited to 'locale')
-rw-r--r-- | locale/Makefile | 60 | ||||
-rw-r--r-- | locale/en/foreman_image_upload.po | 19 | ||||
-rw-r--r-- | locale/foreman_image_upload.pot | 19 | ||||
-rw-r--r-- | locale/gemspec.rb | 2 |
4 files changed, 100 insertions, 0 deletions
diff --git a/locale/Makefile b/locale/Makefile new file mode 100644 index 0000000..1df3957 --- /dev/null +++ b/locale/Makefile @@ -0,0 +1,60 @@ +# +# Makefile for PO merging and MO generation. More info in the README. +# +# make all-mo (default) - generate MO files +# make check - check translations using translate-tool +# make tx-update - download and merge translations from Transifex +# make clean - clean everything +# +DOMAIN = foreman_image_upload +VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load(Dir.glob("../*.gemspec")[0]);puts spec.version') +POTFILE = $(DOMAIN).pot +MOFILE = $(DOMAIN).mo +POFILES = $(shell find . -name '$(DOMAIN).po') +MOFILES = $(patsubst %.po,%.mo,$(POFILES)) +POXFILES = $(patsubst %.po,%.pox,$(POFILES)) +EDITFILES = $(patsubst %.po,%.edit.po,$(POFILES)) + +%.mo: %.po + mkdir -p $(shell dirname $@)/LC_MESSAGES + msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $< + +# Generate MO files from PO files +all-mo: $(MOFILES) + +# Check for malformed strings +%.pox: %.po + msgfmt -c $< + pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \ + -t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@ + cat $@ + ! grep -q msgid $@ + +%.edit.po: + touch $@ + +check: $(POXFILES) + +# Unify duplicate translations +uniq-po: + for f in $(shell find ./ -name "*.po") ; do \ + msguniq $$f -o $$f ; \ + done + +tx-pull: $(EDITFILES) + tx pull -f + for f in $(EDITFILES) ; do \ + sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \ + done + +tx-update: tx-pull + @echo + @echo Run rake plugin:gettext[$(DOMAIN)] from the Foreman installation, then make -C locale mo-files to finish + @echo + +mo-files: $(MOFILES) + git add $(POFILES) $(POTFILE) ../locale/*/LC_MESSAGES + git commit -m "i18n - pulling from tx" + @echo + @echo Changes commited! + @echo diff --git a/locale/en/foreman_image_upload.po b/locale/en/foreman_image_upload.po new file mode 100644 index 0000000..48a61bb --- /dev/null +++ b/locale/en/foreman_image_upload.po @@ -0,0 +1,19 @@ +# foreman_image_upload +# +# This file is distributed under the same license as foreman_image_upload. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: version 0.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-20 08:46+0100\n" +"PO-Revision-Date: 2014-08-20 08:54+0100\n" +"Last-Translator: Foreman Team <foreman-dev@googlegroups.com>\n" +"Language-Team: Foreman Team <foreman-dev@googlegroups.com>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + diff --git a/locale/foreman_image_upload.pot b/locale/foreman_image_upload.pot new file mode 100644 index 0000000..5f66e3e --- /dev/null +++ b/locale/foreman_image_upload.pot @@ -0,0 +1,19 @@ +# foreman_image_upload +# +# This file is distributed under the same license as foreman_image_upload. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: version 0.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-08-20 08:46+0100\n" +"PO-Revision-Date: 2014-08-20 08:46+0100\n" +"Last-Translator: Foreman Team <foreman-dev@googlegroups.com>\n" +"Language-Team: Foreman Team <foreman-dev@googlegroups.com>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + diff --git a/locale/gemspec.rb b/locale/gemspec.rb new file mode 100644 index 0000000..96e705d --- /dev/null +++ b/locale/gemspec.rb @@ -0,0 +1,2 @@ +# Matches foreman_image_upload.gemspec +_('Upload virtual machine images to the Foreman.') |