File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 1
- # Laravel Vue i18n
1
+ <h1 align =" center " style =" border :none !important " >
2
+ Laravel Vue i18n
3
+ </h1 >
2
4
3
- ** laravel-vue-i18n** allows to connect your ` Laravel ` Framework translation files with ` Vue ` .
5
+ <p align =" center " >
6
+ <a href="https://github.com/xiCO2k/laravel-vue-i18n/actions"><img alt="GitHub Workflow Status (master)" src="https://img.shields.io/github/workflow/status/xiCO2k/laravel-vue-i18n/Tests/master"></a>
7
+ <a href="https://www.npmjs.com/package/laravel-vue-i18n"><img alt="License" src="https://img.shields.io/npm/l/laravel-vue-i18n.svg?sanitize=true"></a>
8
+ </p >
9
+
10
+ <p align =" center " >
11
+ <b>laravel-vue-i18n</b> is a <b>Vue3</b> plugin that allows to connect your <b>Laravel</b> Framework <b>JSON</b> translation
12
+ files with <b>Vue</b>. It uses the same logic used on <a href="https://laravel.com/docs/8.x/localization">Laravel Localization</a>.
13
+ </p >
14
+
15
+ ## Installation
16
+ With [ npm] ( https://www.npmjs.com ) :
17
+ ``` sh
18
+ $ npm i laravel-vue-i18n
19
+ ```
20
+
21
+ or with [ yarn] ( https://yarnpkg.com ) :
22
+ ``` sh
23
+ $ yarn add laravel-vue-i18n
24
+ ```
4
25
5
26
## Usage
6
27
@@ -23,6 +44,9 @@ createApp()
23
44
24
45
### Plugin Options
25
46
47
+ - ` lang ` * (optional)* : if not provided it will try to find from the ` <html lang="pt"> ` tag, if is not available it will default to ` en ` .
48
+ - ` resolve ` : The way to reach your language files.
49
+
26
50
``` js
27
51
createApp ().use (i18nVue, {
28
52
lang: ' pt' ,
@@ -32,6 +56,8 @@ createApp().use(i18nVue, {
32
56
33
57
### trans()
34
58
59
+ The ` trans() ` method can be used on
60
+
35
61
``` js
36
62
// lang/pt.json
37
63
{
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ export function trans(key: string, replacements?: ReplacementsInterface): string
89
89
return message
90
90
}
91
91
92
+ /**
93
+ * The Vue Plugin. to be used on your Vue app like this: `app.use(i18nVue)`
94
+ */
92
95
export const i18nVue : Plugin = {
93
96
install : ( app , currentOptions : OptionsInterface = { } ) => {
94
97
options = { ...options , ...currentOptions }
You can’t perform that action at this time.
0 commit comments