File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,14 @@ class LiveTranslatorManager {
139
139
document . body . appendChild ( this . _enableButton ) ;
140
140
// initialize encode
141
141
const originalFormatter = this . _options . i18n . formatter ;
142
+ const self = this ;
142
143
this . _options . i18n . formatter = {
143
144
interpolate ( message , values , path ) {
144
145
const meta = ZeroWidthEncoder . encode ( JSON . stringify ( {
145
146
message,
146
147
values,
147
148
path,
148
- locale : this . _options . i18n . locale ,
149
+ locale : self . _options . i18n . locale ,
149
150
} ) ) ;
150
151
const original = originalFormatter . interpolate ( message , values , path ) ;
151
152
return ( original && this . _enabled ) ? [ meta , ...original ] : original ;
Original file line number Diff line number Diff line change @@ -162,14 +162,15 @@ class LiveTranslatorManager {
162
162
163
163
// initialize encode
164
164
const originalFormatter = this . _options . i18n . formatter
165
+ const self = this
165
166
this . _options . i18n . formatter = {
166
167
interpolate ( message , values , path ) {
167
168
const meta = ZeroWidthEncoder . encode (
168
169
JSON . stringify ( {
169
170
message,
170
171
values,
171
172
path,
172
- locale : this . _options . i18n . locale ,
173
+ locale : self . _options . i18n . locale ,
173
174
} ) ,
174
175
)
175
176
const original = originalFormatter . interpolate ( message , values , path ) as unknown [ ] | null
You can’t perform that action at this time.
0 commit comments