devbaji / vue3-google-login

Add Sign In With Google feature to your Vue 3 application
https://github.com/devbaji/vue3-google-login/
MIT License
202 stars 30 forks source link

How to change google button's language #21

Closed Rachael0108 closed 1 year ago

Rachael0108 commented 1 year ago

i want to change the google button's language to english ( local: en-US) this is my code: <GoogleLogin :callback="callback"/> import { decodeCredential } from 'vue3-google-login' const callback = (response:any) => { let userData = decodeCredential(response.credential) userData = { account: userData.sub, type: 'Google', password: '' } emit('googleLogin', userData) }

any ideas ,thank u for your apply

devbaji commented 1 year ago

Have you used the buttonConfig option mention here Try this

<GoogleLogin :callback="callback"  :button-config="{
    locale: 'en-US'
  }"/>

<script setup lang="ts">
import { decodeCredential } from 'vue3-google-login' 

const callback = (response: any) => {
    let userData = decodeCredential(response.credential) userData = {
        account: userData.sub,
        type: 'Google',
        password: ''
    }
    emit('googleLogin', userData)
}
</script>