npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gettranslated/react-native-sdk

v1.2.0

Published

React Native SDK for GetTranslated translation management platform

Readme

GetTranslated React Native SDK

A comprehensive React Native SDK for the GetTranslated translation management platform, providing real-time, AI-powered translations for React Native applications.

🚀 Quick Start

Get up and running in under 5 minutes with our Quick Start Guide.

📚 Documentation

🎯 Key Features

  • Real-time Translation: Get translations on-demand with automatic caching
  • Anonymous User Support: Automatic user ID generation with seamless login transition
  • Language Management: Automatic language detection with override support
  • Offline Caching: Persistent translation cache using AsyncStorage
  • TypeScript Support: Full TypeScript definitions included
  • Cross-platform: Works on both iOS and Android
  • React Integration: Hooks and providers for easy React integration

📦 Installation

npm install @gettranslated/react-native-sdk
# or
yarn add @gettranslated/react-native-sdk

# iOS setup
cd ios && pod install

🔧 Basic Usage

The SDK provides two translation methods:

  • t() - For bundled/extracted resources (strings known at build time) - Primary method
  • getDynamicTranslation() - For dynamic strings (server-side messages, user-generated content, etc.)

Option 1: TranslationProvider (Recommended)

Use t() with extracted translation resources for your UI strings:

import React from 'react';
import { View, Text, Button } from 'react-native';
import { TranslationProvider, useTranslation } from '@gettranslated/react-native-sdk';

// Load your extracted translation resources (generated by CLI)
import enTranslations from './locales/en.json';
import esTranslations from './locales/es.json';
import frTranslations from './locales/fr.json';

const resources = {
  en: { translation: enTranslations },
  es: { translation: esTranslations },
  fr: { translation: frTranslations },
};

export default function App() {
  return (
    <TranslationProvider apiKey="your-api-key" resources={resources}>
      <MainScreen />
    </TranslationProvider>
  );
}

function MainScreen() {
  const { t, changeLanguage, currentLanguage } = useTranslation();

  return (
    <View>
      <Text>{t('Welcome')}</Text>
      <Text>{t('Hello, {{name}}!', { name: 'John' })}</Text>
      <Button title={t('Switch Language')} onPress={() => changeLanguage('es')} />
    </View>
  );
}

Dynamic Translations (Advanced)

For strings not known at build time (e.g., server error messages):

function ErrorScreen({ errorMessage }) {
  const { getDynamicTranslation } = useTranslation();
  const [translatedError, setTranslatedError] = React.useState(errorMessage);

  React.useEffect(() => {
    const translateError = async () => {
      // Translate server-side error message
      const translation = await getDynamicTranslation(errorMessage);
      setTranslatedError(translation);
    };
    translateError();
  }, [errorMessage]);

  return <Text>{translatedError}</Text>;
}

Option 2: withTranslations HOC

For class components:

import React from 'react';
import { withTranslations, TranslationProvider } from '@gettranslated/react-native-sdk';

class MyComponent extends React.Component<{t: (key: string) => string}> {
  render() {
    return <Text>{this.props.t('Hello, World!')}</Text>;
  }
}

export default withTranslations(MyComponent);

Option 3: Static Methods

import GetTranslated from '@gettranslated/react-native-sdk';

// Initialize with resources
const resources = {
  en: { translation: { 'Welcome': 'Welcome' } },
  es: { translation: { 'Welcome': 'Bienvenido' } }
};
await GetTranslated.init('your-api-key', undefined, undefined, resources);

// In React components - use t() from hook (preferred)
function MyComponent() {
  const { t } = useTranslation();
  return <Text>{t('Welcome')}</Text>;
}

// Static method (for utility functions outside components)
const greeting = GetTranslated.t('Welcome');

// Use getDynamicTranslation() for dynamic strings (async)
const serverError = await GetTranslated.getDynamicTranslation('Connection timeout');

📋 Requirements

  • React Native 0.60+
  • iOS 10.0+ / Android API 21+
  • Node.js 14+

🔗 Links

🔄 Migration from react-i18next

The GetTranslated SDK is designed as a drop-in replacement for react-i18next. The t() function and most APIs work identically, requiring minimal code changes.

What stays the same:

  • ✅ The t() function works identically
  • ✅ Interpolation syntax: t('Hello, {{name}}!', { name: 'John' })
  • ✅ Pluralization with structured objects: t('item_count', { count: 5 })
  • ✅ Component usage remains unchanged

What changes:

  • Replace i18n.init() with <TranslationProvider>
  • Update imports from react-i18next to @gettranslated/react-native-sdk

See our complete migration guide for step-by-step instructions.

📄 License

MIT


Ready to get started? Check out our Quick Start Guide or dive into the Complete Integration Guide for detailed documentation and examples.