Wrap i18n message GRIT placeholders in a <ph> element |
|||
Issue descriptionGRIT i18n message placeholder have the form %d or %s, and 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 When this is not done, applications can fail to work when reading the i18n translated strings, see issue 908767 for example. There are only 3 chrome i18n <message>'s that need fixing. They all use %s, and only as a literal, not a real placeholder. These should be easy to fix. Once that is done, issue 915681 can resolve, and lock down use to prevent developers submitting invalid i18n messages.
,
Jan 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/468cd7506daf3a55436cd7bfeeb392c2873e020b commit 468cd7506daf3a55436cd7bfeeb392c2873e020b Author: Noel Gordon <noel@chromium.org> Date: Sat Jan 12 03:10:08 2019 Wrap IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL_EXPLANATION %s in a <ph> element This IDS string contains a "%s" substring. Ensure the substring is not localized: wrap the "%s" substring in an i18n <ph> placeholder element, which ensures translators can't modify it. No change in behavior, no new tests. Bug: 920577 Change-Id: I1afafd2d943c20cd7aa9c418e9309d3f54d2b7b8 Reviewed-on: https://chromium-review.googlesource.com/c/1404905 Commit-Queue: Noel Gordon <noel@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#622279} [modify] https://crrev.com/468cd7506daf3a55436cd7bfeeb392c2873e020b/chrome/app/settings_strings.grdp
,
Jan 12
,
Today
(23 hours ago)
Still waiting for the translations of the message changed in #2 to be rolled into chrome: <message name="IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL_EXPLANATION" desc="..."> URL with <ph name="SPECIAL_SYMBOL">%s</ph> in place of query </message> The current (old) translation id is 1545786162090505744 and there was no <ph> wrapper around the "%s". Code searching for the translations https://cs.chromium.org/search/?q=1545786162090505744&sq=package:chromium&type=cs showed that, yeap, i18n translators sometimes decided to fiddle with the %s in the message: chrome/app/resources/generated_resources_el.xtb <translation id="1545786162090505744">URL με % στη θέση του ερωτήματος</translation> chrome/app/resources/generated_resources_mr.xtb <translation id="1545786162090505744">क्वेरीच्या जागेवर % सह URL</translation> chrome/app/resources/generated_resources_ar.xtb <translation id="1545786162090505744">عنوان URL الذي يحتوي على % بدلاً من طلب البحث</translation> chrome/app/resources/generated_resources_lv.xtb <translation id="1545786162090505744">URL ar zīmēm % vaicājuma vietā</translation> chrome/app/resources/generated_resources_ko.xtb <translation id="1545786162090505744">URL(검색어 자리에 % 입력)</translation> chrome/app/resources/generated_resources_fil.xtb <translation id="1545786162090505744">URL na may mga % sa lugar ng query</translation> When the new translations for this meesage rolls, the <ph> added in #2 will protect the %s, and so the errors listed above will be gone. |
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Jan 10