Skip to content

Commit 2308683

Browse files
authored
Break iteration in formatWithFallback if no missing string reported. (#162)
1 parent 3eb3709 commit 2308683

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fluent-dom/src/localization.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default class Localization {
4646
}
4747
const missingIds = keysFromContext(method, ctx, keys, translations);
4848

49+
if (missingIds.size === 0) {
50+
break;
51+
}
52+
4953
if (typeof console !== "undefined") {
5054
const locale = ctx.locales[0];
5155
const ids = Array.from(missingIds).join(", ");

0 commit comments

Comments
 (0)