@@ -118,7 +118,7 @@ export function trans<
118
118
: [ message : M , parameters : P , domain ?: RemoveIntlIcuSuffix < D > , locale ?: LocaleOf < M > ]
119
119
) : string ;
120
120
export function trans <
121
- M extends Message < TranslationsType , LocaleType > | string ,
121
+ M extends Message < TranslationsType , LocaleType > | string ,
122
122
D extends DomainsOf < M > ,
123
123
P extends ParametersOf < M , D >
124
124
> (
@@ -180,14 +180,13 @@ export function trans<
180
180
return message . id ;
181
181
}
182
182
183
-
184
183
export function registerDomain ( domain : DomainMessages ) : void {
185
184
for ( const [ id , message ] of Object . entries ( domain ) ) {
186
185
if ( typeof _registeredTranslations [ id ] === 'undefined' ) {
187
186
_registeredTranslations [ id ] = message ;
188
187
continue ;
189
188
}
190
- let domainName = Object . keys ( message . translations ) [ 0 ] ;
189
+ const domainName = Object . keys ( message . translations ) [ 0 ] ;
191
190
if ( typeof _registeredTranslations [ id ] . translations [ domainName ] === 'undefined' ) {
192
191
_registeredTranslations [ id ] . translations [ domainName ] = message . translations [ domainName ] ;
193
192
continue ;
@@ -200,13 +199,12 @@ export function resetRegisteredDomains(): void {
200
199
_registeredTranslations = { } ;
201
200
}
202
201
203
- function getRegisteredMessage ( key : string , domain : DomainType ) : Message < TranslationsType , LocaleType > | string
204
- {
202
+ function getRegisteredMessage ( key : string , domain : DomainType ) : Message < TranslationsType , LocaleType > | string {
205
203
if ( typeof _registeredTranslations [ key ] === 'undefined' ) {
206
204
return key ;
207
205
}
208
- if ( typeof _registeredTranslations [ key ] [ 'translations' ] [ domain + " +intl-icu" ] !== 'undefined' ) {
209
- domain = domain + " +intl-icu" ;
206
+ if ( typeof _registeredTranslations [ key ] [ 'translations' ] [ domain + ' +intl-icu' ] !== 'undefined' ) {
207
+ domain = domain + ' +intl-icu' ;
210
208
}
211
209
if ( typeof _registeredTranslations [ key ] [ 'translations' ] [ domain ] === 'undefined' ) {
212
210
return key ;
0 commit comments