From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 03AF57F47 for ; Thu, 10 Sep 2015 12:06:14 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 96424AC00A for ; Thu, 10 Sep 2015 10:06:10 -0700 (PDT) Received: from sandeen.net (sandeen.net [63.231.237.45]) by cuda.sgi.com with ESMTP id J2hy7ZSYtWCn3D3F for ; Thu, 10 Sep 2015 10:06:08 -0700 (PDT) Received: from Liberator.local (unknown [10.0.0.195]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 0CB2F6371E26 for ; Thu, 10 Sep 2015 11:51:11 -0500 (CDT) Subject: Re: [PATCH 0/13] xfs_repair: recombine cut&waste code in dir2.c/attr_repair.c References: <1441827251-13128-1-git-send-email-sandeen@sandeen.net> <20150910092224.GB2613@zion.usersys.redhat.com> From: Eric Sandeen Message-ID: <55F1B4FC.5040207@sandeen.net> Date: Thu, 10 Sep 2015 11:51:08 -0500 MIME-Version: 1.0 In-Reply-To: <20150910092224.GB2613@zion.usersys.redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com On 9/10/15 4:22 AM, Carlos Maiolino wrote: > On Wed, Sep 09, 2015 at 02:33:58PM -0500, Eric Sandeen wrote: ... >> The last patch fixes up the dir vs. attr text in error messages >> and comments. I do have a question about whether this is ok >> for i8n: >> >> printf(_("This string is %s"), _("awesome")); > > This should be fine for i18n, I had used it a lot when I added i18n support in > gfs2-utils, and _() is the default macro that should embrace every string that > needs to be translated. It will be replaced by gettext("awesome"), and there is > no problem in using it as printf() argument for format specifiers. > > What you should be careful though, is that how these strings will 'look' to the > person translating it, which, in most of cases, they are not going to look at > the code to get a better meaning of the string. So, the sentences to be > translated, should make sense by itself. > > > I particularly, don't like much the idea of split strings as you did in the > example, exactly because how it might look to the translators, both strings > makes the same sentence, but they will show to the translators as completely > different strings, and the translator might not be able to find the proper > grammatical construction. So, I'd do something like: > > printf(funny ? _("This string is awesome") : _("This string is boring")) > > > I know that I might sound picky here, but, this is the best way to avoid weird > and non-sense string translations. No, that makes sense, but it kind of sucks, too - writing the same string twice everywhere, once for attr & once for dir, is a bit bleah. Maybe I can restructure it such that it's more easily translatable, something like using a prefix, i.e. %s: block %d is unreadable for inode %lld -> turns into -> dir: block %d is unreadable for inode %lld - or - attr: block %d is unreadable for inode %lld and then it's not cutting a sentence in half, to interfere with grammar from other languages ... -Eric _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs