diff --git a/backend/uploads/image-1727081193338 b/backend/uploads/image-1727081193338 new file mode 100644 index 00000000..c3f3198d Binary files /dev/null and b/backend/uploads/image-1727081193338 differ diff --git a/backend/uploads/image-1727084438990 b/backend/uploads/image-1727084438990 new file mode 100644 index 00000000..c3f3198d Binary files /dev/null and b/backend/uploads/image-1727084438990 differ diff --git a/client/src/locale/ca.json b/client/src/locale/ca.json index 5315d3bf..c8c85d3a 100644 --- a/client/src/locale/ca.json +++ b/client/src/locale/ca.json @@ -3,7 +3,26 @@ "create": "Create", "join": "Join", "view": "View", - "players": "Jugadores" + "players": "Jugadores", + "description": "Description", + "details": "Details", + "name": "Name", + "email": "Email", + "username": "Username", + "password": "Password", + "password-confirm": "Confirm your password", + "register": "Register" + }, + "placeholders": { + "name": "John Doe", + "email": "john@doe.com", + "username": "Enter your username...", + "password": "Enter your password...", + "password-confirm": "Enter again your password..." + }, + "register-admin": { + "title": "Register Admin Account", + "welcome-message": "

Welcome!

You have successfull setup Dragonroll!

Please create the admin account

Once the admin account has been created, you will be able to create user accounts that will be able to access Dragonroll


" }, "main-menu": { "title": "Dragonroll", @@ -17,6 +36,10 @@ }, "settings": { "title": "Dragonroll settings", + "tabs": { + "account-settings": "Account Settings", + "site-administration": "Site Administration" + }, "account": { "account-settings": "Account Settings", "language": "Language:" @@ -50,5 +73,13 @@ "systems": { "title": "Select a game system", "not-selected": "No game system selected" + }, + "database": { + "title": "Database", + "tabs": { + "items": "Items", + "spells": "Spells", + "features": "Features" + } } } \ No newline at end of file diff --git a/client/src/locale/en.json b/client/src/locale/en-US.json similarity index 58% rename from client/src/locale/en.json rename to client/src/locale/en-US.json index 1bb1ce67..04a6848e 100644 --- a/client/src/locale/en.json +++ b/client/src/locale/en-US.json @@ -3,7 +3,26 @@ "create": "Create", "join": "Join", "view": "View", - "players": "Jugadores" + "players": "Players", + "description": "Description", + "details": "Details", + "name": "Name", + "email": "Email", + "username": "Username", + "password": "Password", + "password-confirm": "Confirm your password", + "register": "Register" + }, + "placeholders": { + "name": "John Doe", + "email": "john@doe.com", + "username": "Enter your username...", + "password": "Enter your password...", + "password-confirm": "Enter again your password..." + }, + "register-admin": { + "title": "Register Admin Account", + "welcome-message": "

Welcome!

You have successfull setup Dragonroll!

Please create the admin account

Once the admin account has been created, you will be able to create user accounts that will be able to access Dragonroll


" }, "main-menu": { "title": "Dragonroll", @@ -17,6 +36,10 @@ }, "settings": { "title": "Dragonroll settings", + "tabs": { + "account-settings": "Account Settings", + "site-administration": "Site Administration" + }, "account": { "account-settings": "Account Settings", "language": "Language:" @@ -52,6 +75,14 @@ "systems": { "title": "Select a game system", "not-selected": "No game system selected" + }, + "database": { + "title": "Database", + "tabs": { + "items": "Items", + "spells": "Spells", + "features": "Features" + } } } \ No newline at end of file diff --git a/client/src/locale/es.json b/client/src/locale/es-ES.json similarity index 58% rename from client/src/locale/es.json rename to client/src/locale/es-ES.json index ebc9c99c..7d8db334 100644 --- a/client/src/locale/es.json +++ b/client/src/locale/es-ES.json @@ -3,7 +3,26 @@ "create": "Crear", "join": "Entrar", "view": "Abrir", - "players": "Jugadores" + "players": "Jugadores", + "description": "Descripción", + "details": "Detalles", + "name": "Nombre", + "email": "Correo", + "username": "Nombre de usuario", + "password": "Contraseña", + "password-confirm": "Confirma tu contraseña", + "register": "Registrar-se" + }, + "placeholders": { + "name": "John Doe", + "email": "john@doe.com", + "username": "Introduce tu nombre de usuario...", + "password": "Introduce tu contraseña...", + "password-confirm": "Vuelve a introducir tu contraseña..." + }, + "register-admin": { + "title": "Registrar cuenta de administrador", + "welcome-message": "

Bienvenido!

Has configurado correctamente Dragonroll!

Porfavor, crea la cuenta de administrador

Una vez creada, esta cuenta te permitirá configurar el servidor y crear cuentas que puedan acceder a este


" }, "main-menu": { "title": "Dragonroll", @@ -17,6 +36,10 @@ }, "settings": { "title": "Ajustes de Dragonroll", + "tabs": { + "account-settings": "Ajustes de cuenta", + "site-administration": "Administración" + }, "account": { "account-settings": "Ajustes de la cuenta", "language": "Idioma:" @@ -50,5 +73,13 @@ "systems": { "title": "Selecciona un sistema de juego", "not-selected": "Ningún sistema de juego seleccionado" + }, + "database": { + "title": "Base de datos", + "tabs": { + "items": "Items", + "spells": "Hechizos", + "features": "Características" + } } } \ No newline at end of file diff --git a/client/src/main.js b/client/src/main.js index 11295efc..63473503 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -6,12 +6,8 @@ import { createI18n } from 'vue-i18n' import App from './App.vue' import router from './router' -import EN from './locale/en.json' -import ES from './locale/es.json' -import CA from './locale/ca.json' - import mitt from 'mitt'; -import { GetUser, GetUserSetting } from './services/User' +import { GetUser, GetUserSetting, LogoutUser } from './services/User' const emitter = mitt(); const app = createApp(App); @@ -29,18 +25,29 @@ console.clear(); console.log("%cLoaded!!!", "color: #22ff22; font-size: 24px"); // Determinem el locale -let locale = 'en'; -if(GetUser()) locale = await GetUserSetting('lang'); +let locale = 'en-US'; + +let supportedLocales = ['en-US', 'es-ES', 'ca']; +let navLocale = window.navigator.language; +console.log(navLocale); + +if(supportedLocales.includes(navLocale)) locale = navLocale; + +try { + if(GetUser()) locale = await GetUserSetting('lang'); +} catch(ex) { + LogoutUser(); +} console.log(locale); const i18n = createI18n({ legacy: false, locale, - fallbackLocale: 'en', + fallbackLocale: 'en-US', messages: { - en: EN, - es: ES, - ca: CA + 'en-US': (await import(`./locale/en-US.json`)).default, + 'es-ES': (await import(`./locale/es-ES.json`)).default, + 'ca': (await import(`./locale/ca.json`)).default, } }); diff --git a/client/src/services/User.js b/client/src/services/User.js index 9d734a70..85f2da91 100644 --- a/client/src/services/User.js +++ b/client/src/services/User.js @@ -41,7 +41,7 @@ function GetUserSetting(key){ if(response.data.settings) resolve(response.data.settings[key]); else resolve(undefined); - }); + }).catch((ex) => reject(ex)); }); } diff --git a/client/src/services/Windows.js b/client/src/services/Windows.js index 610d3383..5c9390dc 100644 --- a/client/src/services/Windows.js +++ b/client/src/services/Windows.js @@ -16,7 +16,7 @@ const defValues = { }, 'register': { id: 'register', - title: 'Register admin account', + title: 'register-admin.title', }, 'main_menu': { id: 'main_menu', @@ -138,7 +138,7 @@ const defValues = { }, 'database': { id: 'database', - title: "Database", + title: "database.title", close: () => ClearWindow('database') } } diff --git a/client/src/views/partials/Tabs.vue b/client/src/views/partials/Tabs.vue index a21b77c8..3b8601af 100644 --- a/client/src/views/partials/Tabs.vue +++ b/client/src/views/partials/Tabs.vue @@ -1,11 +1,10 @@