From bcc12b176fc19070aa16940ff4840830bc2ecd59 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 22:08:04 -0400 Subject: Makefile: add support for compiling and installing localizations This means that the new `po/files.generate` target can be used to build the `.pot` files without doing anything else; we can stop requiring translators to install ruby-ronn. It also means that we can put the `.pot` files in the source tarball, to make it even easier for translators. Unfortunately, it does add the extra step of having to create another symlink when adding a new locale. --- po/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 po/Makefile (limited to 'po/Makefile') diff --git a/po/Makefile b/po/Makefile new file mode 100644 index 0000000..1e56edd --- /dev/null +++ b/po/Makefile @@ -0,0 +1,11 @@ +include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +domains = libretools librelib gitget xbs +locales := $(filter-out .,$(sort $(patsubst %/,%,$(dir $(files.src.src))))) + +files.src.gen += $(addsuffix .pot,$(domains)) +nested.subdirs += $(locales) +at.subdirs += .. + +include $(topsrcdir)/build-aux/Makefile.tail.mk -- cgit v1.2.3 From e3d7fbca888e07f02c5867dd1e50393247a066b7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:12:32 -0400 Subject: po: add pot headers --- po/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'po/Makefile') diff --git a/po/Makefile b/po/Makefile index 1e56edd..96d8490 100644 --- a/po/Makefile +++ b/po/Makefile @@ -6,6 +6,16 @@ locales := $(filter-out .,$(sort $(patsubst %/,%,$(dir $(files.src.src))))) files.src.gen += $(addsuffix .pot,$(domains)) nested.subdirs += $(locales) + +# Have the header include the version number +$(srcdir)/header.po.head: $(srcdir)/%: $(srcdir)/%.in + @echo 'EDIT < $< > $@'; $(libretools.edit) < '$<' > '$@' +$(srcdir)/header.po.head: $(var.)PACKAGE $(var.)VERSION +files.src.int += header.po.head + +# Rely on ../Makefile to fill in a list of our .pot dependencies +$(srcdir)/%.pot: $(srcdir)/header.po.head + cat $^ | msguniq -Fi > '$@' at.subdirs += .. include $(topsrcdir)/build-aux/Makefile.tail.mk -- cgit v1.2.3