[bug#37285] doc: Rename translated manuals to drop the dot.
diff mbox series

Message ID 20190902205034.6b4d2ea2@sybil.lepiller.eu
State New
Headers show
Series
  • [bug#37285] doc: Rename translated manuals to drop the dot.
Related show

Commit Message

Julien Lepiller Sept. 2, 2019, 6:50 p.m. UTC
Hi, the attached patch changes the translated manual name, from e.g.
guix.fr to guix-fr. The reason is that some info readers and generators
drop everything after the first dot to get the name of the manual. This
leads some readers to thing that "info guix" should open "guix.es.info"
instead of "guix.info", and the inter-lingua links on the website
version of the manual to be wrong.

I think I replaced every instance of the filename in this patch, but I
might have forgotten some, so if you see anything I missed, please tell
me :)

Comments

Ludovic Courtès Sept. 5, 2019, 8:52 p.m. UTC | #1
Hello,

Julien Lepiller <julien@lepiller.eu> skribis:

> Hi, the attached patch changes the translated manual name, from e.g.
> guix.fr to guix-fr. The reason is that some info readers and generators
> drop everything after the first dot to get the name of the manual. This
> leads some readers to thing that "info guix" should open "guix.es.info"
> instead of "guix.info", and the inter-lingua links on the website
> version of the manual to be wrong.
>
> I think I replaced every instance of the filename in this patch, but I
> might have forgotten some, so if you see anything I missed, please tell
> me :)

This is a followup to <https://issues.guix.gnu.org/issue/36782>, right?
WDYT of my reply there?

Neither the standalone Info reader (which comes with Texinfo) nor Emacs
have problems with the dot.  Are you aware of another reader that has
troubles with that?  ‘pinfo’ maybe?

Links in HTML files are broken, but there’s a fix proposed upstream.

Thanks,
Ludo’.

Patch
diff mbox series

From ac14ab493f6b8a9861be71183833a1b4fe7dbcb1 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 2 Sep 2019 19:45:05 +0200
Subject: [PATCH] doc: Rename translated manuals to drop the dot.

Some info readers and the html generator assume the name of the manual
is only what's before the first dot, which leads to errors, such as
wrong inter-lingua links and opening a translated manual with "info
guix".
---
 .gitignore    | 32 ++++++++++++++++----------------
 bootstrap     |  6 +++---
 doc/build.scm |  4 ++--
 doc/local.mk  | 22 +++++++++++-----------
 guix/self.scm |  4 ++--
 5 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/.gitignore b/.gitignore
