Skip to content

Commit

Permalink
address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
agubler committed Jan 31, 2020
1 parent 8353859 commit f28b9b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ export function setLocale(options: SetLocaleOptions = {}): Promise<string> | str
if (supplementalLoader && supplementalLoader !== true) {
loaderPromises.push(supplementalLoader());
}
const localCldrLoader = cldrLoaders[userLocale];
if (localCldrLoader && localCldrLoader !== true) {
loaderPromises.push(localCldrLoader());
const localeCldrLoader = cldrLoaders[userLocale];
if (localeCldrLoader && localeCldrLoader !== true) {
loaderPromises.push(localeCldrLoader());
}
const loadFallback = !matchedLocale && fallbackLoader && fallbackLoader !== true;
if (loadFallback && fallbackLoader && fallbackLoader !== true) {
Expand Down
4 changes: 2 additions & 2 deletions tests/core/unit/middleware/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ describe('i18n middleware', () => {
root.innerHTML,
'<div><div>{"foo":""}</div><div></div><div>true</div><div>{"locale":"es"}</div><button>es</button></div>'
);
es.resolver({ default: { foo: 'holla, {name}' } });
es.resolver({ default: { foo: 'hola, {name}' } });
await es.promise;
resolvers.resolveRAF();
assert.strictEqual(
root.innerHTML,
'<div><div>{"foo":"holla, {name}"}</div><div>holla, John</div><div>false</div><div>{"locale":"es"}</div><button>es</button></div>'
'<div><div>{"foo":"hola, {name}"}</div><div>hola, John</div><div>false</div><div>{"locale":"es"}</div><button>es</button></div>'
);
});

Expand Down
4 changes: 2 additions & 2 deletions tests/core/unit/mixins/I18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ describe('i18n Mixin', () => {
root.innerHTML,
'<div lang="es"><div>{"foo":""}</div><div></div><div>true</div><div>{"locale":"es"}</div><button>es</button></div>'
);
es.resolver({ default: { foo: 'holla, {name}' } });
es.resolver({ default: { foo: 'hola, {name}' } });
await es.promise;
resolvers.resolveRAF();
assert.strictEqual(
root.innerHTML,
'<div lang="es"><div>{"foo":"holla, {name}"}</div><div>holla, John</div><div>false</div><div>{"locale":"es"}</div><button>es</button></div>'
'<div lang="es"><div>{"foo":"hola, {name}"}</div><div>hola, John</div><div>false</div><div>{"locale":"es"}</div><button>es</button></div>'
);
});

Expand Down

0 comments on commit f28b9b0

Please sign in to comment.