File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -168,16 +168,22 @@ class LiveTranslatorManager {
168
168
const self = this
169
169
this . _options . i18n . formatter = {
170
170
interpolate ( message , values , path ) {
171
- const meta = ZeroWidthEncoder . encode (
172
- JSON . stringify ( {
173
- message,
174
- values,
175
- path,
176
- locale : self . _options . i18n . locale ,
177
- } ) ,
178
- )
179
171
const original = originalFormatter . interpolate ( message , values , path ) as unknown [ ] | null
180
- return ( original && self . _enabled ) ? [ meta , ...original ] : original
172
+ let meta = ''
173
+ try {
174
+ meta = ZeroWidthEncoder . encode (
175
+ JSON . stringify ( {
176
+ message,
177
+ values,
178
+ path,
179
+ locale : self . _options . i18n . locale ,
180
+ } ) ,
181
+ )
182
+ } catch ( exception ) {
183
+ console . warn ( path , exception )
184
+ }
185
+
186
+ return ( original && meta && self . _enabled ) ? [ meta , ...original ] : original
181
187
} ,
182
188
}
183
189
You can’t perform that action at this time.
0 commit comments