From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 17EDC385020C for ; Fri, 10 Jun 2022 10:00:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17EDC385020C Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 5D8EB300089; Fri, 10 Jun 2022 10:00:22 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI , Tristan Gingold , Nelson Chu Cc: binutils@sourceware.org Subject: [PATCH 0/2] gas: Minor strings fix on June 2022 (Mach-O and RISC-V) Date: Fri, 10 Jun 2022 19:00:17 +0900 Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 10:00:26 -0000 This patchset contains some minor string improvements I discovered while I'm investigating/translating GAS. All patches are independent and can be applied independently. PATCH 1 : gas/config/obj-macho.c (i18n enablement) PATCH 2 : gas/config/tc-riscv.c (wording / consistency) PATCH 1 : gas/config/obj-macho.c (i18n enablement) On collect_16char_name on this file, there's a formatted error message: > as_bad (_("the %s name '%s' is too long (maximum 16 characters)"), > msg, namstart); collect_16char_name is called by obj_mach_o_get_section_names but it does not wrap input `msg' parameter. Quoting from the function: > if (collect_16char_name (seg, "segment", 1)) > collect_16char_name (sec, "section", 0); The words "segment" and "section" should be wrapped with _(). This is not a problem on French but it IS on Spanish. I quote some Spanish translation from gas/po/es.po: > #: config/obj-macho.c:119 > #, c-format > msgid "the %s name '%s' is too long (maximum 16 characters)" > msgstr "el nombre %s «%s» es demasiado largo (máximo 16 caracteres)" > #: config/tc-aarch64.c:607 config/tc-arm.c:1072 config/tc-i860.c:1003 > #: config/tc-sparc.c:3440 > msgid "bad segment" > msgstr "segmento equivocado" > #: config/tc-alpha.c:4274 > #, c-format > msgid "unknown section attribute %s" > msgstr "atributo seccional %s desconocido" It will have following mappings on Spanish: segment --> segmento section --> seccional In Japanese (the language I am trying to translate some GAS strings), it will be visiblly significant: Sample message in English: the section name 'ABC...' is too long (maximum 16 characters) Possible Japanese translation without this patch: section 名 'ABC...' が長すぎます (最大 16 文字) Possible Japanese translation with this patch: セクション名 'ABC...' が長すぎます (最大 16 文字) In here, an English word "section" stands out too much in otherwise Japanese message. If we can translate the word "section" (technically, transliterate) to "セクション" (Hepburn: sekushon), the whole sentense gets more natural. It will have following mappings on Japanese: segment --> セグメント section --> セクション PATCH 2 : gas/config/tc-riscv.c (wording / consistency) This is about consistency. Quoting some from riscv_ip, there are similar error messages here: > as_bad (_("bad value for compressed funct6 " > "field, value must be 0...64")); > as_bad (_("bad value for compressed funct4 " > "field, value must be 0...15")); > as_bad (_("bad value for compressed funct3 " > "field, value must be 0...7")); > as_bad (_("bad value for compressed funct2 " > "field, value must be 0...3")); You can see the difference. For funct2, funct3 and funct4, ranges in error strings are 0...(2^n-1). However on funct6, range in the error string is 0...(2^n). This patch fixes this inconsistency by changing from 0...64 to 0...63. Tsukasa OI (2): Mach-O: i18n enablement on some error messages RISC-V: Fix inconsistent error message (range) gas/config/obj-macho.c | 4 ++-- gas/config/tc-riscv.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) base-commit: 6a72edd8e26c670bbdce7aeae3c0c8f793fc8612 -- 2.34.1