You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+8-10
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ You can use `_version` key to specify the version of the locale file, and the de
74
74
75
75
### Split Localized Texts into Difference Files
76
76
77
-
> _version: 1
77
+
> \_version: 1
78
78
79
79
You can also split the each language into difference files, and you can choise (YAML, JSON, TOML), for example: `en.json`:
80
80
@@ -91,8 +91,8 @@ You can also split the each language into difference files, and you can choise (
91
91
92
92
```yml
93
93
_version: 1
94
-
hello: "Hello world"
95
-
messages.hello: "Hello, %{name}"
94
+
hello: 'Hello world'
95
+
messages.hello: 'Hello, %{name}'
96
96
```
97
97
98
98
Or use JSON or TOML format, just rename the file to `en.json` or `en.toml`, and the content is like this:
@@ -114,7 +114,7 @@ hello = "Hello, %{name}"
114
114
115
115
### All Localized Texts in One File
116
116
117
-
> _version: 2
117
+
> \_version: 2
118
118
119
119
Make sure all localized files (containing the localized mappings) are located in the `locales/` folder of the project root directory:
120
120
@@ -137,7 +137,6 @@ Make sure all localized files (containing the localized mappings) are located in
137
137
138
138
In the localized files, specify the localization keys and their corresponding values, for example, in `app.yml`:
139
139
140
-
141
140
```yml
142
141
_version: 2
143
142
hello:
@@ -273,19 +272,18 @@ I18n Ally is a VS Code extension for helping you translate your Rust project.
273
272
274
273
You can add [i18n-ally-custom-framework.yml](https://github.com/longbridgeapp/rust-i18n/blob/main/.vscode/i18n-ally-custom-framework.yml) to your project `.vscode` directory, and then use I18n Ally can parse `t!` marco to show translate text in VS Code editor.
275
274
276
-
277
275
## Extractor
278
276
279
-
> __Experimental__
277
+
> **Experimental**
280
278
281
279
We provided a `cargo i18n` command line tool for help you extract the untranslated texts from the source code and then write into YAML file.
282
280
283
281
> In current only output YAML, and use `_version: 2` format.
284
282
285
-
You can install it via `cargo install rust-i18n`, then you get `cargo i18n` command.
283
+
You can install it via `cargo install rust-i18n-cli`, then you get `cargo i18n` command.
286
284
287
285
```bash
288
-
$ cargo install rust-i18n
286
+
$ cargo install rust-i18n-cli
289
287
```
290
288
291
289
### Extractor Config
@@ -309,7 +307,7 @@ $ cargo install rust-i18n
309
307
Rust I18n providered a `i18n` bin for help you extract the untranslated texts from the source code and then write into YAML file.
0 commit comments