From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 4543B1FEB3 for ; Tue, 3 Jan 2017 19:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933385AbdACTpO (ORCPT ); Tue, 3 Jan 2017 14:45:14 -0500 Received: from mail-qk0-f178.google.com ([209.85.220.178]:34862 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbdACTpM (ORCPT ); Tue, 3 Jan 2017 14:45:12 -0500 Received: by mail-qk0-f178.google.com with SMTP id u25so375014269qki.2 for ; Tue, 03 Jan 2017 11:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WELGs/ObEtL1jU5OiULae3+dV4/xOLf2msFwED98J5k=; b=BirGPqW+rTNn7xn1biE/jTyg48jcZaaalS4+D+A6ENT6ifT0tA92wj3U9TjghQ6l7W 1GDwGhQn61KZ3iFgTsH/PnQ9u+fFoKz3Au4G/VFAmNids6bOXoBMIWKQ/VvJTdXKfioG 4uXqC+2lkx6z+rEiRgKsTUnWWLCPOfy2IxVbgM10VUVqfGedVa21kwAjYxfyjyeSfYSi u/VJtWPeQZyD+ry9OyLGgHKCPFHLHZs+3/QTftSA3cxPCp525+uaux2NU7TZ2bhhevfE F6/uXekQZ/QWeN+F8uZJEaIgWMaflnLYo1xWkSJYYI28rZj8ZpTFVNCe24VnBicOV0Jc cHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WELGs/ObEtL1jU5OiULae3+dV4/xOLf2msFwED98J5k=; b=kjw0+aY8jA8tKjvEooj2BBQUaVpeL/jQUJbq4CyOFqsc//F9mna5Xq3jeY5Qm8QRDP Pd3adDpiUSZSZgz8YkAWNH5RAmBnW4fa+4EQyGopBJHrlwnKyps9F0t2ExjABHLs81gd DLlhLO1cjiE0XKZ32uatmWRAka80scHUaItJzWWU/pNEdMcLsYRKQ4z3NM7Z3NgzWR5U QCuppKtyFZrprPaLghQ5IhKere7UJle0TGN0vVnURzTL5AxNZrLcsRLB/ztE7ytg140T a1dqdMVJ1ILr1DNQDQJl1XpMVJ69TApGUQVpacg4+OUqfTakFva9JoETS/HU1X4a8Lhz 5FZw== X-Gm-Message-State: AIkVDXI+1rxpsPxGegPayb0YTLO6DFjF0tQFJBb5k/Tn1oXRutwhUJepbVaey2asMVQCz2hhZoawkpd1tPwLtkLZ X-Received: by 10.55.221.5 with SMTP id n5mr59293016qki.58.1483472711225; Tue, 03 Jan 2017 11:45:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.146.7 with HTTP; Tue, 3 Jan 2017 11:45:10 -0800 (PST) In-Reply-To: References: From: Stefan Beller Date: Tue, 3 Jan 2017 11:45:10 -0800 Message-ID: Subject: Re: [RFC PATCH 0/5] Localise error headers To: Michael J Gruber Cc: "git@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Jan 2, 2017 at 3:14 AM, Michael J Gruber wrote: > Currently, the headers "error: ", "warning: " etc. - generated by die(), > warning() etc. - are not localized, but we feed many localized error messages > into these functions so that we produce error messages with mixed localisation. > > This series introduces variants of die() etc. that use localised variants of > the headers, i.e. _("error: ") etc., and are to be fed localized messages. So, > instead of die(_("not workee")), which would produce a mixed localisation (such > as "error: geht ned"), one should use die_(_("not workee")) (resulting in > "Fehler: geht ned"). Have you considered die_("non localized error here") to produce: "Fehler: trotzdem uebersetzt hier" ("error: here it is translated") > > In this implementation, the gettext call for the header and the body are done > in different places (error function vs. caller) but this call pattern seems to > be the easiest variant for the caller, because the message body has to be marked > for localisation in any case, and N_() requires more letters than _(), an extra > argument to die() etc. even more than the extra "_" in the function name. I see. We have to markup the strings to be translatable such that the .po files are complete. It would be really handy if there was a way to say "anything that is fed to this function (die_) needs to be marked for translation. Looking through https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html such a thing doesn't seem to exist. So in that case die_(_(...)) seems to be the easiest way forward. Thanks, Stefan