From 84040cb58c9c004ba9d995c38a680021595a741f Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 24 Sep 2021 01:29:32 +0900 Subject: [PATCH] feat: add sync property (#1388) * feat: add sync property * fix --- 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..559c7cfd6 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 = val } + _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;