Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp791976rdb; Fri, 17 Nov 2023 12:54:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEp4O6MUEy15DU3IQCn4gLVejBPhhgezIDZlpbqmWI/C6YRrssti4Wq/p7ibATQ0OTwVlcP X-Received: by 2002:a17:90b:4c08:b0:27d:76e2:ab18 with SMTP id na8-20020a17090b4c0800b0027d76e2ab18mr839990pjb.9.1700254491421; Fri, 17 Nov 2023 12:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700254491; cv=none; d=google.com; s=arc-20160816; b=jWGNSsJIpFqZlrQ/0f590iW+H3NvXYTghdqnuXNSYMtR0+dpwGrOtaD1RxydBG3SWw OQ/wKs1YRnkiu02IY+xhm6/5ZrE+drK1HnCAPb2TnIO4V5dj0MuuPBYckIxW4zWyp1x8 dNKO1B+h5bqcO16tfcaHzwVwqCfVVdOBNJrOalSQBUiw+v97BYO1LG5YII2PTx22OmpP YyT/cVfzNpTYTfXOV7+bdijD3lYziHqi/GDWOCWZUKDxgU8xDESI+3q4YihVf3DvTBwl wfndyqTzL6HENHBEGx4kbvPOk2Cnjuq29xMXWlhJfCt5h88KnZP58iIoIEvHTbKFFlQ1 RwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-filter; bh=UFOFab7bcdXv3kvUShDoiZLRoQEShkU0i5I1WrKuIrk=; fh=Una+4Ezp+o7Ik9tqXhLQdcezoWECGzd43lP5M/8AHzs=; b=OeA9r0keGU9CmIltxV9dYtxgVzh9gOrN+y+d41GN3o7g23w+kgu0r+4W95X9eTQoQg iqlKfQgYNMv9BQRC0wpPwa32P7B2FC9asT1THA8xVevD3OaQutXRYOTKnhRlpZofnvkR L4hWGuhOhieIkaGgtiBk1puiNV+G6uZJxdWphmL2XIU5XKwn4k7+7DVPhl3bwVikOoMP NA01dC3llV7mBqH1wk13Jd8e4FPFgUW4ozpe18HFeuKRALJvtuSTwv19SmNregT6SOJJ otNRSZTm4CTKoCA4g9jGpuP61MxFcpWQxu7f5stZhFo8LA4skk+gOmfNS3k3RN8lmNXm icmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=igJNBVYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a19-20020a17090a8c1300b0028307e08316si2561639pjo.156.2023.11.17.12.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 12:54:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=igJNBVYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 057698250240; Fri, 17 Nov 2023 12:54:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232331AbjKQUyn (ORCPT + 99 others); Fri, 17 Nov 2023 15:54:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjKQUym (ORCPT ); Fri, 17 Nov 2023 15:54:42 -0500 Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC4F10D9; Fri, 17 Nov 2023 12:54:39 -0800 (PST) Received: from localhost (unknown [98.53.138.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id DA8AB2F3; Fri, 17 Nov 2023 20:54:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net DA8AB2F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1700254479; bh=UFOFab7bcdXv3kvUShDoiZLRoQEShkU0i5I1WrKuIrk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=igJNBVYfBsRcfEIzW7qwu97V8IDQYS/lm7jcCq3GaREVu7DuhsEbm2KaYHsQkk8TO rvL2A0XFe0ptLrcOaew7lHsDr+CLBeQbt58SpjH5kK1J3s1aRZMNHdpWS8osZtbWjY zsz/BuJ5GXBm/Urz3deoQ1WtPGekw7FjlogfvXoq5YXs24lRKT6QaKf3E65ZyuvOHI HqBw+RyJis8xlxubrgefhO7qEPPlqPqdZUE4j66DIXq2TmfTTxgCG4TtuPYg/WYUbV 0jHpNeQFykFJohsr1VjdTEaHK73YdPdsp1JMzU5MFTjcs5UB4CuHcthIvkcMlGLYPP WeJTXvsbyJv4A== From: Jonathan Corbet To: Vegard Nossum Cc: linux-doc@vger.kernel.org, Federico Vaga , Akira Yokosawa , Carlos Bilbao , Alex Shi , Yanteng Si , Hu Haowen , linux-kernel@vger.kernel.org, Vegard Nossum Subject: Re: [PATCH] docs: translations: add translations links when they exist In-Reply-To: <20231028162931.261843-1-vegard.nossum@oracle.com> References: <20231028162931.261843-1-vegard.nossum@oracle.com> Date: Fri, 17 Nov 2023 13:54:29 -0700 Message-ID: <87cyw885iy.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 12:54:49 -0800 (PST) Vegard Nossum writes: > Add a new Sphinx extension that knows about the translations of kernel > documentation and can insert links to the translations at the top of > the document. > > It basically works like this: > > 1. Register a new node type, LanguagesNode. > > 2. Register a new transform, TranslationsTransform, that inserts a new > LanguageNode at the top of every document. The LanguageNode contains > "pending references" to translations of the document. The key here > is that these are pending (i.e. unresolved) references that may or > may not actually exist. > > 3. Register a 'doctree-resolved' event that iterates over all the > LanguageNode nodes. Any unresolved references are filtered out; the > list of resolved references is passed to the 'translations.html' > template and rendered as an HTML node (if HTML output is selected). > > Testing: make htmldocs with v7.3.0. > > Signed-off-by: Vegard Nossum > --- > Documentation/conf.py | 2 +- > Documentation/sphinx-static/custom.css | 8 ++ > .../sphinx/templates/translations.html | 12 +++ > Documentation/sphinx/translations.py | 96 +++++++++++++++++++ > 4 files changed, 117 insertions(+), 1 deletion(-) > create mode 100644 Documentation/sphinx/templates/translations.html > create mode 100644 Documentation/sphinx/translations.py OK, this does seem to work. The naming of the translations definitely needs to change; if we put out something with "Taiwanese" in it, experience tells me, there will be objections - and that's not what the translation was called when it was added. I'm unsure about putting the languages in the top bar like that; it will already become pretty wide with the relabeled translations, and may not look great on a small-screen device. Perhaps a pulldown would be better? The build problem reported by Akira definitely needs to be fixed as well. Thanks, jon