From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SAczMkve9WMiRAEAbAwnHQ (envelope-from ) for ; Wed, 22 Feb 2023 10:20:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oP1TMUve9WPRIwEAG6o9tA (envelope-from ) for ; Wed, 22 Feb 2023 10:20:11 +0100 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 2965CDAD2 for ; Wed, 22 Feb 2023 10:20:10 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AoEkg6j4; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677057611; a=rsa-sha256; cv=none; b=TQ7NenHOWrqTWlSIVY7fOMpWZQRGCKJFKrUjMlGu0W8M4GOdjqPzmyp7jIK1HWlvMbXVOf ZCuIJP2t+hVmMVRq9mzsFwOds4e5qGa0yJO9Cw5QwOwQqzabTaBon0H2WGYQHyjgnx0Sfw KliEoIYRD65FRx2QxH0yU4CJLH+m9K7t+WMcxQiWzqXc9/BY7tCxNh+w3NX0tBWnZc7YjQ +oJgiWLcWKmaQDcIDGehUOD/ZxjaD/ue+0a9AvlOORj/26ZJDKvm+f5JxI00wR62axQw+v lSzFTZjZzezoSd5vMG80CKh0aNNl+KV6imUIGMuiETUgOxVcmH/XoBTyeNf2Rw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AoEkg6j4; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677057611; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=DstiBUmV+bm+OtDLMqR6WFnOU5lcOUxxNUHfl/OuS1w=; b=R2LqxXvdVpU77SPh+psyH4ZW7Jep+kAbAoCHDcMDC9cJ9AARxKKqtv8o3WglltJVfJwmpp fLhapl1U7q8KPGGUSdUKLMJjcIzB/b+Mq4v4WLnNvumLProN2+j0/kjsf8L+Hc88I0S7ZC Zq0xiO6cTRQyT+BlBVMY12TuQqrhuT3Ze3VE5wF5ltRL14/q2J2ZD0aS+LNOANVj6g+6GB e8lW4WKehkQeCaMXESkzdw2lubKBThlWfmV96WIqvpqagoiGFf8ro9PE49corEJJSzD6N/ wOGOewOgCdJuCHoGRlr8aKJwUCkOkYsvrlMIAm1TzKcE/P3zX78aZSXnDFam5Q== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUlIB-0001HA-NU; Wed, 22 Feb 2023 04:20:03 -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 1pUlIA-0001H0-Hw for bug-guix@gnu.org; Wed, 22 Feb 2023 04:20:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUlIA-0005Q1-7S for bug-guix@gnu.org; Wed, 22 Feb 2023 04:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUlIA-0007pb-2a for bug-guix@gnu.org; Wed, 22 Feb 2023 04:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: LibreOffice locales Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 22 Feb 2023 09:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32026 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Cc: mhw@netris.org, 32026@debbugs.gnu.org, Jonathan Brielmaier Received: via spool by 32026-submit@debbugs.gnu.org id=B32026.167705757430056 (code B ref 32026); Wed, 22 Feb 2023 09:20:02 +0000 Received: (at 32026) by debbugs.gnu.org; 22 Feb 2023 09:19:34 +0000 Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUlHi-0007oh-1X for submit@debbugs.gnu.org; Wed, 22 Feb 2023 04:19:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUlHd-0007oS-Q4 for 32026@debbugs.gnu.org; Wed, 22 Feb 2023 04:19:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUlHX-0005LO-Qs; Wed, 22 Feb 2023 04:19:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=DstiBUmV+bm+OtDLMqR6WFnOU5lcOUxxNUHfl/OuS1w=; b=AoEkg6j4Kf7tMfLET1+f HUX/WqBGXdZ7USODCUDwCW6kKl1ktihXXnc+OQMPg5V0I16RTdQJGftTHSuoMZJc1zUU+Z29nHfeE yT9VO0DxILIh7sdHganbQmCRIiAWAeFFHyRcr8+QJ1IsbI7qp2FEyP707yMogJYCfg8TJUZKsYnX8 nzkrVaCEzSOE9nYmVpVfVMavfkloMMhh9Mj4j74tY854IZ97ab4dyrZoUBGkQUEmrFcZkYQUc2CAS PmUKBbQkxPbOTH8r49VyLIp2/K9q8Qw8vujmaPyOQoZUaWPizAh4piXMcqP1P1ysc9Y1c+qKM6VNg 8esyJ/poM+/e4A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUlHX-0006xO-Df; Wed, 22 Feb 2023 04:19:23 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230219192405.26549-1-maxim.cournoyer@gmail.com> <87edqkiojf.fsf@gnu.org> <87y1osl58k.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quartidi 4 =?UTF-8?Q?Vent=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du =?UTF-8?Q?Tro=C3=A8ne?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 22 Feb 2023 10:19:21 +0100 In-Reply-To: <87y1osl58k.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 20 Feb 2023 10:35:23 -0500") Message-ID: <87mt569hwm.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 2965CDAD2 X-Spam-Score: -3.46 X-Migadu-Spam-Score: -3.46 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: fHdWTd3UtaXP --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> (A couple of years ago I started working on that for the LibreOffice >> package. I got quite far but didn=E2=80=99t complete it. I can dig tha= t from >> my stashes if there=E2=80=99s interest in giving a hand.) > > I'd be interested to pick it up, yes! Perhaps not in the coming 2 > weeks, which will be very busy for me, but afterward. Here=E2=80=99s the WIP patch and associated LibreOffice patch (which didn= =E2=80=99t quite work for some reason: LO wouldn=E2=80=99t look for locales where I wa= nted it to.) Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Unstaged modified gnu/packages/libreoffice.scm @@ -6,7 +6,7 @@ ;;; Copyright =C2=A9 2017 Thomas Danckaert ;;; Copyright =C2=A9 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2017 Andy Wingo -;;; Copyright =C2=A9 2017, 2018 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2017, 2018, 2019 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2017, 2018, 2019 Marius Bakke ;;; Copyright =C2=A9 2017 Rutger Helling ;;; Copyright =C2=A9 2018, 2019 Ricardo Wurmus @@ -53,6 +53,7 @@ (define-module (gnu packages libreoffice) #:use-module (gnu packages documentation) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) + #:use-module (gnu packages gettext) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) #:use-module (gnu packages glib) @@ -969,7 +970,8 @@ (define-public libreoffice "0apbmammmp4pk473xiv5vk50r4c5gjvqzf9jkficksvz58q= 6114f")))) (search-patches "libreoffice-boost.patch" "libreoffice-icu.patch" - "libreoffice-glm.patch"))) + "libreoffice-glm.patch" + "libreoffice-locale-directory.patch"))) (modules '((guix build utils))) (snippet '(begin @@ -1164,6 +1166,16 @@ (define (install-appdata app) "--disable-pdfium" "--disable-gtk" ; disable use of GTK+ 2 "--without-doxygen"))) + + (native-search-paths + ;; This Guix-specific environment variable tells LibreOffice where to + ;; find locale data as provided by the 'libreoffice-translation-*' + ;; packages. + (list (search-path-specification + (variable "LO_LOCALE_DIRECTORY") + (separator #f) + (files '("share/libreoffice/locale"))))) + (home-page "https://www.libreoffice.org/") (synopsis "Office suite") (description "LibreOffice is a comprehensive office suite. It contains @@ -1172,3 +1184,84 @@ (define (install-appdata app) flowcharting application; Base, a database and database frontend; Math for editing mathematics.") (license mpl2.0))) + +(define (libreoffice-translation language) + (package + (inherit libreoffice) + (name (string-append "libreoffice-translation-" language)) + (version (package-version libreoffice)) + (build-system gnu-build-system) + (arguments + (substitute-keyword-arguments (package-arguments libreoffice) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (add-after 'unpack 'unpack-translations + (lambda* (#:key inputs #:allow-other-keys) + (let ((translations (assoc-ref inputs "translations"))) + (mkdir "src") + (symlink translations + (string-append "src/libreoffice-translations-" + ,version ".tar.xz")) + #t))) + (replace 'build + (lambda _ + (invoke "make" "build-l10n-only" + "-j" (number->string (parallel-job-count))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (locale (string-append out + ,(string-append + "/share/libreoffice/locale/" + language + "/LC_MESSAGES"))) + (registry (string-append out + "/lib/libreoffice/share/reg= istry"))) + (for-each (lambda (mo) + (install-file mo locale)) + (find-files "." "\\.mo$")) + (for-each (lambda (xcd) + (install-file xcd registry)) + (find-files "." "^Langpack-.*\\.xcd$")) + (for-each (lambda (xcd) + (install-file xcd + (string-append registry "/res")= )) + (find-files "." + ,(string-append language "\\.xcd$")= )) + #t))) + (delete 'bin-and-desktop-install))) + ((#:configure-flags flags '()) + `(cons ,(string-append "--with-lang=3D" language) ,flags)) + ((#:tests? _ #f) + #f))) + (native-inputs + `(("gettext" ,gnu-gettext) + ("translations" ,(origin + (method url-fetch) + (uri (string-append + "https://download.documentfoundation.org/l= ibreoffice/src/" + (version-prefix version 3) "/libreoffice-t= ranslations-" + version ".tar.xz")) + (sha256 + (base32 + "15fdni68b3kyl6115v0d24cl0dp1hdjhkx571w086lrpz= 0fk9mfi")))) + ,@(package-native-inputs libreoffice))) + (synopsis "Translation of the LibreOffice user interface"))) + +(define %libreoffice-translations + ;; List of available translations. Obtained by calling 'scandir' on the + ;; contents of 'translations/source' from the "libreoffice-translations" + ;; tarball. + '("ab" "af" "am" "an" "ar" "as" "ast" "az" "be" "bg" "bn" "bn-IN" "bo" "= br" + "brx" "bs" "ca" "ca-valencia" "cs" "cy" "da" "de" "dgo" "dz" "el" "en-= GB" + "en-ZA" "eo" "es" "et" "eu" "fa" "fi" "fr" "fy" "ga" "gd" "gl" "gu" "g= ug" + "he" "hi" "hr" "hsb" "hu" "id" "is" "it" "ja" "jv" "ka" "kab" "kk" "kl" + "km" "kmr-Latn" "kn" "ko" "kok" "ks" "ky" "lb" "lo" "lt" "lv" "mai" "m= k" + "ml" "mn" "mni" "mr" "my" "nb" "ne" "nl" "nn" "nr" "nso" "oc" "om" "or" + "pa-IN" "pl" "pt" "pt-BR" "ro" "ru" "rw" "sah" "sa-IN" "sat" "sd" "si" + "sid" "sk" "sl" "sq" "sr" "sr-Latn" "ss" "st" "sv" "sw-TZ" "szl" "ta" = "te" + "tg" "th" "ti" "tn" "tr" "ts" "tt" "ug" "uk" "ur" "uz" "ve" "vec" "vi" + "xh" "zh-CN" "zh-TW" "zu")) + +(define-public libreoffice-l10n-fr + (libreoffice-translation "fr")) --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=libreoffice-locale-directory.patch Content-Transfer-Encoding: quoted-printable Content-Description: the LO patch Define a new environment variable to determine the directory where message catalogs ('.mo' files) are to be be looked up. LibreOffice already has environment variables such as 'BRAND_BASE_DIR' and 'BRAND_SHARE_RESOURCE_SUBDIR' but these are not helpful in this case. Patch by Ludovic Court=C3=A8s . --- libreoffice-6.1.5.2/unotools/source/i18n/resmgr.cxx 2019-03-10 16:22:21= .352963608 +0100 +++ libreoffice-6.1.5.2/unotools/source/i18n/resmgr.cxx 2019-03-10 16:30:20= .090848346 +0100 @@ -144,6 +144,11 @@ namespace Translate rtl::Bootstrap::expandMacros(uri); OUString path; osl::File::getSystemPathFromFileURL(uri, path); + + const char *cLocaleDir =3D ::getenv("LO_LOCALE_DIRECTORY"); + if (cLocaleDir !=3D NULL) + path =3D OUString::createFromAscii(cLocaleDir); + OString sPath(OUStringToOString(path, osl_getThreadTextEncoding())= ); gen.add_messages_path(sPath.getStr()); #if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID --=-=-=--