wobsoriano / vue-clerk

Unofficial Vue + Clerk integration.
https://vue-clerk.com
MIT License
108 stars 8 forks source link

ClerkProvider for localization #25

Closed hloehrmann closed 4 months ago

hloehrmann commented 4 months ago

Would it be possible to have the ClerkProvider component so the experimental localization prop can be used?

Or is there any other way to set it?

See here for reference: https://clerk.com/docs/components/customization/localization

Thanks and all the best!

wobsoriano commented 4 months ago

Hey!

You can pass it in the plugin options:

import { clerkPlugin } from 'vue-clerk/plugin'
import { frFR } from '@clerk/localizations'

const app = createApp(App)

app.use(clerkPlugin, {
  publishableKey: import.meta.env.VITE_CLERK_PUBLISHABLE_KEY,
  appearance: {},
  localization: frFR
})

I haven't tested this but let me know if it works for you!

hloehrmann commented 4 months ago

Yes, it works! Thanks for the quick response - I think this might actually be worth noting in the documentation...

Correct syntax is this one by the way:

app = createApp(App)
    .use(clerkPlugin, {
      publishableKey: import.meta.env.VUE_APP_CLERK_PUBLISHABLE_KEY,
      options: <ClerkOptions>{
        localization: deDE,
      },
    })

With options beeing the ClerkOptionsinterface.

wobsoriano commented 4 months ago

Heads up - Im opening a breaking change PR moving the options object to the root of the plugin options

https://github.com/wobsoriano/vue-clerk/pull/26