Skip to content

Commit ca1cf54

Browse files
committed
Update README
1 parent d94bbb1 commit ca1cf54

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

README.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
This is a plugin for NativeScript that implements internationalization (i18n) using the native platforms standards.
77
It is inspired from [nativescript-i18n](https://github.com/rborn/nativescript-i18n)
88

9+
## Table of contents
10+
* [Installation](#installation)
11+
* [Usage](#usage)
12+
* [Angular](#angular)
13+
* [Javascript](#javascript)
14+
* [File format](#file-format)
15+
* [Frequently asked questions](#frequently-asked-questions)
16+
* [How to set the default language?](#how-to-set-the-default-language)
17+
* [How to localize the application name?](#how-to-localize-the-application-name)
18+
* [How to localize iOS properties?](#how-to-localize-ios-properties)
19+
920
## Installation
1021
```shell
1122
tns plugin add nativescript-localize
@@ -76,28 +87,6 @@ const localize = require("nativescript-localize");
7687
console.log(localize("Hello world !"));
7788
```
7889

79-
## Default language
80-
Add the `.default` extension to the default language file to set it as the fallback language:
81-
```
82-
fr.default.json
83-
```
84-
85-
## Localize the application name
86-
The `app.name` key is used to localize the application name:
87-
```json
88-
{
89-
"app.name": "My app"
90-
}
91-
```
92-
93-
## Localize iOS properties
94-
Keys starting with `ios.info.plist.` are used to localize iOS properties:
95-
```json
96-
{
97-
"ios.info.plist.NSLocationWhenInUseUsageDescription": "This will be added to InfoPlist.strings"
98-
}
99-
```
100-
10190
## File format
10291
Each file is imported using `require`, use the file format of your choice:
10392

@@ -128,3 +117,26 @@ const i18n = {
128117

129118
module.exports = i18n;
130119
```
120+
121+
## Frequently asked questions
122+
### How to set the default language?
123+
Add the `.default` extension to the default language file to set it as the fallback language:
124+
```
125+
fr.default.json
126+
```
127+
128+
### How to localize the application name?
129+
The `app.name` key is used to localize the application name:
130+
```json
131+
{
132+
"app.name": "My app"
133+
}
134+
```
135+
136+
### How to localize iOS properties?
137+
Keys starting with `ios.info.plist.` are used to localize iOS properties:
138+
```json
139+
{
140+
"ios.info.plist.NSLocationWhenInUseUsageDescription": "This will be added to InfoPlist.strings"
141+
}
142+
```

0 commit comments

Comments
 (0)