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

Issue 2886843005: [i18n] use Polymer data binding to change locale strings (Closed)

Created:
3 years, 7 months ago by dschuyler
Modified:
3 years, 6 months ago
CC:
chromium-reviews, alemate+watch_chromium.org, achuith+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[i18n] use Polymer data binding to change locale strings This CL uses Polymer variable binding to swap out i18n strings rather than using i18n-content. BUG=692763 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2886843005 Cr-Commit-Position: refs/heads/master@{#476358} Committed: https://chromium.googlesource.com/chromium/src/+/cd00499d569a693685c81d4042b3cfe3219edd61

Patch Set 1 #

Total comments: 8

Patch Set 2 : review changes #

Total comments: 4

Patch Set 3 : use str_() to update i18n #

Total comments: 10

Patch Set 4 : using I18nBehavior #

Total comments: 17

Patch Set 5 : closure fix #

Total comments: 2

Patch Set 6 : i18nUpateLocale #

Patch Set 7 : fix indent #

Patch Set 8 : i18nDynamic test #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -52 lines) Patch
M chrome/browser/resources/chromeos/login/oobe_welcome.html View 1 2 3 4 5 6 10 chunks +63 lines, -33 lines 0 comments Download
M chrome/browser/resources/chromeos/login/oobe_welcome.js View 1 2 3 4 5 11 chunks +21 lines, -11 lines 0 comments Download
M chrome/test/data/webui/i18n_behavior_test.html View 1 2 3 4 5 6 7 1 chunk +7 lines, -1 line 5 comments Download
M ui/webui/resources/js/i18n_behavior.js View 1 2 3 4 5 3 chunks +34 lines, -7 lines 0 comments Download

Messages

Total messages: 91 (39 generated)
dschuyler
wdyt?
3 years, 7 months ago (2017-05-17 23:58:23 UTC) #5
Dan Beam
i think this would generally be fine but you should get an OOBE owner like ...
3 years, 7 months ago (2017-05-18 00:04:57 UTC) #6
dschuyler
>i think this would generally be fine but you should >get an OOBE owner like ...
3 years, 7 months ago (2017-05-18 00:46:57 UTC) #7
dschuyler
ptal This doesn't yet convert the i18n-values, that can be done later.
3 years, 7 months ago (2017-05-18 00:47:49 UTC) #9
Alexander Alekseev
https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode161 chrome/browser/resources/chromeos/login/oobe_welcome.js:161: this.i18n_ = i18n; Is this an example of what ...
3 years, 7 months ago (2017-05-19 23:57:29 UTC) #14
Alexander Alekseev
+achuith@ +xiyuan@
3 years, 7 months ago (2017-05-19 23:59:35 UTC) #16
dschuyler
https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode161 chrome/browser/resources/chromeos/login/oobe_welcome.js:161: this.i18n_ = i18n; On 2017/05/19 23:57:29, Alexander Alekseev wrote: ...
3 years, 7 months ago (2017-05-20 00:04:56 UTC) #17
dschuyler
https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode161 chrome/browser/resources/chromeos/login/oobe_welcome.js:161: this.i18n_ = i18n; On 2017/05/20 00:04:56, dschuyler wrote: > ...
3 years, 7 months ago (2017-05-20 00:26:43 UTC) #18
dschuyler
https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/20001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode161 chrome/browser/resources/chromeos/login/oobe_welcome.js:161: this.i18n_ = i18n; On 2017/05/20 00:26:43, dschuyler wrote: > ...
3 years, 7 months ago (2017-05-20 00:56:10 UTC) #21
Alexander Alekseev
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); I don't like the idea ...
3 years, 7 months ago (2017-05-20 01:21:13 UTC) #22
dschuyler
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); On 2017/05/20 01:21:12, Alexander Alekseev ...
3 years, 7 months ago (2017-05-20 01:44:48 UTC) #23
Alexander Alekseev
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); On 2017/05/20 01:44:48, dschuyler wrote: ...
3 years, 7 months ago (2017-05-20 01:50:57 UTC) #24
Dan Beam
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); fwiw: this could also just ...
3 years, 7 months ago (2017-05-20 02:03:30 UTC) #25
Alexander Alekseev
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); On 2017/05/20 02:03:29, Dan Beam ...
3 years, 7 months ago (2017-05-20 02:25:21 UTC) #26
stevenjb
I like this approach. LGTM w/ nits/suggestions. https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js File ui/webui/resources/js/i18n_behavior.js (right): https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js#newcode70 ui/webui/resources/js/i18n_behavior.js:70: * Similar ...
3 years, 7 months ago (2017-05-22 23:07:37 UTC) #32
Dan Beam
https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode136 chrome/browser/resources/chromeos/login/oobe_welcome.js:136: I18nBehavior.updateLocalizedContent.call(this); why are you overriding the same name in ...
3 years, 7 months ago (2017-05-22 23:15:56 UTC) #35
Dan Beam
https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js File ui/webui/resources/js/i18n_behavior.js (right): https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js#newcode14 ui/webui/resources/js/i18n_behavior.js:14: /* should be /**
3 years, 7 months ago (2017-05-22 23:26:12 UTC) #36
dschuyler
https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode136 chrome/browser/resources/chromeos/login/oobe_welcome.js:136: I18nBehavior.updateLocalizedContent.call(this); On 2017/05/22 23:15:56, Dan Beam wrote: > why ...
3 years, 7 months ago (2017-05-22 23:30:18 UTC) #37
dschuyler
https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js File ui/webui/resources/js/i18n_behavior.js (right): https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js#newcode14 ui/webui/resources/js/i18n_behavior.js:14: /* On 2017/05/22 23:26:12, Dan Beam wrote: > should ...
3 years, 7 months ago (2017-05-22 23:31:43 UTC) #38
dschuyler
On 2017/05/22 23:31:43, dschuyler wrote: > https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js > File ui/webui/resources/js/i18n_behavior.js (right): > > https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js#newcode14 > ...
3 years, 7 months ago (2017-05-22 23:34:12 UTC) #41
stevenjb
https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js File ui/webui/resources/js/i18n_behavior.js (right): https://codereview.chromium.org/2886843005/diff/60001/ui/webui/resources/js/i18n_behavior.js#newcode78 ui/webui/resources/js/i18n_behavior.js:78: return this.i18n.apply(this, Array.prototype.slice.call(arguments, 1)); On 2017/05/22 23:30:17, dschuyler wrote: ...
3 years, 7 months ago (2017-05-22 23:37:00 UTC) #42
Dan Beam
https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/60001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode136 chrome/browser/resources/chromeos/login/oobe_welcome.js:136: I18nBehavior.updateLocalizedContent.call(this); On 2017/05/22 23:30:17, dschuyler wrote: > On 2017/05/22 ...
3 years, 7 months ago (2017-05-22 23:38:05 UTC) #43
Dan Beam
https://codereview.chromium.org/2886843005/diff/80001/ui/webui/resources/js/i18n_behavior.js File ui/webui/resources/js/i18n_behavior.js (right): https://codereview.chromium.org/2886843005/diff/80001/ui/webui/resources/js/i18n_behavior.js#newcode78 ui/webui/resources/js/i18n_behavior.js:78: return this.i18n.apply(this, Array.prototype.slice.call(arguments, 1)); i think this slice here ...
3 years, 7 months ago (2017-05-22 23:39:02 UTC) #44
dschuyler
https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js File chrome/browser/resources/chromeos/login/oobe_welcome.js (right): https://codereview.chromium.org/2886843005/diff/40001/chrome/browser/resources/chromeos/login/oobe_welcome.js#newcode145 chrome/browser/resources/chromeos/login/oobe_welcome.js:145: this.set('i18n_', this.i18n_ + 1); On 2017/05/20 02:03:29, Dan Beam ...
3 years, 7 months ago (2017-05-23 00:03:19 UTC) #51
stevenjb
LGTM++
3 years, 7 months ago (2017-05-23 00:14:09 UTC) #52
Dan Beam
lgtm but can you write a test?
3 years, 7 months ago (2017-05-23 16:28:13 UTC) #55
dschuyler
On 2017/05/23 16:28:13, Dan Beam wrote: > lgtm but can you write a test? I ...
3 years, 7 months ago (2017-05-24 01:03:51 UTC) #58
Dan Beam
https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html File chrome/test/data/webui/i18n_behavior_test.html (right): https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html#newcode42 chrome/test/data/webui/i18n_behavior_test.html:42: } hmmmm, seems like we could make a more ...
3 years, 7 months ago (2017-05-24 02:08:45 UTC) #59
dschuyler
ping for other reviewers to lgtm or request a change.
3 years, 7 months ago (2017-05-24 21:09:48 UTC) #62
xiyuan
lgtm
3 years, 7 months ago (2017-05-24 21:10:55 UTC) #63
Alexander Alekseev
I still don't like the approach that requires (non-trivial!) changes to JS to support the ...
3 years, 7 months ago (2017-05-25 00:20:08 UTC) #64
stevenjb
On 2017/05/25 00:20:08, Alexander Alekseev wrote: > I still don't like the approach that requires ...
3 years, 7 months ago (2017-05-25 00:28:55 UTC) #65
Dan Beam
On 2017/05/25 00:20:08, Alexander Alekseev wrote: > I still don't like the approach that requires ...
3 years, 7 months ago (2017-05-25 00:37:22 UTC) #66
Alexander Alekseev
On 2017/05/25 00:37:22, Dan Beam wrote: > On 2017/05/25 00:20:08, Alexander Alekseev wrote: > > ...
3 years, 7 months ago (2017-05-25 01:19:54 UTC) #67
Alexander Alekseev
On 2017/05/25 00:28:55, stevenjb wrote: > On 2017/05/25 00:20:08, Alexander Alekseev wrote: > > I ...
3 years, 7 months ago (2017-05-25 01:22:30 UTC) #68
stevenjb
On 2017/05/25 01:22:30, Alexander Alekseev wrote: > On 2017/05/25 00:28:55, stevenjb wrote: > > On ...
3 years, 7 months ago (2017-05-25 14:56:59 UTC) #69
Alexander Alekseev
On 2017/05/25 14:56:59, stevenjb wrote: > On 2017/05/25 01:22:30, Alexander Alekseev wrote: > > On ...
3 years, 7 months ago (2017-05-25 19:24:32 UTC) #70
stevenjb
On 2017/05/25 19:24:32, Alexander Alekseev wrote: > On 2017/05/25 14:56:59, stevenjb wrote: > > On ...
3 years, 7 months ago (2017-05-25 20:26:17 UTC) #71
Alexander Alekseev
On 2017/05/25 20:26:17, stevenjb wrote: > On 2017/05/25 19:24:32, Alexander Alekseev wrote: > > On ...
3 years, 7 months ago (2017-05-25 20:33:09 UTC) #72
achuithb
On 2017/05/25 20:33:09, Alexander Alekseev wrote: > On 2017/05/25 20:26:17, stevenjb wrote: > > On ...
3 years, 6 months ago (2017-05-29 01:15:28 UTC) #73
dschuyler
achuithb@, thanks for the info. IMO, it's perfectly reasonable to be unfamiliar with Polymer details. ...
3 years, 6 months ago (2017-05-30 18:49:58 UTC) #75
dschuyler
On 2017/05/30 18:49:58, dschuyler wrote: > achuithb@, thanks for the info. IMO, it's perfectly reasonable ...
3 years, 6 months ago (2017-05-31 00:47:53 UTC) #76
dschuyler
On 2017/05/31 00:47:53, dschuyler wrote: > On 2017/05/30 18:49:58, dschuyler wrote: > > achuithb@, thanks ...
3 years, 6 months ago (2017-05-31 00:48:28 UTC) #77
Dan Beam
still lgtm
3 years, 6 months ago (2017-05-31 00:50:18 UTC) #78
xiyuan
https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html File chrome/test/data/webui/i18n_behavior_test.html (right): https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html#newcode40 chrome/test/data/webui/i18n_behavior_test.html:40: assertEquals("I'm just text, nobody should have a problem with ...
3 years, 6 months ago (2017-05-31 15:38:41 UTC) #79
stevenjb
still lgtm
3 years, 6 months ago (2017-05-31 16:21:18 UTC) #80
dschuyler
https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html File chrome/test/data/webui/i18n_behavior_test.html (right): https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html#newcode40 chrome/test/data/webui/i18n_behavior_test.html:40: assertEquals("I'm just text, nobody should have a problem with ...
3 years, 6 months ago (2017-05-31 18:23:17 UTC) #81
xiyuan
https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html File chrome/test/data/webui/i18n_behavior_test.html (right): https://codereview.chromium.org/2886843005/diff/140001/chrome/test/data/webui/i18n_behavior_test.html#newcode40 chrome/test/data/webui/i18n_behavior_test.html:40: assertEquals("I'm just text, nobody should have a problem with ...
3 years, 6 months ago (2017-05-31 18:31:50 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2886843005/140001
3 years, 6 months ago (2017-05-31 21:21:30 UTC) #84
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/468860)
3 years, 6 months ago (2017-05-31 22:21:16 UTC) #86
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2886843005/140001
3 years, 6 months ago (2017-06-01 18:17:16 UTC) #88
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 18:22:35 UTC) #91
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/cd00499d569a693685c81d4042b3...

Powered by Google App Engine
This is Rietveld 408576698