Skip to content

Commit 53329a8

Browse files
committed
feat: add i18n code snippets
1 parent 86d6185 commit 53329a8

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.vscode/i18n.code-snippets

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"i18n translate": {
3+
"scope": "vue-html",
4+
"prefix": ["t()", "$t()", "$i18n.$t()"],
5+
"body": ["$$t('${1}')"],
6+
"description": "Function of i18n to enable localization on a string"
7+
},
8+
"i18n translate full API": {
9+
"scope": "vue-html",
10+
"prefix": ["$i18n.$t()"],
11+
"body": ["$$t('${1}')"],
12+
"description": "Function of i18n to enable localization on a string"
13+
},
14+
"i18n translate composition": {
15+
"prefix": "i18n.t()",
16+
"body": ["i18n.t('${1}')"],
17+
"description": "Function of i18n to enable localization on a string in composition API"
18+
},
19+
"i18n template": {
20+
"scope": "vue",
21+
"prefix": "i18n template",
22+
"body": ["<i18n lang=\"yaml\">\r", "vi:\r", " ${1}\r", "</i18n>\r", ""],
23+
"description": "Template syntax for i18n in component"
24+
}
25+
}

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,26 @@ $ yarn generate
2222

2323
For detailed explanation on how things work, check out the [documentation](https://nuxtjs.org).
2424

25-
## Special Directories
25+
## Snippets
26+
27+
Checkout .vscode for code snippets
28+
29+
The project is setup with some simple i18n snippets:
30+
31+
```javascript
32+
$t('');
33+
$i18n.$t('');
34+
i18n.t('');
35+
```
36+
37+
```yaml
38+
<i18n lang="yaml">
39+
fr:
40+
Your code: Votre code
41+
</i18n>
42+
```
43+
44+
## Directories
2645

2746
You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.
2847

0 commit comments

Comments
 (0)