[v2] Add target to incorporate translations from translations.org

Message ID 1484230354-16293-1-git-send-email-siddhesh@sourceware.org
State New, archived
Headers

Commit Message

Siddhesh Poyarekar Jan. 12, 2017, 2:12 p.m. UTC
  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.
---
 po/Makefile | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Comments

Siddhesh Poyarekar Jan. 18, 2017, 6:46 p.m. UTC | #1
Ping!

It would be nice to have this in 2.25 so that I don't have to switch
branches to update translations.

Siddhesh

On Thursday 12 January 2017 07:42 PM, Siddhesh Poyarekar wrote:
> 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.
> ---
>  po/Makefile | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/po/Makefile b/po/Makefile
> index 302c3b6..122db23 100644
> --- a/po/Makefile
> +++ b/po/Makefile
> @@ -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
>
  
Dmitry V. Levin Jan. 18, 2017, 7:29 p.m. UTC | #2
On Thu, Jan 12, 2017 at 07:42:34PM +0530, Siddhesh Poyarekar wrote:
> 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.
> ---
>  po/Makefile | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/po/Makefile b/po/Makefile
> index 302c3b6..122db23 100644
> --- a/po/Makefile
> +++ b/po/Makefile
> @@ -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

Please do not consider my reply as an objection,
but isn't a simple rsync command like
	rsync -vLt translationproject.org::tp/latest/libc/'*.po' .
better than multiple wget invocations?
  
Siddhesh Poyarekar Jan. 18, 2017, 7:39 p.m. UTC | #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Thursday 19 January 2017 12:59 AM, Dmitry V. Levin wrote:
> Please do not consider my reply as an objection, but isn't a simple
> rsync command like rsync -vLt
> translationproject.org::tp/latest/libc/'*.po' . better than
> multiple wget invocations?

Oh I was not aware of that interface, that is pretty cool.  It is much
better in terms of bandwidth usage, but I reckon wget ought to win due
to https as opposed to the (AFAIK) plaintext rsync protocol.

Siddhesh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQExBAEBCAAbBQJYf8RXFBxzaWRkaGVzaEBnb3RwbHQub3JnAAoJEHnEPfvxzyGH
fSkH/1GvRYZsnOYNZW0QDSZRgecWd0yLIN78Bp0DET7jFQs8wFlwZT6QIKKOzkN4
Aow3NC6njxz+MZIcHjGCQt0jD/mKyjTUDghQCJ4Zh1ScNpBZ1K9sAPklIimamMu/
mfcpCFa4u8ufekN2a4NIVyVF/rOAH6VgYSwem6XqJw80YTE7mz+rUMC6zc/q1VlV
vmsRb5TE2B76XE6rnKY6NSparEY7RLOWj7epnPMOHt0Vp5JihYzZbo+ikbOQu4aa
oIfuuWnJijJunzZs4Dp8hqRmmBAqYr4Y8yJkz358q4PwPOlOwlOuy3l659CXisZD
0Lz7igJs7MBYgld+H3yYx1kHRx4=
=8fXA
-----END PGP SIGNATURE-----
  
Carlos O'Donell Jan. 19, 2017, 7:41 p.m. UTC | #4
On 01/12/2017 09:12 AM, Siddhesh Poyarekar wrote:
> 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.
> ---
>  po/Makefile | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/po/Makefile b/po/Makefile
> index 302c3b6..122db23 100644
> --- a/po/Makefile
> +++ b/po/Makefile
> @@ -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
> 

This looks good to me.

Please update the release checklist to mention the use of the new target.
  
Siddhesh Poyarekar Jan. 20, 2017, 7:06 a.m. UTC | #5
On Friday 20 January 2017 01:11 AM, Carlos O'Donell wrote:
> Please update the release checklist to mention the use of the new target.

Thanks, done:

https://sourceware.org/glibc/wiki/Release#Incorporate_translations_.5BREQUIRED.5D_.28All_through_the_freeze.29

Siddhesh
  

Patch

diff --git a/po/Makefile b/po/Makefile
index 302c3b6..122db23 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -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