aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-08-10 20:30:42 +0200
committerGuido Günther <agx@sigxcpu.org>2016-08-10 20:41:05 +0200
commit74e39b8ffaeea5ff360e7290a0a90e4e967e46fc (patch)
tree572168a3e007bb95731689d0fbaa709d368b101f /locale
Initial commitHEADmaster
Diffstat (limited to 'locale')
-rw-r--r--locale/Makefile60
-rw-r--r--locale/en/foreman_params_tab.po19
-rw-r--r--locale/foreman_params_tab.pot19
-rw-r--r--locale/gemspec.rb2
4 files changed, 100 insertions, 0 deletions
diff --git a/locale/Makefile b/locale/Makefile
new file mode 100644
index 0000000..a7b5209
--- /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_params_tab
+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_params_tab.po b/locale/en/foreman_params_tab.po
new file mode 100644
index 0000000..2b0402e
--- /dev/null
+++ b/locale/en/foreman_params_tab.po
@@ -0,0 +1,19 @@
+# foreman_params_tab
+#
+# This file is distributed under the same license as foreman_params_tab.
+#
+#, 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_params_tab.pot b/locale/foreman_params_tab.pot
new file mode 100644
index 0000000..ec15518
--- /dev/null
+++ b/locale/foreman_params_tab.pot
@@ -0,0 +1,19 @@
+# foreman_params_tab
+#
+# This file is distributed under the same license as foreman_params_tab.
+#
+#, 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..4385ac2
--- /dev/null
+++ b/locale/gemspec.rb
@@ -0,0 +1,2 @@
+# Matches foreman_params_tab.gemspec
+_('Display a list of params in the hosts overview.')