Add localization support for various components, including dialogs and views, in English, Spanish, and French. Implemented translations for user profile management, payment processes, and creator functionalities. Updated existing components to utilize the new translation system.

This commit is contained in:
2025-04-18 04:21:52 -04:00
parent a559611e04
commit d6c3bd7fa4
137 changed files with 1230 additions and 614 deletions

View File

@@ -0,0 +1,26 @@
import { defineStore } from 'pinia'
import { useSessionStorage } from '@vueuse/core'
import { useI18n } from 'vue-i18n'
export const useLanguageStore = defineStore(
'language',
() => {
const { locale } = useI18n()
// Initialize with the stored value or default to 'fr'
const storedLocale = useSessionStorage('user-locale', 'fr')
// Set the initial locale from storage
locale.value = storedLocale.value
function setLocale(newLocale) {
locale.value = newLocale
storedLocale.value = newLocale
}
return {
locale: storedLocale,
setLocale
}
}
)

View File

@@ -65,6 +65,7 @@ export const useUserProfileStore = defineStore(
async function changeFullname(firstname, lastname) {
try {
const client = useClient()
await client.post(
`/api/users/fullname`,
{
@@ -80,6 +81,7 @@ export const useUserProfileStore = defineStore(
async function changeAlias(alias) {
try {
const client = useClient()
await client.post(
`/api/users/alias`,
{
@@ -93,6 +95,7 @@ export const useUserProfileStore = defineStore(
async function changeBirthday(birthdate) {
try {
const client = useClient()
await client.post(
`/api/users/birthdate`,
{
@@ -106,6 +109,7 @@ export const useUserProfileStore = defineStore(
async function changePhone(phoneNumber) {
try {
const client = useClient()
await client.post(
`/api/users/phone`,
{
@@ -119,6 +123,7 @@ export const useUserProfileStore = defineStore(
async function changeEmail(email) {
try {
const client = useClient()
await client.post(
`/api/users/email`,
{
@@ -132,6 +137,7 @@ export const useUserProfileStore = defineStore(
async function changeAddress(address) {
try {
const client = useClient()
await client.post(
`/api/users/address`,
{
@@ -145,6 +151,7 @@ export const useUserProfileStore = defineStore(
async function changePortrait(selectedFile) {
try {
const client = useClient()
const formData = new FormData();
formData.append('file', selectedFile)