Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from mtorromeo/patch-1
Browse files Browse the repository at this point in the history
Prevent error when the Vue instance was not initialized with i18n
  • Loading branch information
claudiocro authored Nov 6, 2017
2 parents 4efa0f1 + 8a569fd commit ed9e7dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function install(_Vue) {
Vue.mixin({
computed: {
$t() {
const getKey = getByKey(this._i18nOptions, this.$i18n.i18next.options);
const getKey = getByKey(this._i18nOptions, this.$i18n ? this.$i18n.i18next.options : {});

if (this._i18nOptions && this._i18nOptions.namespaces) {
const { lng, namespaces } = this._i18nOptions;
Expand Down

0 comments on commit ed9e7dc

Please sign in to comment.