Skip to content

Commit

Permalink
improvement: notify locale changing to composer (#1409)
Browse files Browse the repository at this point in the history
* improvement: notify locale changin to composer

* bump chromedriver
  • Loading branch information
kazupon committed Nov 2, 2021
1 parent 099ed66 commit 5c95bb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"babel-plugin-istanbul": "^6.0.0",
"babel-preset-power-assert": "^3.0.0",
"buble": "^0.19.3",
"chromedriver": "^93.0.0",
"chromedriver": "^95.0.0",
"core-js": "^3.6.5",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.3",
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,16 @@ export default class VueI18n {
}, { deep: true })
}

watchLocale (): ?Function {
watchLocale (composer?: any): ?Function {
/* istanbul ignore if */
if (!this._sync || !this._root) { return null }
const self = this
const target: any = this._vm
return this._root.$i18n.vm.$watch('locale', (val) => {
target.$set(target, 'locale', val)
if (self.__VUE_I18N_BRIDGE__ && composer) {
composer.locale.value = val
}
target.$forceUpdate()
}, { immediate: true })
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3136,10 +3136,10 @@ chrome-trace-event@^1.0.2:
dependencies:
tslib "^1.9.0"

chromedriver@^93.0.0:
version "93.0.1"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-93.0.1.tgz#3ed1f7baa98a754fc1788c42ac8e4bb1ab27db32"
integrity sha512-KDzbW34CvQLF5aTkm3b5VdlTrvdIt4wEpCzT2p4XJIQWQZEPco5pNce7Lu9UqZQGkhQ4mpZt4Ky6NKVyIS2N8A==
chromedriver@^95.0.0:
version "95.0.0"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-95.0.0.tgz#ecf854cac6df5137a651dcc132edf55612d3db7f"
integrity sha512-HwSg7S0ZZYsHTjULwxFHrrUqEpz1+ljDudJM3eOquvqD5QKnR5pSe/GlBTY9UU2tVFRYz8bEHYC4Y8qxciQiLQ==
dependencies:
"@testim/chrome-version" "^1.0.7"
axios "^0.21.2"
Expand Down

0 comments on commit 5c95bb5

Please sign in to comment.