New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 915656 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

MD Extensions Error Lines plural i18n placeholder $1 should be wrapped in <ph> element

Project Member Reported by noel@chromium.org, Dec 17

Issue description

https://chromium-review.googlesource.com/c/chromium/src/+/869890 updated an i18n message to be plural 

chrome/app/md_extensions_strings.grdp
 string IDS_MD_EXTENSIONS_ERROR_LINES_NOT_SHOWN
   "other {&lt;$1 lines not shown&gt;}}"

Placeholder elements like $1 $2, should be wrapped in <ph> elements according to the docs [1] [2]

[1] https://sites.google.com/a/chromium.org/dev/developers/design-documents/ui-localization#TOC-How-to-add-a-string
[2] https://sites.google.com/a/chromium.org/dev/developers/tools-we-use-in-chromium/grit/grit-users-guide#Adding_Resources

but the docs do not mention how/what to do with plurals.  Should placeholder $1 $2 etc in plurals be wrapped in <ph> elements?

I noticed that components/payments_strings.grdp

  <message name="IDS_PAYMENT_REQUEST_ORDER_SUMMARY_MORE_ITEMS" desc="The label in the Order Summary section of the Payment Sheet that indicates how many display items are hidden. [ICU Syntax]">
    {MORE_ITEMS, plural,
      =1 {<ph name="ITEM_COUNT">#<ex>1</ex></ph> more item}
      other {<ph name="ITEM_COUNT">#<ex>2</ex></ph> more items}}
  </message>

wrapped them.  I also noticed how a translated plural message that did not wrap its placesholders $1 $2 $3, appeared (badly) in language=bn 

./components/strings/components_strings_bn.xtb
<translation id="262424810616849754">{COUNT,plural, =0{কিছুই নয়}=1{১টি অ্যাপ ($১)}=2{২টি অ্যাপ ($১, $২)}one{#টি অ্যাপ ($১, $২, $৩)}other{#টি অ্যাপ ($১, $২, $৩)}}</translation>

Suggests to me that placeholders in plurals should be wrapped in <ph>.  Thoughts? 
 
Filed  issue 915663  about the ./components/strings/components_strings_bn.xtb plural problem / bad translation.
Labels: bad-i18n-placeholders
Labels: OS-Chrome OS-Linux OS-Mac OS-Windows
Status: Assigned (was: Untriaged)
Cc: scottchen@chromium.org
Owner: noel@chromium.org
Let me see if I can fix it for ya ...
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/28505695462e59443b9e46ba344a246cdf3b0d7e

commit 28505695462e59443b9e46ba344a246cdf3b0d7e
Author: Noel Gordon <noel@chromium.org>
Date: Fri Dec 21 02:37:33 2018

Fix Extensions WebUI i18n message $1 placeholder

Placeholders like $1 $2 etc must be wrapped in a <ph> element, per the
chromium i18n docs [1][2].

[1] https://sites.google.com/a/chromium.org/dev/developers/design-documents/ui-localization#TOC-How-to-add-a-string
[2] https://sites.google.com/a/chromium.org/dev/developers/tools-we-use-in-chromium/grit/grit-users-guide#Adding_Resources

Bug:  915656 
Change-Id: Ib978b04665d31d4b690dd7fa7c98aff1ffaa4481
Reviewed-on: https://chromium-review.googlesource.com/c/1388065
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618436}
[modify] https://crrev.com/28505695462e59443b9e46ba344a246cdf3b0d7e/chrome/app/md_extensions_strings.grdp

Status: Fixed (was: Assigned)

Sign in to add a comment