Skip to content

Commit

Permalink
Add fallback for localized texts
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Sep 17, 2024
1 parent c9f0940 commit 85821fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/interactivity-router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,14 @@ function a11ySpeak( messageKey: keyof typeof navigationTexts ) {
navigationTexts.loaded = parsed.i18n.loaded;
}
} catch {}
} else {
// Fallback to localized strings from Interactivity API state.
if ( state.navigation.texts?.loading ) {
navigationTexts.loading = state.navigation.texts.loading;
}
if ( state.navigation.texts?.loaded ) {
navigationTexts.loaded = state.navigation.texts.loaded;
}
}
}

Expand Down

0 comments on commit 85821fd

Please sign in to comment.