Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions examples/react-native-expo/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ export default function App() {
useEffect(() => { if (Platform.OS === 'android') NavigationBar.setStyle('dark') }, [])
useEffect(() => {
// The app, not the SDK, remembers the picked language. The first screen waits
// for this read (and the fonts), so it opens in the remembered language; a
// failed read starts in English.
void Promise.resolve().then(() => AsyncStorage.getItem(LANGUAGE_KEY)).catch(() => null).then(language => {
// for this read (and the fonts), so it opens with that language selected. A
// failed read starts in English; the screen appears whatever the read did.
void Promise.resolve().then(() => AsyncStorage.getItem(LANGUAGE_KEY)).then(language => {
if (language === 'system') setSavedSystem(true)
if (language) void client.i18n.changeLanguage(language === 'system' ? systemLanguage() : language)
setLanguageRead(true)
})
}).catch(() => undefined).finally(() => setLanguageRead(true))
}, [])
return <SafeAreaProvider initialMetrics={initialWindowMetrics}>
<StatusBar barStyle="light-content" />
Expand Down
2 changes: 1 addition & 1 deletion examples/react-native-expo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pnpm dev:expo

The app uses Expo **54.0.37**, React Native **0.81.5**, React **19.1.0**, and Hermes. Open it in an Expo SDK 54-compatible client or a development build that includes AsyncStorage.

Tap the current locale to open the language dropdown, then choose a language. The selected locale has a checkmark. The app saves the choice, System default included, in AsyncStorage (`@react-native-async-storage/async-storage`, declared by the app) and restores it on the next start: the first screen waits for that read and the reading fonts, so it opens in the remembered language. With nothing saved, or when AsyncStorage fails, the app starts in English. Tap the selector again or press Android Back to dismiss the menu. Pull down in the library or reader to refresh, or use the refresh control in the library, reader, or Reading settings.
Tap the current locale to open the language dropdown, then choose a language. The selected locale has a checkmark. The app saves the choice, System default included, in AsyncStorage (`@react-native-async-storage/async-storage`, declared by the app) and restores it on the next start: the first screen waits for that read and the reading fonts, so it opens with the remembered language selected. A bundled language shows its text at once; a dashboard-only language shows English until ReRune loads it from its cache or the CDN. With nothing saved, or when AsyncStorage fails, the app starts in English. Tap the selector again or press Android Back to dismiss the menu. Pull down in the library or reader to refresh, or use the refresh control in the library, reader, or Reading settings.

The background fills the screen edge-to-edge. `react-native-safe-area-context` keeps library, reader, sheets, and the font loading and error content clear of status bars, display cutouts, Android navigation bars, and the iOS home indicator, including in landscape. Status-bar icons are light; `expo-navigation-bar` and the Android app configuration keep three-button navigation legible on the dark background. See Expo's [safe-area guide](https://docs.expo.dev/versions/v54.0.0/sdk/safe-area-context/) and [navigation-bar API](https://docs.expo.dev/versions/v54.0.0/sdk/navigation-bar/).

Expand Down
Loading