unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation.
@ 2024-01-16 12:22 Clément Lassieur
  2024-01-16 12:40 ` Clément Lassieur
  2024-01-16 13:31 ` [bug#68503] [PATCH v2] gnu: torbrowser: Add support or " Clément Lassieur
  0 siblings, 2 replies; 6+ messages in thread
From: Clément Lassieur @ 2024-01-16 12:22 UTC (permalink / raw)
  To: 68503; +Cc: Clément Lassieur, Clément Lassieur, Jonathan Brielmaier

* gnu/packages/gnuzilla.scm (all-mozilla-locales): Make public.
* gnu/packages/tor.scm (%torbrowser-locales, translation-base-browser,
translation-tor-browser): New variables.
(torbrowser)[arguments]: Add ‘copy-locales’ and ‘build-locales’ phases.

Change-Id: Ia5b28fa5d885f24140893dc270e57e83b0250c67
---
 gnu/packages/gnuzilla.scm |   2 +-
 gnu/packages/tor.scm      | 101 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 101 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index ea5de680e5d0..441e0526c4b8 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -438,7 +438,7 @@ (define (update-mozilla-locales changesets.json)
        (format #t "~{~s~%~}" data)
        data))))
 
-(define all-mozilla-locales
+(define-public all-mozilla-locales
   (mozilla-locales
    ;;                      sha256                            changeset    locale
    ;;---------------------------------------------------------------------------
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index b20e17e4cea8..8752cd67ef37 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2021-2023 Danial Behzadi <dani.behzi@ubuntu.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org>
-;;; Copyright © 2023 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2023, 2024 Clément Lassieur <clement@lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -503,6 +503,36 @@ (define %torbrowser-version "13.0.8")
 ;; "src-firefox-tor-browser-".
 (define %torbrowser-firefox-version "115.6.0esr-13.0-1-build2")
 
+;; Use the list in tor-browser-build/rbm.conf.
+(define %torbrowser-locales
+  '("ar" "ca" "cs" "da" "de" "el" "es-ES" "fa" "fi" "fr" "ga-IE" "he" "hu"
+    "id" "is" "it" "ja" "ka" "ko" "lt" "mk" "ms" "my" "nb-NO" "nl" "pl"
+    "pt-BR" "ro" "ru" "sq" "sv-SE" "th" "tr" "uk" "vi" "zh-CN" "zh-TW"))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-base-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "5490489a8d356a44d792300b4dfddba792d10f2e")))
+    (file-name "translation-base-browser")
+    (sha256
+     (base32
+      "1knxary2zp2705xzzs76gpy37ri69yp32ajpmpxki3z5hp7mla7q"))))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-tor-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "e92772b4a11ced855c27eafd299cf972bef5cd8f")))
+    (file-name "translation-tor-browser")
+    (sha256
+     (base32
+      "0q3gcq7s58110d9y4x8zyby6cn36msry6z3va7xw8sam3pp7p8nj"))))
+
 (define torbrowser-assets
   ;; This is a prebuilt Torbrowser from which we take the assets we need.
   (package
@@ -591,6 +621,68 @@ (define-public torbrowser
                     (for-each (lambda (flag)
                                 (format #t "ac_add_options ~a~%" flag))
                               configure-flags)))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-before 'configure 'copy-locales
+              (lambda _
+                (let ((l10ncentral ".mozbuild/l10n-central"))
+                  ;; Temporary copy so that we can use ‘mv’ to mimic
+                  ;; tor-browser-build/projects/firefox/build.
+                  (copy-recursively #$translation-base-browser
+                                    "translation-base-browser")
+                  (copy-recursively #$translation-tor-browser
+                                    "translation-tor-browser")
+                  (mkdir-p l10ncentral)
+                  (for-each
+                   (lambda (lang)
+                     ;; Firefox locales
+                     (copy-recursively (find (lambda (path)
+                                               (string-suffix? lang path))
+                                             '#$all-mozilla-locales)
+                                       (in-vicinity l10ncentral lang))
+                     ;; Base Browser locales
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/base-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/*"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang))
+                     ;; Tor Browser locales
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/tor-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/cryptoSafetyPrompt.properties"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                            "translation-tor-browser/~a"
+                            "toolkit/torbutton/chrome/locale/"))
+                       lang))
+                     (let ((port (open-file "toolkit/torbutton/jar.mn" "a")))
+                       (format port "% locale torbutton ~a %locale/~a/~%"
+                               lang lang)
+                       (format port "  locale/~a/ (chrome/locale/~a/*)~%"
+                               lang lang)
+                       (close port)))
+                   '#$%torbrowser-locales))))
             (replace 'configure
               (lambda _
                 (invoke "./mach" "configure")))
@@ -607,6 +699,13 @@ (define-public torbrowser
                    "#include ../../../tools/torbrowser/bridges.js" port)
                   (newline port)
                   (close port))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-after 'build 'build-locales
+              (lambda _
+                (setenv "MOZ_CHROME_MULTILOCALE"
+                        (string-join '#$%torbrowser-locales))
+                (apply invoke "./mach" "package-multi-locale" "--locales"
+                       "en-US" '#$%torbrowser-locales)))
             (add-after 'install 'deploy-assets
               (lambda* (#:key inputs #:allow-other-keys)
                 (let ((assets #$(this-package-input "torbrowser-assets"))

base-commit: 551d013a56bf7d22bac80e0fd21d971973c3cf6f
-- 
2.41.0





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

* [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation.
  2024-01-16 12:22 [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation Clément Lassieur
@ 2024-01-16 12:40 ` Clément Lassieur
  2024-01-16 13:31 ` [bug#68503] [PATCH v2] gnu: torbrowser: Add support or " Clément Lassieur
  1 sibling, 0 replies; 6+ messages in thread
From: Clément Lassieur @ 2024-01-16 12:40 UTC (permalink / raw)
  To: 68503; +Cc: André Batista, Jonathan Brielmaier

On Tue, Jan 16 2024, Clément Lassieur wrote:

> * gnu/packages/gnuzilla.scm (all-mozilla-locales): Make public.
> * gnu/packages/tor.scm (%torbrowser-locales, translation-base-browser,
> translation-tor-browser): New variables.
> (torbrowser)[arguments]: Add ‘copy-locales’ and ‘build-locales’ phases.
>
> Change-Id: Ia5b28fa5d885f24140893dc270e57e83b0250c67
> ---
>  gnu/packages/gnuzilla.scm |   2 +-
>  gnu/packages/tor.scm      | 101 +++++++++++++++++++++++++++++++++++++-
>  2 files changed, 101 insertions(+), 2 deletions(-)

Ccing André.




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

* [bug#68503] [PATCH v2] gnu: torbrowser: Add support or language localisation.
  2024-01-16 12:22 [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation Clément Lassieur
  2024-01-16 12:40 ` Clément Lassieur
@ 2024-01-16 13:31 ` Clément Lassieur
  2024-01-18 22:46   ` [bug#68503] [PATCH v3] gnu: torbrowser: Add support for " Clément Lassieur
  1 sibling, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2024-01-16 13:31 UTC (permalink / raw)
  To: 68503; +Cc: Clément Lassieur, André Batista

* gnu/packages/gnuzilla.scm (all-mozilla-locales): Export it.
* gnu/packages/tor.scm (%torbrowser-locales, translation-base-browser,
translation-tor-browser): New variables.
(torbrowser)[arguments]: Add ‘copy-locales’ and ‘build-locales’ phases.

Change-Id: Ia5b28fa5d885f24140893dc270e57e83b0250c67
---
 gnu/packages/gnuzilla.scm |   3 +-
 gnu/packages/tor.scm      | 101 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 102 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index ea5de680e5d0..e3bc625bc0f5 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -98,7 +98,8 @@ (define-module (gnu packages gnuzilla)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages sqlite)
-  #:autoload (json parser) (json->scm))
+  #:autoload (json parser) (json->scm)
+  #:export (all-mozilla-locales))
 
 (define-public mozjs
   (package
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index b20e17e4cea8..8752cd67ef37 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2021-2023 Danial Behzadi <dani.behzi@ubuntu.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org>
-;;; Copyright © 2023 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2023, 2024 Clément Lassieur <clement@lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -503,6 +503,36 @@ (define %torbrowser-version "13.0.8")
 ;; "src-firefox-tor-browser-".
 (define %torbrowser-firefox-version "115.6.0esr-13.0-1-build2")
 
+;; Use the list in tor-browser-build/rbm.conf.
+(define %torbrowser-locales
+  '("ar" "ca" "cs" "da" "de" "el" "es-ES" "fa" "fi" "fr" "ga-IE" "he" "hu"
+    "id" "is" "it" "ja" "ka" "ko" "lt" "mk" "ms" "my" "nb-NO" "nl" "pl"
+    "pt-BR" "ro" "ru" "sq" "sv-SE" "th" "tr" "uk" "vi" "zh-CN" "zh-TW"))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-base-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "5490489a8d356a44d792300b4dfddba792d10f2e")))
+    (file-name "translation-base-browser")
+    (sha256
+     (base32
+      "1knxary2zp2705xzzs76gpy37ri69yp32ajpmpxki3z5hp7mla7q"))))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-tor-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "e92772b4a11ced855c27eafd299cf972bef5cd8f")))
+    (file-name "translation-tor-browser")
+    (sha256
+     (base32
+      "0q3gcq7s58110d9y4x8zyby6cn36msry6z3va7xw8sam3pp7p8nj"))))
+
 (define torbrowser-assets
   ;; This is a prebuilt Torbrowser from which we take the assets we need.
   (package
@@ -591,6 +621,68 @@ (define-public torbrowser
                     (for-each (lambda (flag)
                                 (format #t "ac_add_options ~a~%" flag))
                               configure-flags)))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-before 'configure 'copy-locales
+              (lambda _
+                (let ((l10ncentral ".mozbuild/l10n-central"))
+                  ;; Temporary copy so that we can use ‘mv’ to mimic
+                  ;; tor-browser-build/projects/firefox/build.
+                  (copy-recursively #$translation-base-browser
+                                    "translation-base-browser")
+                  (copy-recursively #$translation-tor-browser
+                                    "translation-tor-browser")
+                  (mkdir-p l10ncentral)
+                  (for-each
+                   (lambda (lang)
+                     ;; Firefox locales
+                     (copy-recursively (find (lambda (path)
+                                               (string-suffix? lang path))
+                                             '#$all-mozilla-locales)
+                                       (in-vicinity l10ncentral lang))
+                     ;; Base Browser locales
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/base-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/*"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang))
+                     ;; Tor Browser locales
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/tor-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/cryptoSafetyPrompt.properties"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                            "translation-tor-browser/~a"
+                            "toolkit/torbutton/chrome/locale/"))
+                       lang))
+                     (let ((port (open-file "toolkit/torbutton/jar.mn" "a")))
+                       (format port "% locale torbutton ~a %locale/~a/~%"
+                               lang lang)
+                       (format port "  locale/~a/ (chrome/locale/~a/*)~%"
+                               lang lang)
+                       (close port)))
+                   '#$%torbrowser-locales))))
             (replace 'configure
               (lambda _
                 (invoke "./mach" "configure")))
@@ -607,6 +699,13 @@ (define-public torbrowser
                    "#include ../../../tools/torbrowser/bridges.js" port)
                   (newline port)
                   (close port))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-after 'build 'build-locales
+              (lambda _
+                (setenv "MOZ_CHROME_MULTILOCALE"
+                        (string-join '#$%torbrowser-locales))
+                (apply invoke "./mach" "package-multi-locale" "--locales"
+                       "en-US" '#$%torbrowser-locales)))
             (add-after 'install 'deploy-assets
               (lambda* (#:key inputs #:allow-other-keys)
                 (let ((assets #$(this-package-input "torbrowser-assets"))

base-commit: 551d013a56bf7d22bac80e0fd21d971973c3cf6f
-- 
2.41.0





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

* [bug#68503] [PATCH v3] gnu: torbrowser: Add support for language localisation.
  2024-01-16 13:31 ` [bug#68503] [PATCH v2] gnu: torbrowser: Add support or " Clément Lassieur
@ 2024-01-18 22:46   ` Clément Lassieur
  2024-01-20 21:29     ` André Batista
  0 siblings, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2024-01-18 22:46 UTC (permalink / raw)
  To: 68503; +Cc: Clément Lassieur

* gnu/packages/gnuzilla.scm (all-mozilla-locales): Export it.
* gnu/packages/tor.scm (%torbrowser-locales, translation-base-browser,
translation-tor-browser): New variables.
(torbrowser)[arguments]: In ‘setenv’ phase, set MOZ_CHROME_MULTILOCALE.  Add
‘copy-firefox-locales’, ‘copy-basebrowser-locales’, ‘copy-torbrowser-locales’
and ‘build-locales’ phases.

Change-Id: Ia5b28fa5d885f24140893dc270e57e83b0250c67
---
 gnu/packages/gnuzilla.scm |   3 +-
 gnu/packages/tor.scm      | 112 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 113 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index ea5de680e5d0..e3bc625bc0f5 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -98,7 +98,8 @@ (define-module (gnu packages gnuzilla)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages sqlite)
-  #:autoload (json parser) (json->scm))
+  #:autoload (json parser) (json->scm)
+  #:export (all-mozilla-locales))
 
 (define-public mozjs
   (package
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index b20e17e4cea8..fbd5f0a0af78 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2021-2023 Danial Behzadi <dani.behzi@ubuntu.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org>
-;;; Copyright © 2023 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2023, 2024 Clément Lassieur <clement@lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -503,6 +503,36 @@ (define %torbrowser-version "13.0.8")
 ;; "src-firefox-tor-browser-".
 (define %torbrowser-firefox-version "115.6.0esr-13.0-1-build2")
 
+;; Use the list in tor-browser-build/rbm.conf.
+(define %torbrowser-locales
+  '("ar" "ca" "cs" "da" "de" "el" "es-ES" "fa" "fi" "fr" "ga-IE" "he" "hu"
+    "id" "is" "it" "ja" "ka" "ko" "lt" "mk" "ms" "my" "nb-NO" "nl" "pl"
+    "pt-BR" "ro" "ru" "sq" "sv-SE" "th" "tr" "uk" "vi" "zh-CN" "zh-TW"))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-base-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "5490489a8d356a44d792300b4dfddba792d10f2e")))
+    (file-name "translation-base-browser")
+    (sha256
+     (base32
+      "1knxary2zp2705xzzs76gpy37ri69yp32ajpmpxki3z5hp7mla7q"))))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-tor-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "e92772b4a11ced855c27eafd299cf972bef5cd8f")))
+    (file-name "translation-tor-browser")
+    (sha256
+     (base32
+      "0q3gcq7s58110d9y4x8zyby6cn36msry6z3va7xw8sam3pp7p8nj"))))
+
 (define torbrowser-assets
   ;; This is a prebuilt Torbrowser from which we take the assets we need.
   (package
@@ -581,6 +611,8 @@ (define-public torbrowser
                 ;; $HOME/.mozbuild).
                 (setenv "MOZBUILD_STATE_PATH"
                         (in-vicinity (getcwd) ".mozbuild"))
+                (setenv "MOZ_CHROME_MULTILOCALE"
+                        (string-join '#$%torbrowser-locales))
                 ;; Make build reproducible.
                 (setenv "MOZ_BUILD_DATE" #$%moz-build-date)))
             (add-before 'configure 'mozconfig
@@ -594,6 +626,79 @@ (define-public torbrowser
             (replace 'configure
               (lambda _
                 (invoke "./mach" "configure")))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-before 'configure 'copy-firefox-locales
+              (lambda _
+                (let ((l10ncentral ".mozbuild/l10n-central"))
+                  (mkdir-p l10ncentral)
+                  (for-each
+                   (lambda (lang)
+                     (copy-recursively (find (lambda (path)
+                                               (string-suffix? lang path))
+                                             '#$all-mozilla-locales)
+                                       (in-vicinity l10ncentral lang)))
+                   '#$%torbrowser-locales))))
+            (add-after 'copy-firefox-locales 'copy-basebrowser-locales
+              (lambda _
+                (let ((l10ncentral ".mozbuild/l10n-central"))
+                  ;; Temporary copy so that we can use ‘mv’ to mimic
+                  ;; tor-browser-build/projects/firefox/build.
+                  (copy-recursively #$translation-base-browser
+                                    "translation-base-browser")
+                  (for-each
+                   (lambda (lang)
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/base-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-base-browser/~a/*"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang)))
+                   '#$%torbrowser-locales))))
+            (add-after 'copy-basebrowser-locales 'copy-torbrowser-locales
+              (lambda _
+                (let ((l10ncentral ".mozbuild/l10n-central"))
+                  ;; Temporary copy so that we can use ‘mv’ to mimic
+                  ;; tor-browser-build/projects/firefox/build.
+                  (copy-recursively #$translation-tor-browser
+                                    "translation-tor-browser")
+                  (for-each
+                   (lambda (lang)
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/tor-browser.ftl"
+                             "~a/~a/browser/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a/cryptoSafetyPrompt.properties"
+                             "~a/~a/browser/chrome/browser/"))
+                       lang l10ncentral lang))
+                     (system
+                      (format
+                       #f (string-join
+                           '("mv"
+                             "translation-tor-browser/~a"
+                             "toolkit/torbutton/chrome/locale/"))
+                       lang))
+                     (let ((port (open-file "toolkit/torbutton/jar.mn" "a")))
+                       (format port "% locale torbutton ~a %locale/~a/~%"
+                               lang lang)
+                       (format port "  locale/~a/ (chrome/locale/~a/*)~%"
+                               lang lang)
+                       (close port)))
+                   '#$%torbrowser-locales))))
             (add-before 'build 'fix-addons-placeholder
               (lambda _
                 (substitute*
@@ -607,6 +712,11 @@ (define-public torbrowser
                    "#include ../../../tools/torbrowser/bridges.js" port)
                   (newline port)
                   (close port))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (add-after 'build 'build-locales
+              (lambda _
+                (system (string-join '("./mach package-multi-locale --locales"
+                                       "en-US $MOZ_CHROME_MULTILOCALE")))))
             (add-after 'install 'deploy-assets
               (lambda* (#:key inputs #:allow-other-keys)
                 (let ((assets #$(this-package-input "torbrowser-assets"))

base-commit: 551d013a56bf7d22bac80e0fd21d971973c3cf6f
-- 
2.41.0





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

* [bug#68503] [PATCH v3] gnu: torbrowser: Add support for language localisation.
  2024-01-18 22:46   ` [bug#68503] [PATCH v3] gnu: torbrowser: Add support for " Clément Lassieur
@ 2024-01-20 21:29     ` André Batista
  2024-01-21  0:15       ` bug#68503: " Clément Lassieur
  0 siblings, 1 reply; 6+ messages in thread
From: André Batista @ 2024-01-20 21:29 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 68503

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

Hi Clément,

qui 18 jan 2024 às 23:46:49 (1705632409), clement@lassieur.org enviou:
> ...
>
> diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
> index b20e17e4cea8..fbd5f0a0af78 100644
> --- a/gnu/packages/tor.scm
> +++ b/gnu/packages/tor.scm
> ...
>
> @@ -503,6 +503,36 @@ (define %torbrowser-version "13.0.8")
>  ;; "src-firefox-tor-browser-".
>  (define %torbrowser-firefox-version "115.6.0esr-13.0-1-build2")
>  
> +;; Use the list in tor-browser-build/rbm.conf.
> +(define %torbrowser-locales
> +  '("ar" "ca" "cs" "da" "de" "el" "es-ES" "fa" "fi" "fr" "ga-IE" "he" "hu"
> +    "id" "is" "it" "ja" "ka" "ko" "lt" "mk" "ms" "my" "nb-NO" "nl" "pl"
> +    "pt-BR" "ro" "ru" "sq" "sv-SE" "th" "tr" "uk" "vi" "zh-CN" "zh-TW"))
> +
> +;; See tor-browser-build/projects/translation/config.
> +(define translation-base-browser
> +  (origin
> +    (method git-fetch)
> +    (uri (git-reference
> +          (url "https://gitlab.torproject.org/tpo/translation.git")
> +          (commit "5490489a8d356a44d792300b4dfddba792d10f2e")))
> +    (file-name "translation-base-browser")
> +    (sha256
> +     (base32
> +      "1knxary2zp2705xzzs76gpy37ri69yp32ajpmpxki3z5hp7mla7q"))))
> +
> +;; See tor-browser-build/projects/translation/config.
> +(define translation-tor-browser
> +  (origin
> +    (method git-fetch)
> +    (uri (git-reference
> +          (url "https://gitlab.torproject.org/tpo/translation.git")
> +          (commit "e92772b4a11ced855c27eafd299cf972bef5cd8f")))

The above commit is the one on the 'main' branch, but the current stable
browser follows 'maint-13.0' (which has now changed in preparation for
v13.0.9 release next Tuesday) and there is a tag for each release. The
release tag for version 13.0.8 (tbb-13.0.8-build1) contains a different
commit number (273592eca488ca3bf535d3789b1130fd1970f09a).

Other than that, everything seems to perfectly mirror upstream build
process. I've also built it, did some testing and it's working as
expected.

You are doing an awesome work, thanks!

PS: I'm sorry to have left you hanging on the lyrebird patch. I'll
review it and, if I find anything worth of attention, I'll ping back.
For now, I can only say that bridges are working just fine.

Cheers!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 667 bytes --]

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

* bug#68503: [PATCH v3] gnu: torbrowser: Add support for language localisation.
  2024-01-20 21:29     ` André Batista
@ 2024-01-21  0:15       ` Clément Lassieur
  0 siblings, 0 replies; 6+ messages in thread
From: Clément Lassieur @ 2024-01-21  0:15 UTC (permalink / raw)
  To: André Batista; +Cc: 68503-done

Hi André,

On Sat, Jan 20 2024, André Batista wrote:

> Hi Clément,
>
>> +;; See tor-browser-build/projects/translation/config.
>> +(define translation-tor-browser
>> +  (origin
>> +    (method git-fetch)
>> +    (uri (git-reference
>> +          (url "https://gitlab.torproject.org/tpo/translation.git")
>> +          (commit "e92772b4a11ced855c27eafd299cf972bef5cd8f")))
>
> The above commit is the one on the 'main' branch, but the current stable
> browser follows 'maint-13.0' (which has now changed in preparation for
> v13.0.9 release next Tuesday) and there is a tag for each release. The
> release tag for version 13.0.8 (tbb-13.0.8-build1) contains a different
> commit number (273592eca488ca3bf535d3789b1130fd1970f09a).

Well spotted!  I corrected this.

> Other than that, everything seems to perfectly mirror upstream build
> process. I've also built it, did some testing and it's working as
> expected.

I'm pretty sure we can get even closer to their build process.  For
example there are those Wasm patches that allow to have support for Wasm
sandboxed libraries if I understand clearly.  (They are already in
nonguix.)  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67512

> You are doing an awesome work, thanks!

Thank you :)

> PS: I'm sorry to have left you hanging on the lyrebird patch. I'll
> review it and, if I find anything worth of attention, I'll ping back.
> For now, I can only say that bridges are working just fine.

Okay!  I'd be glad to hear any remarks.  I'm not that confident with Go
packages.

This one is pushed.  Thanks for reviewing!
Clément




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

end of thread, other threads:[~2024-01-21  0:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 12:22 [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation Clément Lassieur
2024-01-16 12:40 ` Clément Lassieur
2024-01-16 13:31 ` [bug#68503] [PATCH v2] gnu: torbrowser: Add support or " Clément Lassieur
2024-01-18 22:46   ` [bug#68503] [PATCH v3] gnu: torbrowser: Add support for " Clément Lassieur
2024-01-20 21:29     ` André Batista
2024-01-21  0:15       ` bug#68503: " Clément Lassieur

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).