Skip to content

Commit 605086a

Browse files
committed
📝 docs: update docs
1 parent f61d016 commit 605086a

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ yarn global vue-i18n-locale-message
3939
## :star: Features
4040

4141
- API
42-
- squeeze the locale messages from `i18n` custom block
43-
- infuse the locale messages to `i18n` custom block
42+
- squeeze the meta of locale messages from `i18n` custom block
43+
- infuse the meta of locale messages to `i18n` custom block
4444
- CLI
4545
- squeeze the locale messages from `i18n` custom block
4646
- infuse the locale messages to `i18n` custom block
@@ -109,7 +109,35 @@ The big motivation is as follows.
109109
- :tired_face: Hard to maintain consistency of locale message keys (`eslint-plugin-vue-i18n` need it!)
110110
- :pray: Requested by third bender tools (`vue-i18n-ally` and etc ...)
111111

112-
## :notebook: Locale message squeezing rules
112+
## :book: API: Specifications
113+
114+
<p align="center"><img width="238px" height="272px" src="./assets/vue-i18n-logo.png" alt="Vue I18n logo"></p>
115+
116+
117+
### sqeeze (basePath: string, files: SFCFileInfo[]): MetaLocaleMessage
118+
119+
* **Arguments:**
120+
* `{string} basePath`: The base path that single-file components are located in project
121+
* `{SFCFileInfo[]} files`: The target single-file components information
122+
* **Return:** `MetaLocaleMessage`
123+
124+
Squeeze the meta of locale messages from i18n custom block at single-file components.
125+
126+
In about structure of the meta information that is returned with this function, You can see the [here](https://github.com/kazupon/vue-i18n-locale-message/blob/master/types/index.d.ts#L34-L81).
127+
128+
### infuse (basePath: string, sources: SFCFileInfo[], meta: MetaLocaleMessage): SFCFileInfo[]
129+
130+
* **Arguments:**
131+
* `{string} basePath`: The base path that single-file components are located in project
132+
* `{SFCFileInfo[]} sources`: The target single-file components information
133+
* `{MetaLocaleMessage}`: The meta of locale message
134+
* **Return:** `SFCFileInfo[]`
135+
136+
Infuse the meta of locale messages to i18n custom block at single-file components.
137+
138+
`infuse` function will return new single-file components information that is updated with the single-file components information specified as `sources` and the meta of locale message as `meta`.
139+
140+
## :notebook: CLI: Locale message squeezing rules
113141

114142
The structure of locale messages to be squeezed is layered with the **directory structure** and **single-file component (`.vue`) filename**.
115143

assets/api-usage-image.png

112 KB
Loading

0 commit comments

Comments
 (0)