From c4f47271914cbad6edf568579455c48c7e1869a1 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 24 Sep 2021 01:22:43 +0900 Subject: [PATCH 1/2] feat: add sync property --- src/index.js | 3 +++ types/index.d.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 1e39c4978..b3df5ee5c 100644 --- a/src/index.js +++ b/src/index.js @@ -328,6 +328,9 @@ export default class VueI18n { get postTranslation (): ?PostTranslationHandler { return this._postTranslation } set postTranslation (handler: PostTranslationHandler): void { this._postTranslation = handler } + get sync (): boolean { return this._sync } + set sync (val: boolean): void { this._sync = value } + _getMessages (): LocaleMessages { return this._vm.messages } _getDateTimeFormats (): DateTimeFormats { return this._vm.dateTimeFormats } _getNumberFormats (): NumberFormats { return this._vm.numberFormats } diff --git a/types/index.d.ts b/types/index.d.ts index 8a73c22ce..d7cf7c247 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -174,6 +174,7 @@ export declare interface IVueI18n { silentTranslationWarn: boolean | RegExp; silentFallbackWarn: boolean | RegExp; preserveDirectiveContent: boolean; + sync: boolean; pluralizationRules: VueI18n.PluralizationRulesMap; warnHtmlInMessage: VueI18n.WarnHtmlInMessageLevel; postTranslation: VueI18n.PostTranslationHandler; @@ -228,6 +229,7 @@ declare class VueI18n { pluralizationRules: VueI18n.PluralizationRulesMap; warnHtmlInMessage: VueI18n.WarnHtmlInMessageLevel; postTranslation: VueI18n.PostTranslationHandler; + sync: boolean; t(key: VueI18n.Path, values?: VueI18n.Values): VueI18n.TranslateResult; t(key: VueI18n.Path, locale: VueI18n.Locale, values?: VueI18n.Values): VueI18n.TranslateResult; From 2ce466a1b53e71ae88b3db6f0f2cd8fd747e752a Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 24 Sep 2021 01:26:55 +0900 Subject: [PATCH 2/2] fix --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index b3df5ee5c..559c7cfd6 100644 --- a/src/index.js +++ b/src/index.js @@ -329,7 +329,7 @@ export default class VueI18n { set postTranslation (handler: PostTranslationHandler): void { this._postTranslation = handler } get sync (): boolean { return this._sync } - set sync (val: boolean): void { this._sync = value } + set sync (val: boolean): void { this._sync = val } _getMessages (): LocaleMessages { return this._vm.messages } _getDateTimeFormats (): DateTimeFormats { return this._vm.dateTimeFormats }