Re: [PATCH] version-etc.c: Do not include URLS in translatable strings.

2019-05-11 Thread Bruno Haible
Hi John,

> This method is better for several reasons:  1. It avoids the danger of
> cut and paste errors.  2. Naive translators can't translate the urls
> (it's amazing how many do things like that!) 3. Should the urls ever
> change, only this file has to be updated rather than every single
> translation.
> 
> * lib/version-etc.c: Take URLS out of translatable strings.

Good suggestion. I've added it to the GNU gettext manual:
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=22456ebdad40b188bf03b02ec5c58796f16838d5

> +  printf (_("%s home page: <%s/%s/>\n"), PACKAGE_NAME,
> +   "https://www.gnu.org/software;, PACKAGE);

Taking your argument further: The shape of the URL can change, it's
not necessarily of the form "%s/%s/". So move that logic out of the
translatable string as well.

And formatting newlines also can be moved out of the translatable string.

I'm thus committing this:


2019-05-11  John Darrington  
Bruno Haible  

version-etc: Ease translation.
* lib/version-etc.c (version_etc_arn, emit_bug_reporting_address): Move
URLs and formatting newlines out of translatable string.

diff --git a/lib/version-etc.c b/lib/version-etc.c
index 9ca9a56..f6b26ef 100644
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -82,14 +82,17 @@ version_etc_arn (FILE *stream,
  locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
   fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
 
-  fputs (_("\
-\n\
-License GPLv3+: GNU GPL version 3 or later 
.\n\
+  fputs ("\n", stream);
+
+  /* TRANSLATORS: The %s placeholder is the web address of the GPL license.  */
+  fprintf (stream, _("\
+License GPLv3+: GNU GPL version 3 or later <%s>.\n\
 This is free software: you are free to change and redistribute it.\n\
 There is NO WARRANTY, to the extent permitted by law.\n\
-\n\
 "),
- stream);
+   "https://gnu.org/licenses/gpl.html;);
+
+  fputs ("\n", stream);
 
   switch (n_authors)
 {
@@ -238,11 +241,12 @@ version_etc (FILE *stream,
 void
 emit_bug_reporting_address (void)
 {
+  fputs ("\n", stdout);
   /* TRANSLATORS: The placeholder indicates the bug-reporting address
  for this package.  Please add _another line_ saying
  "Report translation bugs to <...>\n" with the address for translation
  bugs (typically your translation team's web or email address).  */
-  printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT);
+  printf (_("Report bugs to: %s\n"), PACKAGE_BUGREPORT);
 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
   printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
   PACKAGE_PACKAGER_BUG_REPORTS);
@@ -250,9 +254,9 @@ emit_bug_reporting_address (void)
 #ifdef PACKAGE_URL
   printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
 #else
-  printf (_("%s home page: \n"),
-  PACKAGE_NAME, PACKAGE);
+  printf (_("%s home page: <%s>\n"),
+  PACKAGE_NAME, "https://www.gnu.org/software/; PACKAGE "/");
 #endif
-  fputs (_("General help using GNU software: 
\n"),
- stdout);
+  printf (_("General help using GNU software: <%s>\n"),
+  "https://www.gnu.org/gethelp/;);
 }




Re: [PATCH] version-etc.c: Do not include URLS in translatable strings.

2019-05-06 Thread Bruno Haible
Ben Pfaff wrote:
> > -License GPLv3+: GNU GPL version 3 or later 
> > .\n\
> > +License GPLv3+: GNU GPL version 3 or later <%s>.\n\
> 
> Does anyone ever try to translate the "GPLv3+" part?  If so, then it
> could be taken out as well.

The Serbian translators translate "License GPLv3+" as "Лиценца ОЈЛв3+". [1]
Therefore it should be left in the string that the translators should
translate.

Bruno

[1] https://translationproject.org/PO-files/sr/gettext-runtime-0.20-rc1.sr.po




Re: [PATCH] version-etc.c: Do not include URLS in translatable strings.

2019-05-06 Thread Ben Pfaff
On Mon, May 06, 2019 at 08:21:34PM +0200, John Darrington wrote:
> This method is better for several reasons:  1. It avoids the danger of
> cut and paste errors.  2. Naive translators can't translate the urls
> (it's amazing how many do things like that!) 3. Should the urls ever
> change, only this file has to be updated rather than every single
> translation.
> 
> * lib/version-etc.c: Take URLS out of translatable strings.
> ---
>  lib/version-etc.c | 15 +++
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/version-etc.c b/lib/version-etc.c
> index 9ca9a5628..4a060e0b5 100644
> --- a/lib/version-etc.c
> +++ b/lib/version-etc.c
> @@ -82,14 +82,13 @@ version_etc_arn (FILE *stream,
>   locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
>fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
>  
> -  fputs (_("\
> +  fprintf (stream, _("\
>  \n\
> -License GPLv3+: GNU GPL version 3 or later 
> .\n\
> +License GPLv3+: GNU GPL version 3 or later <%s>.\n\

Does anyone ever try to translate the "GPLv3+" part?  If so, then it
could be taken out as well.



[PATCH] version-etc.c: Do not include URLS in translatable strings.

2019-05-06 Thread John Darrington
This method is better for several reasons:  1. It avoids the danger of
cut and paste errors.  2. Naive translators can't translate the urls
(it's amazing how many do things like that!) 3. Should the urls ever
change, only this file has to be updated rather than every single
translation.

* lib/version-etc.c: Take URLS out of translatable strings.
---
 lib/version-etc.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/version-etc.c b/lib/version-etc.c
index 9ca9a5628..4a060e0b5 100644
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -82,14 +82,13 @@ version_etc_arn (FILE *stream,
  locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
   fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
 
-  fputs (_("\
+  fprintf (stream, _("\
 \n\
-License GPLv3+: GNU GPL version 3 or later 
.\n\
+License GPLv3+: GNU GPL version 3 or later <%s>.\n\
 This is free software: you are free to change and redistribute it.\n\
 There is NO WARRANTY, to the extent permitted by law.\n\
 \n\
-"),
- stream);
+"), "https://gnu.org/licenses/gpl.html;);
 
   switch (n_authors)
 {
@@ -250,9 +249,9 @@ emit_bug_reporting_address (void)
 #ifdef PACKAGE_URL
   printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
 #else
-  printf (_("%s home page: \n"),
-  PACKAGE_NAME, PACKAGE);
+  printf (_("%s home page: <%s/%s/>\n"), PACKAGE_NAME,
+ "https://www.gnu.org/software;, PACKAGE);
 #endif
-  fputs (_("General help using GNU software: 
\n"),
- stdout);
+  printf (_("General help using GNU software: <%s>\n"),
+ "https://www.gnu.org/gethelp;);
 }
-- 
2.11.0