diff mbox series

[bug#46166,website] Add link to Weblate in language menu.

Message ID 20210129025504.51d43e4f@tachikoma.lepiller.eu
State Accepted
Headers show
Series [bug#46166,website] Add link to Weblate in language menu. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Julien Lepiller Jan. 29, 2021, 1:55 a.m. UTC
This patch adds a simple link "Translate" to at the bottom of the
language dropdown. It goes to the website domain on weblate, so
translators can immediately start working on the translation :)

Comments

Mathieu Othacehe Jan. 29, 2021, 9:16 a.m. UTC | #1
Hello Julien,

> This patch adds a simple link "Translate" to at the bottom of the
> language dropdown. It goes to the website domain on weblate, so
> translators can immediately start working on the translation :)

This looks fine, thanks!

Mathieu
Julien Lepiller Jan. 29, 2021, 1:33 p.m. UTC | #2
Le Fri, 29 Jan 2021 10:16:29 +0100,
Mathieu Othacehe <othacehe@gnu.org> a écrit :

> Hello Julien,
> 
> > This patch adds a simple link "Translate" to at the bottom of the
> > language dropdown. It goes to the website domain on weblate, so
> > translators can immediately start working on the translation :)  
> 
> This looks fine, thanks!
> 
> Mathieu

Pushed as f0132b172f451b3c3e8e23a8e802fe56945eeecf, thanks!
diff mbox series

Patch

From 37c8fa06c756a1e051b3ec496032bfee077cbcaa Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Fri, 29 Jan 2021 02:30:43 +0100
Subject: [PATCH] website: Add link to Weblate in language menu.

* website/apps/base/templates/components.scm (navbar): Add a link to Weblate
in the language dropdown.
---
 website/apps/base/templates/components.scm | 35 ++++++++++++----------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/website/apps/base/templates/components.scm b/website/apps/base/templates/components.scm
index 44d410e..7ca76cc 100644
--- a/website/apps/base/templates/components.scm
+++ b/website/apps/base/templates/components.scm
@@ -430,21 +430,26 @@  manual.
       ;; Languages dropdown.
       ,(menu-dropdown #:label (locale-display-name) #:active-item active-item
         #:items
-        (map-in-order
-         (lambda (ietf-info)
-           (let ((lingua (car ietf-info))
-                 (code (cdr ietf-info)))
-             (setlocale LC_ALL (string-append lingua ".utf8"))
-             (let ((out (menu-item #:label (locale-display-name)
-                                   #:active-item active-item
-                                   #:url (guix-url (string-append code "/")
-                                                   #:localize #f))))
-               (setlocale LC_ALL "")
-               out)))
-         (sort (delete %current-lingua
-                       ietf-tags-file-contents
-                       (lambda (a b) (string=? a (car b))))
-               (lambda (a b) string<?))))))
+        (append
+          (map-in-order
+           (lambda (ietf-info)
+             (let ((lingua (car ietf-info))
+                   (code (cdr ietf-info)))
+               (setlocale LC_ALL (string-append lingua ".utf8"))
+               (let ((out (menu-item #:label (locale-display-name)
+                                     #:active-item active-item
+                                     #:url (guix-url (string-append code "/")
+                                                     #:localize #f))))
+                 (setlocale LC_ALL "")
+                 out)))
+           (sort (delete %current-lingua
+                         ietf-tags-file-contents
+                         (lambda (a b) (string=? a (car b))))
+                 (lambda (a b) string<?)))
+          (list
+            (menu-item #:label (G_ "Translate")
+                       #:active-item active-item
+                       #:url "https://translate.fedoraproject.org/projects/guix/website"))))))
 
 
     ;; Menu button.
-- 
2.30.0