Create README.md
This commit is contained in:
parent
65f0fcfc4f
commit
50e7a4931e
|
@ -177,20 +177,18 @@ I18n.translations = {
|
||||||
|
|
||||||
For a device with a `en_GB` locale this will return `Hi from the UK!'`, for a device with a `en_US` locale it will return `Hi!`.
|
For a device with a `en_GB` locale this will return `Hi from the UK!'`, for a device with a `en_US` locale it will return `Hi!`.
|
||||||
|
|
||||||
### Device's locale
|
### Device's locales
|
||||||
|
|
||||||
You can get the user preferred locales with the `RNI18n` native module:
|
You can get the user preferred locales with the `getLanguages` method:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { getLanguages } from 'react-native-i18n'
|
import { getLanguages } from 'react-native-i18n'
|
||||||
|
|
||||||
getLanguages().then(languages => {
|
getLanguages().then(languages => {
|
||||||
console.log(languages)
|
console.log(languages) // ['en-US', 'en']
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
Returns `['en-US', 'en']`.
|
|
||||||
|
|
||||||
|
|
||||||
### I18n.js documentation
|
### I18n.js documentation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue