UNPKG

1.97 kBMarkdownView Raw
1# expo-localization
2
3Provides an interface for native user localization information.
4
5# API documentation
6
7- [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/localization.md)
8- [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/localization/)
9
10# Installation
11
12This package is pre-installed in [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects. You may skip the rest of the installation guide if this applies to you.
13
14For bare React Native projects, you must ensure that you have [installed and configured the `@unimodules/core` package](https://github.com/unimodules/core) before continuing.
15
16### Add the package to your npm dependencies
17
18```
19npm install expo-localization
20```
21
22### Configure for iOS
23
24Add the dependency to your `Podfile` and then run `pod install`.
25
26```ruby
27pod 'EXLocalization', path: '../node_modules/expo-localization/ios'
28```
29
30### Configure for Android
31
321. Append the following lines to `android/settings.gradle`:
33
34```gradle
35include ':expo-localization'
36project(':expo-localization').projectDir = new File(rootProject.projectDir, '../node_modules/expo-localization/android')
37```
38
392. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
40```gradle
41api project(':expo-localization')
42```
43
443. In `MainApplication.java`, import the package and add it to the `ReactModuleRegistryProvider` list:
45```java
46import expo.modules.expo.modules.localization.LocalizationPackage;
47```
48```java
49private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(
50 // Your other packages will be here
51 new LocalizationPackage()
52), Arrays.<SingletonModule>asList());
53```
54
55# Contributing
56
57Contributions are very welcome! Please refer to guidelines described in the [contributing guide]( https://github.com/expo/expo#contributing).