Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: components/translate/core/browser/translate_script.cc

Issue 2429873002: fix translate breakage under de_DE.UTF8 and other locale by avoiding locale sensitve formatting for… (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/translate/core/browser/translate_script.h" 5 #include "components/translate/core/browser/translate_script.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 google_apis::GetAPIKey().c_str()); 138 google_apis::GetAPIKey().c_str());
139 139
140 // Insert server params to pass experimental params to google translate 140 // Insert server params to pass experimental params to google translate
141 // server. 141 // server.
142 std::string server_params; 142 std::string server_params;
143 std::map<std::string, std::string> params; 143 std::map<std::string, std::string> params;
144 if (variations::GetVariationParams(kTranslateServerStudy, &params)) { 144 if (variations::GetVariationParams(kTranslateServerStudy, &params)) {
145 server_params = params[kServerParams]; 145 server_params = params[kServerParams];
146 } 146 }
147 base::StringAppendF( 147 base::StringAppendF(
148 &data_, "var gtTimeInfo = {'fetchStart': %f, 'fetchEnd': %f};\n", 148 &data_, "var gtTimeInfo = {'fetchStart': %0.f, 'fetchEnd': %0.f};\n",
149 script_fetch_start_time_, base::Time::Now().ToJsTime()); 149 script_fetch_start_time_, base::Time::Now().ToJsTime());
150 base::StringAppendF(&data_, "var serverParams = '%s';\n", 150 base::StringAppendF(&data_, "var serverParams = '%s';\n",
151 server_params.c_str()); 151 server_params.c_str());
152 152
153 GURL security_origin = translate::GetTranslateSecurityOrigin(); 153 GURL security_origin = translate::GetTranslateSecurityOrigin();
154 base::StringAppendF( 154 base::StringAppendF(
155 &data_, "var securityOrigin = '%s';", security_origin.spec().c_str()); 155 &data_, "var securityOrigin = '%s';", security_origin.spec().c_str());
156 156
157 // Append embedded translate.js and a remote element library. 157 // Append embedded translate.js and a remote element library.
158 base::StringPiece str = ResourceBundle::GetSharedInstance(). 158 base::StringPiece str = ResourceBundle::GetSharedInstance().
(...skipping 12 matching lines...) Expand all
171 171
172 for (RequestCallbackList::iterator it = callback_list_.begin(); 172 for (RequestCallbackList::iterator it = callback_list_.begin();
173 it != callback_list_.end(); 173 it != callback_list_.end();
174 ++it) { 174 ++it) {
175 it->Run(success, data); 175 it->Run(success, data);
176 } 176 }
177 callback_list_.clear(); 177 callback_list_.clear();
178 } 178 }
179 179
180 } // namespace translate 180 } // namespace translate
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698