1.0.1 • Published 5 months ago

expo-native-translations v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

DEPRECATED: You can use expo native capabilities for iOS and the plugin @mmomtchev/expo-android-localized-app-name for android to achieve native translations.

expo-native-translations

Expo Config Plugin to configure native translations when the native code is generated (expo prebuild).

Adding this plugin lets you address two limitations of expo based apps:

  • Use special scripting languages for your app name (Arabic, etc.)
  • Use native translations for your app name

Expo installation

Tested against Expo SDK 45

This package cannot be used in the "Expo Go" app because it requires custom native code.

expo install expo-native-translations

After installing this npm package, add the config plugin to the plugins array of your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      [
        "expo-native-translations",
        {
          "translations": [
            { "locale": "ar", "appName": "تجرب" },
            { "locale": "en", "appName": "Plugin app" }
          ]
        }
      ]
    ]
  }
}

The first element is the default language. You need to have at least one element in your translations array.

Next, rebuild your app as described in the "Adding custom native code" guide.