File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,13 @@ Appwrite API endpoint (Console -> Project -> Setting -> API Endpoint)
5050
5151Appwrite project ID (Console -> Project -> Setting -> Project ID)
5252
53+ ### Locale - ` locale ` - optional
54+
55+ - type: ` String `
56+ - default: ` en `
57+
58+ Appwrite locale
59+
5360### Full Example
5461
5562``` js
@@ -60,6 +67,7 @@ export default {
6067 appwrite: {
6168 endpoint: ' https://cloud.appwrite.io/v1' ,
6269 project: ' nuxt-playground' ,
70+ locale: ' en'
6371 }
6472}
6573```
108116[ codecov-href ] : https://codecov.io/gh/Hrdtr/nuxt-appwrite
109117
110118[ license-src ] : https://img.shields.io/npm/l/nuxt-appwrite.svg
111- [ license-href ] : https://npmjs.com/package/nuxt-appwrite
119+ [ license-href ] : https://npmjs.com/package/nuxt-appwrite
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ export default defineNuxtModule<ModuleOptions>({
4545 nuxt . hook ( 'listen' , ( ) => {
4646 console . info ( `Appwrite Endpoint: ${ options . endpoint } ` )
4747 console . info ( `Appwrite Project: ${ options . project } ` )
48+ if ( options . locale ) {
49+ console . info ( `Appwrite Locale: ${ options . locale } ` )
50+ }
4851 } )
4952 } ,
5053} )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { defineNuxtPlugin } from '#app'
2020export type AppwriteConfig = {
2121 endpoint : string
2222 project : string
23+ locale ?: string
2324}
2425
2526export type Appwrite = {
@@ -48,10 +49,14 @@ export default defineNuxtPlugin((nuxtApp) => {
4849 const config : AppwriteConfig = {
4950 endpoint : moduleOptions . endpoint || 'https://cloud.appwrite.io/v1' ,
5051 project : moduleOptions . project ,
52+ locale : moduleOptions . locale ,
5153 }
5254 const client = new Client ( )
5355 client . setEndpoint ( config . endpoint )
5456 client . setProject ( config . project )
57+ if ( config . locale ) {
58+ client . setLocale ( config . locale )
59+ }
5560
5661 return {
5762 provide : {
You can’t perform that action at this time.
0 commit comments