From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EOtINMR1pmVk+wAAqHPOHw:P1 (envelope-from ) for ; Tue, 16 Jan 2024 13:25:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id EOtINMR1pmVk+wAAqHPOHw (envelope-from ) for ; Tue, 16 Jan 2024 13:25:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lassieur.org header.s=fm2 header.b="j/D+FbW2"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=KXneJokq; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705407940; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=GzTmy1mMOpAGfxWkvMjgCbx0RRUxdR7LmuQnM34W/CQ=; b=u13ZcBouW/p9O6HRQpoWNRGzl9GBXjwiVjzQ1KaLAe/sQHYdaxCAxRTLLq1DVOg76HCcZc jT5r5k8wi1TDGZYyT5s5Hc0LXZ3aw2jX4Mq7pf2LS5+xV6LZUOUQX6g8qvt8wXPM2isYmf u+/CYHwBFtVhFG0VIb0PMPZqVRtQfNs0P2SYnhHTVy/+iGJw4MUwea6GE0HH173hvzOOEI sQ1pY6pygDvmfWhIy3vCz+nGKeueBzBWsKSYLg5TPlpGgyyaRRqhfwAmyovQxQrKs/kWux +BcD8SU7Z6D2tJsg2HoXIGdhSVnVvESYr46fbcXH+UHqhsXEgwinshr3wdELmw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lassieur.org header.s=fm2 header.b="j/D+FbW2"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=KXneJokq; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705407940; a=rsa-sha256; cv=none; b=SHskvWpodnncfW16z0gXQGggU7PrpdVKAQuvO9nQi7sTmPisGmDOOXJLkp4B0+lxDz1A8k /FmN/AcgWbFZYSJzlPGYG/PBOI1O/7AbA/gQvIP/Pmg459q/32YMvdUoVKssHM0KKQax0A mGxsbkQt9tQF8OCnLC1EUHi3/yTGvWExCc58fo6u+LDuF30CI2mYXdCJ0iWe9J9GQEnpwr lH5ewtWidDEw0Q+ss6XOGYQnYtv4rScazhl1ZZAsC+6xRcq855ufQShfemFMCUPum3m4Cq uRD3+rONoAu95GWjsGEjl8SK/nw9fMueqzFJwDedHBVk+JzeDMB1D0/haZ6kug== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FFD44300B for ; Tue, 16 Jan 2024 13:25:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPiVB-00073O-Vj; Tue, 16 Jan 2024 07:25:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPiV5-00072d-O3 for guix-patches@gnu.org; Tue, 16 Jan 2024 07:25:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPiV4-0008G1-SV for guix-patches@gnu.org; Tue, 16 Jan 2024 07:25:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPiV3-0006oq-Qu; Tue, 16 Jan 2024 07:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68503] [PATCH] gnu: torbrowser: Add support for language localisation. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: clement@lassieur.org, jonathan.brielmaier@web.de, guix-patches@gnu.org Resent-Date: Tue, 16 Jan 2024 12:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68503 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68503@debbugs.gnu.org Cc: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , Jonathan Brielmaier X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , Jonathan Brielmaier Received: via spool by submit@debbugs.gnu.org id=B.170540787525907 (code B ref -1); Tue, 16 Jan 2024 12:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2024 12:24:35 +0000 Received: from localhost ([127.0.0.1]:47984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPiUc-0006jm-4B for submit@debbugs.gnu.org; Tue, 16 Jan 2024 07:24:35 -0500 Received: from lists.gnu.org ([2001:470:142::17]:56358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPiUa-0006jQ-6C for submit@debbugs.gnu.org; Tue, 16 Jan 2024 07:24:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPiUQ-0006zm-Tk for guix-patches@gnu.org; Tue, 16 Jan 2024 07:24:23 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPiUO-0008CG-O4 for guix-patches@gnu.org; Tue, 16 Jan 2024 07:24:22 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 583915C00D4; Tue, 16 Jan 2024 07:24:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 16 Jan 2024 07:24:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm2; t=1705407858; x=1705494258; bh=Gz Tmy1mMOpAGfxWkvMjgCbx0RRUxdR7LmuQnM34W/CQ=; b=j/D+FbW2kyw30PiaEt PDrHWGjGhbFldcS62Ug9bvaRWtVaHpfWw49NBBS+wKBHx+QGlUOtGr389bj5SpIj QUpkifrCApNw0s42VzDkVjH0FpMqAnIa7haj+SPlFTLEZlTa+pnkMt5HEoMEdPs3 erOTidDwlsBYS+mqZFqyWZAsckXot9wfou6khnFwZkfR1HUKdSHGQDqrBwbibBTc 25NQY2aLeNgifX4PQQEuSoeqnecU4Ppy54cBb/6Fn6DGCpkPkrL7V9wYnfd+N2qt erk5AqqBZWMptAOoaW0Cf8vETl3sUx7HAUf+cpcQ2WuFtrysXeDofRdtsL8v9ZVc 1O5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1705407858; x=1705494258; bh=GzTmy1mMOpAGf xWkvMjgCbx0RRUxdR7LmuQnM34W/CQ=; b=KXneJokqS0H9dChgB8Matfa9wMTvV W0BUIX8OprfNq22dRsJtbibn4H48Z+EaXhZvywJghdyN9htuV8lMNHZgUV/ybMWu gODffykkTwN4IGAIZxkOdwg2dlR2d6Pfq9ssKNaWpQbNeGZ+p0JPFMemQvvyA1cr FkFx3JiSBOZe0QF0JJXWt3GTzGzOY00TVh5lzxyjMbggmPD1qI5Yoh+Hfji+3f7c YFJgzz7wsM6qiqooLjeBPx8loNkOjaqbPx3jpyFvy6j9A4nijLYGPmO2+CpnwHF/ quKCgUTTqHRyDzO2/eCSF1k2mZjXqJCFa9RHx2YwOZa/3OGgpE+KoiAzw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejfedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre dtredtjeenucfhrhhomhepvehlrohmvghnthcunfgrshhsihgvuhhruceotghlvghmvghn theslhgrshhsihgvuhhrrdhorhhgqeenucggtffrrghtthgvrhhnpeevhfetleevkeduie etudegheegteegffeggfeiteehuefhleegfffgudejveelgfenucffohhmrghinhepthho rhhprhhojhgvtghtrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Jan 2024 07:24:16 -0500 (EST) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Tue, 16 Jan 2024 13:22:30 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.28; envelope-from=clement@lassieur.org; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.78 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -1.78 X-Migadu-Queue-Id: 7FFD44300B X-TUID: IQa8BssqchDp * 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 ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2022 Jim Newsome -;;; Copyright © 2023 Clément Lassieur +;;; Copyright © 2023, 2024 Clément Lassieur ;;; ;;; 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