index 93d2ec9801..44a0febd60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,22 +29,22 @@ 
 /doc/*.1
 /doc/.dirstamp
 /doc/contributing.*.texi
-/doc/guix.*.aux
-/doc/guix.*.cp
-/doc/guix.*.cps
-/doc/guix.*.fn
-/doc/guix.*.fns
-/doc/guix.*.html
-/doc/guix.*.info
-/doc/guix.*.info-[0-9]
-/doc/guix.*.ky
-/doc/guix.*.pg
-/doc/guix.*.toc
-/doc/guix.*.t2p
-/doc/guix.*.tp
-/doc/guix.*.vr
-/doc/guix.*.vrs
-/doc/guix.*.texi
+/doc/guix-*.aux
+/doc/guix-*.cp
+/doc/guix-*.cps
+/doc/guix-*.fn
+/doc/guix-*.fns
+/doc/guix-*.html
+/doc/guix-*.info
+/doc/guix-*.info-[0-9]
+/doc/guix-*.ky
+/doc/guix-*.pg
+/doc/guix-*.toc
+/doc/guix-*.t2p
+/doc/guix-*.tp
+/doc/guix-*.vr
+/doc/guix-*.vrs
+/doc/guix-*.texi
 /doc/guix.aux
 /doc/guix.cp
 /doc/guix.cps
diff --git a/bootstrap b/bootstrap
index c0b5af7677..6471c96bcc 100755
--- a/bootstrap
+++ b/bootstrap
@@ -8,9 +8,9 @@  langs=`find po/doc -type f -name '*.po' \
         | sed -e 's,guix-manual\.,,' \
         | xargs -n 1 -I{} basename {} .po`
 for lang in ${langs}; do
-    if [ ! -e "doc/guix.${lang}.texi" ]; then
-	echo "@setfilename guix.${lang}.info" > "doc/guix.${lang}.texi"
-	echo "@include version-${lang}.texi" >> "doc/guix.${lang}.texi"
+    if [ ! -e "doc/guix-${lang}.texi" ]; then
+	echo "@setfilename guix-${lang}.info" > "doc/guix-${lang}.texi"
+	echo "@include version-${lang}.texi" >> "doc/guix-${lang}.texi"
 	# Ensure .po file is newer.
 	touch "po/doc/guix-manual.${lang}.po"
     fi
diff --git a/doc/build.scm b/doc/build.scm
index 7ba9f57bc9..af284805eb 100644
--- a/doc/build.scm
+++ b/doc/build.scm
@@ -210,7 +210,7 @@  makeinfo OPTIONS."
                                          (string-append #$manual-source "/"
                                                         #$manual ".texi")
                                          (string-append #$manual-source "/"
-                                                        #$manual "." language ".texi")))))
+                                                        #$manual "-" language ".texi")))))
                         (format #t "building HTML manual for language '~a'...~%"
                                 language)
                         (mkdir-p (string-append #$output "/"
@@ -313,7 +313,7 @@  makeinfo OPTIONS."
                                          (string-append #$manual-source "/"
                                                         #$manual ".texi")
                                          (string-append #$manual-source "/"
-                                                        #$manual "." language ".texi")))))
+                                                        #$manual "-" language ".texi")))))
                         (format #t "building PDF manual for language '~a'...~%"
                                 language)
                         (mkdir-p (string-append #$output "/"
diff --git a/doc/local.mk b/doc/local.mk
index 336e961c4f..e4db71e8c7 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -22,11 +22,11 @@ 
 # along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 info_TEXINFOS = %D%/guix.texi			\
-  %D%/guix.de.texi				\
-  %D%/guix.es.texi				\
-  %D%/guix.fr.texi				\
-  %D%/guix.ru.texi				\
-  %D%/guix.zh_CN.texi
+  %D%/guix-de.texi				\
+  %D%/guix-es.texi				\
+  %D%/guix-fr.texi				\
+  %D%/guix-ru.texi				\
+  %D%/guix-zh_CN.texi
 
 %C%_guix_TEXINFOS = \
   %D%/contributing.texi \
@@ -58,11 +58,11 @@  OS_CONFIG_EXAMPLES_TEXI =			\
   %D%/os-config-lightweight-desktop.texi
 
 TRANSLATED_INFO =				\
-  %D%/guix.de.texi				\
-  %D%/guix.es.texi				\
-  %D%/guix.fr.texi				\
-  %D%/guix.ru.texi				\
-  %D%/guix.zh_CN.texi				\
+  %D%/guix-de.texi				\
+  %D%/guix-es.texi				\
+  %D%/guix-fr.texi				\
+  %D%/guix-ru.texi				\
+  %D%/guix-zh_CN.texi				\
   %D%/contributing.de.texi			\
   %D%/contributing.es.texi			\
   %D%/contributing.fr.texi			\
@@ -102,7 +102,7 @@  cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \
 done
 endef
 
-$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi
+$(srcdir)/%D%/guix-%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi
 	-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp"
 	-sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
 	-$(AM_V_POXREF)$(xref_command)
diff --git a/guix/self.scm b/guix/self.scm
index f03fe01d0c..3370de0e18 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -341,10 +341,10 @@  TRANSLATIONS, an alist of msgid and msgstr."
             "Translate the manual for one language LANG using the PO file."
             (let ((translations (call-with-input-file po read-po-file)))
               (translate-tmp-texi po "guix.texi"
-                                  (string-append "guix." lang ".texi.tmp"))
+                                  (string-append "guix-" lang ".texi.tmp"))
               (translate-tmp-texi po "contributing.texi"
                                   (string-append "contributing." lang ".texi.tmp"))
-              (let* ((texi-name (string-append "guix." lang ".texi"))
+              (let* ((texi-name (string-append "guix-" lang ".texi"))
                      (tmp-name (string-append texi-name ".tmp")))
                 (with-output-to-file texi-name
                   (lambda _
-- 
2.22.0