Page translation does not for German locale
Reported by
yastrebo...@gmail.com,
Oct 18 2016
|
|||||||||||
Issue description
Chrome Version : 54.0.2840.59 (64-bit)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari:
Firefox:
IE:
What steps will reproduce the problem?
(1) Go to http://www.berlin.de/
(2) Click translate icon in searchbar
What is the expected result?
Page is translated to english
What happens instead?
Message appears "This page could not be translated"
Please provide any additional information below. Attach a screenshot if
possible.
The issue was introduced within https://codereview.chromium.org/2251273002
by commit 22e782e1834f4bbd7e12835210488c97f264951a
In components/translate/core/browser/translate_script.cc JSON is formed by use of printf %f format specifier:
var gtTimeInfo = {'fetchStart': %f, 'fetchEnd': %f};\n
which produces comma as decimal separator in de_DE.UTF-8 locale (and possibly other non en_US) and results in console error "VM167:2 Uncaught SyntaxError: Unexpected token ,"
Running chrome in en_US.UTF-8 locale fixes this.
Suggested solution is to form JSON via dedicated library or format floating point numbers manually according to JSON standard where decimal separator is dot.
,
Oct 18 2016
This looks like a P0 to me since it break a major feature.
,
Oct 18 2016
Could you reproduce this? I have hard time to reproduce this. Which OS are you running?
,
Oct 18 2016
I was not aware that StringAppendF is locale sensitive formatting when I wrote the code. This is actually scary. Implicit Locale model is so evil and cause so many problems in the last 30 years :( . patch is in https://codereview.chromium.org/2429873002/ The bug was landed in "Fri Aug 19 22:18:22 2016" before M54 branch off. It could be too late to cherrypick into M54 but we should for sure cherrypick this asap
,
Oct 18 2016
I am running Ubuntu 14.04.5 LTS on x86_64 You can reproduce this by running :~$ LC_NUMERIC="de_DE.UTF-8" google-chrome
,
Oct 18 2016
I believe correct format specifier is "%.0f" since you want to express zero precision.
,
Oct 18 2016
http://en.cppreference.com/w/cpp/io/c/fprintf "%0.f" also mean 0 precision. (optional) . followed by integer number or *, or neither that specifies precision of the conversion. In the case when * is used, the precision is specified by an additional argument of type int. If the value of this argument is negative, it is ignored. If neither a number nor * is used, the precision is taken as zero.
,
Oct 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b9d0a55329d102f77806a432896795e24b2bb916 commit b9d0a55329d102f77806a432896795e24b2bb916 Author: ftang <ftang@chromium.org> Date: Tue Oct 25 21:46:28 2016 fix translate breakage under de_DE.UTF8 and other locale by avoiding locale sensitve formatting for float point BUG= 656922 Review-Url: https://codereview.chromium.org/2429873002 Cr-Commit-Position: refs/heads/master@{#427492} [modify] https://crrev.com/b9d0a55329d102f77806a432896795e24b2bb916/components/translate/core/browser/translate_script.cc
,
Oct 25 2016
,
Oct 25 2016
Is this change applicable to all os or any specific os?
,
Oct 25 2016
,
Oct 26 2016
The change is for all OS. I am not 100% sure it is needed for all OS (in other words, we only know at least in some OS under some locale it break, I am not sure all OS will have that issue unless I test it under all locale, which could be too hard to figure out). It break on Linux for sure. Not sure about Mac and Windows.
,
Oct 26 2016
FWIW, I spent some time digging (because it seemed weird to me you should need a format string), and the "standard" way to convert numbers to strings is DoubleToString. Or IntToString if you don't want precision anyways. All OS's will format strings locale-specific if you use printf and friends. I'd suggest changing the code to use DoubleToString and avoiding printf in general.
,
Oct 26 2016
,
Oct 26 2016
Your change meets the bar and is auto-approved for M55 (branch: 2883)
,
Oct 26 2016
got the msg from Srinivasarao Mummareddy "If possible could you please merge your change to M55 branch 2883 before tomorrow 4 PM PST." groby- Could you merge it into M55?
,
Oct 26 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/57799b8e472b0f97da2672d672530fc8c2b288ae commit 57799b8e472b0f97da2672d672530fc8c2b288ae Author: Rachel Blum <groby@google.com> Date: Wed Oct 26 23:52:39 2016 [Merge to M55] Fix broken translation, remove local-dependent format Was: fix translate breakage under de_DE.UTF8 and other locale by avoiding locale sensitve formatting for float point BUG= 656922 Review-Url: https://codereview.chromium.org/2429873002 Cr-Commit-Position: refs/heads/master@{#427492} (cherry picked from commit b9d0a55329d102f77806a432896795e24b2bb916) Review URL: https://codereview.chromium.org/2454013002 . Cr-Commit-Position: refs/branch-heads/2883@{#326} Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768} [modify] https://crrev.com/57799b8e472b0f97da2672d672530fc8c2b288ae/components/translate/core/browser/translate_script.cc
,
Oct 27 2016
+ ligimole@, bustamante@ - FYI for M54
,
Oct 27 2016
I'm not able to reproduce this on Linux, are there specific steps? I don't think this meets the bar for merging into M54 (we're only taking critical fixes right now, like Chrome hangs or doesn't launch or a security vulnerability).
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/57799b8e472b0f97da2672d672530fc8c2b288ae commit 57799b8e472b0f97da2672d672530fc8c2b288ae Author: Rachel Blum <groby@google.com> Date: Wed Oct 26 23:52:39 2016 [Merge to M55] Fix broken translation, remove local-dependent format Was: fix translate breakage under de_DE.UTF8 and other locale by avoiding locale sensitve formatting for float point BUG= 656922 Review-Url: https://codereview.chromium.org/2429873002 Cr-Commit-Position: refs/heads/master@{#427492} (cherry picked from commit b9d0a55329d102f77806a432896795e24b2bb916) Review URL: https://codereview.chromium.org/2454013002 . Cr-Commit-Position: refs/branch-heads/2883@{#326} Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768} [modify] https://crrev.com/57799b8e472b0f97da2672d672530fc8c2b288ae/components/translate/core/browser/translate_script.cc
,
Oct 27 2016
Verified on Chrome 55.0.2883.29/CrOS 8872.27.0 - Candy, Daisy, reks
,
Oct 27 2016
Verified that the fix is working fine on CrOS bEta build # 8872.27.0/55.0.2883.29 - Paine, Blaze & Peppy.
,
Nov 1 2016
Pri-0 bugs are critical regressions or serious emergencies, and this bug has not been updated in three days. Could you please provide an update, or adjust the priority to a more appropriate level if applicable? If a fix is in active development, please set the status to Started. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 1 2016
,
Nov 4 2016
[Automated comment] removing mislabelled merge-merged-2840
,
Nov 4 2016
[Automated comment] removing mislabelled merge-merged-2840
,
Nov 4 2016
Hi, I also had this problem. Check: https://productforums.google.com/forum/?utm_medium=email&utm_source=footer#!msg/chrome/85fxEi6ARr0/39mNkTbSCAAJ
,
Mar 10 2017
Bought Surface (Win 10 Pro) in January 2017. Installed Chrome and Translate extensions, but does nothing to translate French or German pages in Facebook. See for example, https://www.facebook.com/FRANCE24/app/121241974571942/ Nothing happens. Does FB block Chrome extensions on its pages? This wasn't the case in the past.
,
Mar 13 2017
this is a linux only bug, nothing to do with Win |
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by yastrebo...@gmail.com
, Oct 18 2016