]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add target to incorporate translations from translations.org
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Fri, 20 Jan 2017 06:54:46 +0000 (12:24 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Fri, 20 Jan 2017 07:02:46 +0000 (12:32 +0530)
Add a convenience target for maintainers to download and incorporate
translation updates from translations.org.  Invoke as follows:

  make -r PARALLELMFLAGS="" -C ../po objdir=`pwd` update-translations

similar to generating libc.pot.

* po/Makefile (update-translations): New target.

ChangeLog
po/Makefile

index 896231a0f164f84286c1c95a0203f5e56f3b99f8..d7c2d2e55b1504f597ceb04fb42ae8f52d1d2c72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-20  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+       * po/Makefile (update-translations): New target.
+
 2017-01-19  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #21061]
index 302c3b6db6c85972779f27d96ea8b36c6759b356..122db235912051cc8566c32383c4f8684a454dfa 100644 (file)
@@ -109,3 +109,14 @@ linguas: $(pofiles:$(podir)/%=%)
 linguas.mo: $(pofiles:$(podir)/%.po=%.mo)
 
 endif
+
+# Update translations from the translation project.
+TRANSLATIONS_URL = https://translationproject.org/latest/libc
+WGET = wget
+
+update-translations:
+       $(WGET) -qO- $(TRANSLATIONS_URL) | sed -n 's|.*href="\([^"]\+po\)".*|\1|p' | \
+         while read f; do \
+           $(WGET) -O $(objdir)/$$f-tmp $(TRANSLATIONS_URL)/$$f && \
+           mv -f $(objdir)/$$f-tmp $$f; \
+         done