all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#51456: website: Language selection dropdown not translated
@ 2021-10-28  8:13 pelzflorian (Florian Pelz)
  2021-10-28 10:09 ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 3+ messages in thread
From: pelzflorian (Florian Pelz) @ 2021-10-28  8:13 UTC (permalink / raw)
  To: 51456

Ludo recently divided building the website into one computed file for
each language (“lingua”) in order to offload the build (a good thing;
thank you Ludo).

However, this includes making available for each lingua only the
translations MO file for that lingua.

Specifically .guix.scm now links only that file:

(symlink (string-append #$(lingua-mo-files lingua) "/" lingua)
         lingua)

But on the website, there is a language selection dropdown at the top
right and the names of alternative language are taken from that
language’s MO file.

Because the build does not have available all MO files anymore, all
foreign languages are now called English.

(Another effect is that the contact web page only lists the German
message for the Help mailing list on the German website but meh …)

Is the proper solution to symlink all lingua-mo-files, i.e. reinstate
from before commit 4d5bf8522e2 a for-each like

(for-each
 (lambda (lingua mo-directory)
         (symlink (string-append mo-directory "/" lingua)
                  lingua))
 (list #$@%linguas)
 '#$(map lingua-mo-files %linguas))

(I have not tried.)

Or should website/apps/base/templates/components.scm look up the
language dropdown’s language names in a different way such as from the
PO file, which is more complicated?

Regards,
Florian




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#51456: website: Language selection dropdown not translated
  2021-10-28  8:13 bug#51456: website: Language selection dropdown not translated pelzflorian (Florian Pelz)
@ 2021-10-28 10:09 ` pelzflorian (Florian Pelz)
  2021-11-02 15:08   ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 3+ messages in thread
From: pelzflorian (Florian Pelz) @ 2021-10-28 10:09 UTC (permalink / raw)
  To: 51456

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

On Thu, Oct 28, 2021 at 10:13:49AM +0200, pelzflorian (Florian Pelz) wrote:
> Is the proper solution to symlink all lingua-mo-files, i.e. reinstate
> from before commit 4d5bf8522e2 a for-each like
> 
> (for-each
>  (lambda (lingua mo-directory)
>          (symlink (string-append mo-directory "/" lingua)
>                   lingua))
>  (list #$@%linguas)
>  '#$(map lingua-mo-files %linguas))
> 
> (I have not tried.)

Seems to work.  I have guix build -f .guix.scm but only one lingua got
built so far, it looks right.  Patch attached.  Shall I push or …

> 
> Or should website/apps/base/templates/components.scm look up the
> language dropdown’s language names in a different way such as from the
> PO file, which is more complicated?

Regards,
Florian

[-- Attachment #2: 0001-website-Make-available-all-.mo-files-for-each-langua.patch --]
[-- Type: text/plain, Size: 1324 bytes --]

From 947a7b98beda5b49890a61f0751d5765157f5cde Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Thu, 28 Oct 2021 10:21:52 +0200
Subject: [PATCH] website: Make available all .mo files for each language.

Because the language selection dropdown needs all.

Fixes <https://issues.guix.gnu.org/51456>.

* website/.guix.scm (lingua-web-site): When building one language,
still use 'lingua-mo-files' for all languages.
---
 website/.guix.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/website/.guix.scm b/website/.guix.scm
index 3beb0e8..c5cb367 100644
--- a/website/.guix.scm
+++ b/website/.guix.scm
@@ -215,8 +215,12 @@
 
             ;; Build the website for LINGUA.  (apps i18n) calls
             ;; 'bindtextdomain' on $PWD so provide .mo files right here.
-            (symlink (string-append #$(lingua-mo-files lingua) "/" lingua)
-                     lingua)
+            (for-each
+             (lambda (lingua mo-directory)
+               (symlink (string-append mo-directory "/" lingua)
+                        lingua))
+             (list #$@%linguas)
+             '#$(map lingua-mo-files %linguas))
 
             (setenv "LC_ALL" (string-append lingua ".utf8"))
             (format #t "Running 'haunt build' for lingua ~a...~%" lingua)
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#51456: website: Language selection dropdown not translated
  2021-10-28 10:09 ` pelzflorian (Florian Pelz)
@ 2021-11-02 15:08   ` pelzflorian (Florian Pelz)
  0 siblings, 0 replies; 3+ messages in thread
From: pelzflorian (Florian Pelz) @ 2021-11-02 15:08 UTC (permalink / raw)
  To: 51456-done

On Thu, Oct 28, 2021 at 12:09:56PM +0200, pelzflorian (Florian Pelz) wrote:
> On Thu, Oct 28, 2021 at 10:13:49AM +0200, pelzflorian (Florian Pelz) wrote:
> > Is the proper solution to symlink all lingua-mo-files, i.e. reinstate
> > from before commit 4d5bf8522e2 a for-each like
> > 
> > (for-each
> >  (lambda (lingua mo-directory)
> >          (symlink (string-append mo-directory "/" lingua)
> >                   lingua))
> >  (list #$@%linguas)
> >  '#$(map lingua-mo-files %linguas))
> > 
> > (I have not tried.)
> 
> Seems to work.  I have guix build -f .guix.scm but only one lingua got
> built so far, it looks right.  Patch attached.  Shall I push or …
> > Or should website/apps/base/templates/components.scm look up the
> > language dropdown’s language names in a different way such as from the
> > PO file, which is more complicated?

Patch pushed as f2ac98776b321755b672a8f6a1b07d4ab10fff7c.

This undid some of Ludo’s 3689f95c7f197ca83fd78b4e1693c18779da8bb1 and
4d5bf8522e24e2939968dc40ab1ff9809e423ac6, but it seems the only clean
solution.

Regards,
Florian




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-02 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-28  8:13 bug#51456: website: Language selection dropdown not translated pelzflorian (Florian Pelz)
2021-10-28 10:09 ` pelzflorian (Florian Pelz)
2021-11-02 15:08   ` pelzflorian (Florian Pelz)

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.