@verbx/localize-react-native
v0.2.0
Published
VerbX Localize — React Native SDK: persistent cache that survives process kill, device locale detection, <Text>-safe <T>.
Readme
@verbx/localize-react-native
The React Native SDK for VerbX Localize. React Native is React,
so the hooks and engine come straight from
@verbx/localize-react; this package adds
the two things a device needs and a browser does not — a cache that survives the process being
killed, and locale detection without navigator.
npm install @verbx/localize-react-native @react-native-async-storage/async-storageimport AsyncStorage from "@react-native-async-storage/async-storage";
import { VerbXNativeProvider } from "@verbx/localize-react-native";
import { getLocales } from "react-native-localize";
export default function App() {
return (
<VerbXNativeProvider
config={{
apiKey: "vx_…",
projectKey: "proj_…",
supportedLocales: ["en", "es", "hi"],
}}
storage={AsyncStorage}
deviceLanguages={getLocales().map((l) => l.languageTag)}
>
<Navigation />
</VerbXNativeProvider>
);
}import { T, useT } from "@verbx/localize-react-native";
function TripCard() {
const t = useT();
return (
<View>
{/* <T> renders a real <Text> — a bare string in a <View> throws in React Native */}
<T componentType="Heading">Your upcoming trip</T>
<Text>{t("Add to itinerary")}</Text>
</View>
);
}Notes
storagetakes any AsyncStorage-shaped object — MMKV, expo-sqlite, or a test double all work. Omit it to stay in-memory (the cache is then lost on a cold start).<T>renders<Text>, because React Native throws if a bare string reaches a<View>. Uset()for strings you pass as props (placeholder,accessibilityLabel).- No native module is required.
Docs
Full guide, the CLI, and the GitHub agent: localize.verbxeco.com — the Docs section is readable without an account.
License
Proprietary. See LICENSE.md and the VerbX terms of service.
