wobsoriano / vue-clerk

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

i18n implementation? #38

Closed aviorp closed 1 month ago

wobsoriano commented 1 month ago

https://github.com/wobsoriano/vue-clerk/issues/25#issuecomment-1950410106

aviorp commented 1 month ago
import { clerkPlugin } from 'vue-clerk/plugin';
import { heIL } from '@clerk/localizations';
export default defineNuxtPlugin(({ vueApp }) => {
  vueApp.use(clerkPlugin, {
    publishableKey: useRuntimeConfig().public.clerkPublishableKey,
    localization: heIL,
  });
});

idk what im missing but im sure its not working that way, any thoughts ?

wobsoriano commented 1 month ago

What's not working @aviorp? Can you update to latest version and try again?

I just tried it in the playground and it works as expected:

Screenshot 2024-05-28 at 9 11 08 AM

aviorp commented 2 weeks ago

well it works ! forgot to refresh my lock file. thanks man !

aviorp commented 2 weeks ago

btw how can i toggle the mode by user choice ?

wobsoriano commented 2 weeks ago

@aviorp It's not documented but here's how you would do it:

import { frFR } from '@clerk/localizations'

const clerk = useClerk()

clerk.__unstable__updateProps({ options: { ...currentOptions, locale: frFR } })

Outside a component setup you can do

window.Clerk.__unstable__updateProps({ options: { ...currentOptions, locale: frFR } })