File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -123,19 +123,19 @@ export class I18n {
123
123
private activeMessages : object = reactive ( { } )
124
124
125
125
/**
126
- * Creates a new instance of the I18n class
126
+ * Creates a new instance of the I18n class, applying default options
127
127
*/
128
128
constructor ( options : OptionsInterface = { } ) {
129
- this . setOptions ( options )
129
+ this . options = { ... DEFAULT_OPTIONS , ... options }
130
130
131
131
this [ isServer ? 'loadLanguage' : 'loadLanguageAsync' ] ( this . getActiveLanguage ( ) )
132
132
}
133
133
134
134
/**
135
- * Sets options on the instance
135
+ * Sets options on the instance, preserving any values not present in new options
136
136
*/
137
137
setOptions ( options : OptionsInterface = { } ) : I18n {
138
- this . options = { ...DEFAULT_OPTIONS , ...options }
138
+ this . options = { ...this . options , ...options }
139
139
140
140
return this
141
141
}
You can’t perform that action at this time.
0 commit comments