# react-native-localizable

> React Native Localizable

Latest version **1.0.1** (published 2018-02-16) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install react-native-localizable
pnpm add react-native-localizable
yarn add react-native-localizable
bun add react-native-localizable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-02-16 |
| First published | 2018-01-08 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 110.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | https://github.com/fabriciovergal |
| Maintainers | fabriciovergal |
| Keywords | react-native, react-component, localizable, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-localizable
- Repository: https://github.com/fabriciovergal/react-native-localizable
- Issues: https://github.com/fabriciovergal/react-native-localizable/issues
- npm.io page: https://npm.io/package/react-native-localizable

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-02-16
- 1.0.0 — 2018-01-08

## README

# react-native-localizable

Decrease your bundle.js size by using translation directly from native layer as native app :)

### Instalation
```
npm install --save react-native-localizable
react-native link react-native-localizable
```

### Instalation Android 

```java
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new RNLocalizablePackage(R.string.class) // << Add your application R.string here!
    );
}
```
On strings.xml
```xml
<resources>
    <string name="STRING_FROM_NATIVE">Hello from the NATIVE side, I must've called a thousand time...</string>
</resources>
```
### Instalation iOS 

Create Localizable.strings file as a normal iOS application.

On localizable.strings

```
"STRING_FROM_NATIVE" = "Hello from the NATIVE side, I must've called a thousand time...";
```

### App side

Javascript:
```javascript 
    import Localizable from 'react-native-localizable';
    console.log(Localizable.STRING_FROM_NATIVE);
 ```
 
 Typescript: 
 ```typescript 
    import Localizable from 'react-native-localizable';
    
    interface Strings {
        STRING_FROM_NATIVE: string
    }
    
    const strings = Localizable as String;
    console.log(strings.STRING_FROM_NATIVE);
 ```

---
_Source: https://npm.io/package/react-native-localizable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
