@@ -102,9 +102,9 @@ export default class VueI18n {
102102
103103 get vm ( ) : any { return this . _vm }
104104
105- get messages ( ) : LocaleMessages { return looseClone ( this . _vm . messages ) }
106- get dateTimeFormats ( ) : DateTimeFormats { return looseClone ( this . _vm . dateTimeFormats ) }
107- get numberFormats ( ) : NumberFormats { return looseClone ( this . _vm . numberFormats ) }
105+ get messages ( ) : LocaleMessages { return looseClone ( this . _getMessages ( ) ) }
106+ get dateTimeFormats ( ) : DateTimeFormats { return looseClone ( this . _getDateTimeFormats ( ) ) }
107+ get numberFormats ( ) : NumberFormats { return looseClone ( this . _getNumberFormats ( ) ) }
108108
109109 get locale ( ) : Locale { return this . _vm . locale }
110110 set locale ( locale : Locale ) : void {
@@ -125,6 +125,10 @@ export default class VueI18n {
125125 get silentTranslationWarn ( ) : boolean { return this . _silentTranslationWarn }
126126 set silentTranslationWarn ( silent : boolean ) : void { this . _silentTranslationWarn = silent }
127127
128+ _getMessages ( ) : LocaleMessages { return this . _vm . messages }
129+ _getDateTimeFormats ( ) : DateTimeFormats { return this . _vm . dateTimeFormats }
130+ _getNumberFormats ( ) : NumberFormats { return this . _vm . numberFormats }
131+
128132 _warnDefault ( locale : Locale , key : Path , result : ?any , vm : ?any ) : ?string {
129133 if ( ! isNull ( result ) ) { return result }
130134 if ( this . missing ) {
@@ -250,7 +254,7 @@ export default class VueI18n {
250254 }
251255
252256 t ( key : Path , ...values : any ) : TranslateResult {
253- return this . _t ( key , this . locale , this . messages , null , ...values )
257+ return this . _t ( key , this . locale , this . _getMessages ( ) , null , ...values )
254258 }
255259
256260 _i ( key : Path , locale : Locale , messages : LocaleMessages , host : any , ...values : any ) : any {
@@ -282,7 +286,7 @@ export default class VueI18n {
282286 params . push ( values [ i ] )
283287 }
284288
285- return this . _i ( key , locale , this . messages , null , ...params )
289+ return this . _i ( key , locale , this . _getMessages ( ) , null , ...params )
286290 }
287291
288292 _tc (
@@ -301,7 +305,7 @@ export default class VueI18n {
301305 }
302306
303307 tc ( key : Path , choice ?: number , ...values : any ) : TranslateResult {
304- return this . _tc ( key , this . locale , this . messages , null , choice , ...values )
308+ return this . _tc ( key , this . locale , this . _getMessages ( ) , null , choice , ...values )
305309 }
306310
307311 _te ( key : Path , locale : Locale , messages : LocaleMessages , ...args : any ) : boolean {
@@ -310,7 +314,7 @@ export default class VueI18n {
310314 }
311315
312316 te ( key : Path , locale ? : Locale ) : boolean {
313- return this . _te ( key , this . locale , this . messages , locale )
317+ return this . _te ( key , this . locale , this . _getMessages ( ) , locale )
314318 }
315319
316320 getLocaleMessage ( locale : Locale ) : LocaleMessageObject {
@@ -344,7 +348,7 @@ export default class VueI18n {
344348 }
345349
346350 let ret = ''
347- const dateTimeFormats = this . dateTimeFormats
351+ const dateTimeFormats = this . _getDateTimeFormats ( )
348352 if ( key ) {
349353 let locale : Locale = _locale
350354 if ( isNull ( dateTimeFormats [ _locale ] [ key ] ) ) {
@@ -413,7 +417,7 @@ export default class VueI18n {
413417 }
414418
415419 let ret = ''
416- const numberFormats = this . numberFormats
420+ const numberFormats = this . _getNumberFormats ( )
417421 if ( key ) {
418422 let locale : Locale = _locale
419423 if ( isNull ( numberFormats [ _locale ] [ key ] ) ) {
0 commit comments