Skip to content

Commit

Permalink
TW-1148 Additional refactoring according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
keshan3262 committed Nov 15, 2023
1 parent 6c6ca64 commit 3a9d593
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/i18n/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ export function getMessage(messageName: string, substitutions?: Substitutions) {

if (targetVal) return applySubstitutions(targetVal, substitutions);

const nativeVal = browser.i18n.getMessage(messageName, substitutions);
if (!target) {
const nativeVal = browser.i18n.getMessage(messageName, substitutions);

if (nativeVal && !target) return nativeVal;
if (nativeVal) return nativeVal;
}

const fallbackVal = fallback?.[messageName];

Expand Down

0 comments on commit 3a9d593

Please sign in to comment.