From 790ebe08bf2aa093911453b62c7e73c2e9b9317f Mon Sep 17 00:00:00 2001 From: ryamaguchi0220 Date: Sun, 17 Nov 2019 06:06:29 +0900 Subject: [PATCH] fix(timeline): custom locales does not work (#187) (#188) --- lib/timeline/component/CurrentTime.js | 2 +- lib/timeline/component/CustomTime.js | 2 +- lib/timeline/component/item/Item.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/timeline/component/CurrentTime.js b/lib/timeline/component/CurrentTime.js index 4520062e25..8881d8e4eb 100644 --- a/lib/timeline/component/CurrentTime.js +++ b/lib/timeline/component/CurrentTime.js @@ -31,7 +31,7 @@ class CurrentTime extends Component { }; this.options = util.extend({}, this.defaultOptions); this.setOptions(options); - util.extend(this.options.locales, locales, this.options.locales); + this.options.locales = util.extend({}, locales, this.options.locales); const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale]; Object.keys(this.options.locales).forEach(locale => { this.options.locales[locale] = util.extend( diff --git a/lib/timeline/component/CustomTime.js b/lib/timeline/component/CustomTime.js index a44e26f4f5..cf53cfc92a 100644 --- a/lib/timeline/component/CustomTime.js +++ b/lib/timeline/component/CustomTime.js @@ -31,7 +31,7 @@ class CustomTime extends Component { }; this.options = util.extend({}, this.defaultOptions); this.setOptions(options); - util.extend(this.options.locales, locales, this.options.locales); + this.options.locales = util.extend({}, locales, this.options.locales); const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale]; Object.keys(this.options.locales).forEach(locale => { this.options.locales[locale] = util.extend( diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index ae8e2acab5..dc167a6e7d 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -29,7 +29,7 @@ class Item { locale: 'en' }; this.options = util.extend({}, this.defaultOptions, options); - util.extend(this.options.locales, locales, this.options.locales); + this.options.locales = util.extend({}, locales, this.options.locales); const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale]; Object.keys(this.options.locales).forEach(locale => { this.options.locales[locale] = util.extend(