From 771f4dd1da315d0d3e90f6c4e4fb930626117d76 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Tue, 5 May 2026 15:53:01 +0100 Subject: [PATCH] att --- src/App.jsx | 43 ++++++++----- src/lib/i18n.js | 160 ++++++++++++++++++++++++++++++------------------ 2 files changed, 128 insertions(+), 75 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 5e6abc5..7e073fe 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -928,7 +928,7 @@ export default function App() { { id: 'wishlist', label: t('wishlist') || 'Carrinho', icon: ShoppingBag }, { id: 'laundry', label: t('laundry'), icon: Droplets }, { id: 'outfits', label: t('outfits'), icon: Sparkles }, - { id: 'planner', label: 'Planeamento', icon: Calendar }, + { id: 'planner', label: t('planning'), icon: Calendar }, { id: 'settings', label: t('settings'), icon: Settings }, ].map(item => ( - + @@ -1436,7 +1436,7 @@ export default function App() {
-

A ser lavados — {t('unavailable')} ({laundryLooks.length})

+

{t('toBeWashed')} — {t('unavailable')} ({laundryLooks.length})

{laundryLooks.map(renderLookCard)} @@ -1483,8 +1483,17 @@ export default function App() { return Array.from({ length: 7 }, (_, i) => { const x = new Date(mon); x.setDate(mon.getDate() + i); return x; }); }; - const monthNames = ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro']; - const dayHeaders = ['Seg','Ter','Qua','Qui','Sex','Sáb','Dom']; + const langLocaleMap = { PT: 'pt-PT', EN: 'en-GB', ES: 'es-ES', FR: 'fr-FR', DE: 'de-DE' }; + const locale = langLocaleMap[language] || 'pt-PT'; + const monthNames = Array.from({ length: 12 }, (_, i) => { + const d = new Date(2000, i, 1); + const name = d.toLocaleDateString(locale, { month: 'long' }); + return name.charAt(0).toUpperCase() + name.slice(1); + }); + const dayHeaders = Array.from({ length: 7 }, (_, i) => { + const d = new Date(2024, 0, i + 1); // 2024-01-01 is Monday + return d.toLocaleDateString(locale, { weekday: 'short' }).replace('.', ''); + }); const prev = () => { const d = new Date(plannerCurrentDate); plannerMode === 'month' ? d.setMonth(month-1) : d.setDate(d.getDate()-7); setPlannerCurrentDate(d); }; const next = () => { const d = new Date(plannerCurrentDate); plannerMode === 'month' ? d.setMonth(month+1) : d.setDate(d.getDate()+7); setPlannerCurrentDate(d); }; @@ -1505,7 +1514,7 @@ export default function App() { >
{date.getDate()} - {isToday && Hoje} + {isToday && {t('today')}}
{look ? (
@@ -1516,7 +1525,7 @@ export default function App() { })}

{look.name}

- {isWeek &&

{look.items.length} peças

} + {isWeek &&

{look.items.length} {t('piecesShort')}

}
) : ( cur &&
@@ -1544,13 +1553,13 @@ export default function App() {
{['month','week'].map(m => ( ))}
@@ -1940,10 +1949,10 @@ export default function App() {

- Escolher Outfit + {t('chooseOutfit')}

- {new Date(plannerPickerDate + 'T12:00:00').toLocaleDateString('pt-PT', { weekday: 'long', day: 'numeric', month: 'long' })} + {(() => { const locMap = { PT: 'pt-PT', EN: 'en-GB', ES: 'es-ES', FR: 'fr-FR', DE: 'de-DE' }; return new Date(plannerPickerDate + 'T12:00:00').toLocaleDateString(locMap[language] || 'pt-PT', { weekday: 'long', day: 'numeric', month: 'long' }); })()}

@@ -1954,13 +1963,13 @@ export default function App() { onClick={async () => { await assignOutfitToDay(plannerPickerDate, null); setShowPlannerPicker(false); }} className="mb-4 w-full py-3 border-2 border-dashed border-red-200 dark:border-red-900/50 text-red-400 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:border-red-400 hover:text-red-500 transition-all flex items-center justify-center gap-2" > - Remover Outfit deste Dia + {t('removeOutfitDay')} )}
{looks.length === 0 ? ( -
Nenhum outfit criado
+
{t('noOutfitCreated')}
) : looks.map(look => { const isSelected = outfitPlans.find(p => p.date === plannerPickerDate)?.lookId === look.id; return ( @@ -1981,7 +1990,7 @@ export default function App() {

{look.name}

-

{look.items.length} peças

+

{look.items.length} {t('piecesShort')}

{isSelected && } diff --git a/src/lib/i18n.js b/src/lib/i18n.js index f9bcd5e..5cdf422 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -20,7 +20,7 @@ export const translations = { outfitsAndStyle: "Outfits", readyClothes: "Roupas Prontas", inLaundry: "Na Lavandaria", - myLooks: "Meus Looks", + myLooks: "Meus Outfits", favorites: "Favoritos", todayIn: "Hoje em Portugal", weatherUpdate: "22°C - Ensolarado", @@ -65,7 +65,7 @@ export const translations = { darkMode: "Modo Escuro", interfaceAppearance: "Aparência da interface", notifications: "Notificações", - lookReminders: "Lembretes de looks", + lookReminders: "Lembretes de outfits", weatherAlerts: "Alertas de Clima", weatherSuggestions: "Sugestões pelo tempo", systemAndData: "Sistema e Dados", @@ -85,7 +85,7 @@ export const translations = { fullCleanActions: "Ações de limpeza total do armário.", clearAll: "Limpar Tudo", confirmDeletePerm: "Apagar permanentemente?", - confirmDeleteLook: "Apagar este Look?", + confirmDeleteLook: "Apagar este Outfit?", confirmEmptyTrash: "Esvaziar o lixo permanentemente?", confirmClearAll: "Mover todas as peças ativas para o lixo?", colorBlack: "Preto", @@ -140,7 +140,7 @@ export const translations = { toBeWashed: "A ser lavados", unavailable: "Indisponíveis", availableLooks: "Disponíveis", - noLooksAvailable: "Nenhum look disponível", + noLooksAvailable: "Nenhum outfit disponível", location: "Localidade", locationEx: "Ex: Lisboa, Portugal", ideaSuggestion: "Ideia / Sugestão", @@ -150,10 +150,10 @@ export const translations = { notificationsModal: "Notificações", noNotifications: "Sem Notificações", markAllRead: "Marcar todas como lidas", - lookCopiedBy: "copiou o seu look", - userSavedLook: "guardou o seu look", + lookCopiedBy: "copiou o seu outfit", + userSavedLook: "guardou o seu outfit", inTheirCloset: "no armário dele!", - sharedLookTitle: "Look Partilhado", + sharedLookTitle: "Outfit Partilhado", sharedBy: "Partilhado por", includedPieces: "Peças incluídas", ignore: "Ignorar", @@ -171,8 +171,16 @@ export const translations = { personalizeColorDesc: "Personalize a cor", saveChanges: "Guardar Alterações", pasteLink: "Colar Link", - pasteSharedLookLink: "Cole o link do look partilhado:", + pasteSharedLookLink: "Cole o link do outfit partilhado:", invalidSharedLink: "Link inválido. Certifique-se de copiar o link completo.", + planning: "Planeamento", + today: "Hoje", + monthLabel: "Mês", + weekLabel: "Semana", + chooseOutfit: "Escolher Outfit", + removeOutfitDay: "Remover Outfit deste Dia", + noOutfitCreated: "Nenhum outfit criado", + piecesShort: "peças", }, EN: { loginModeIntro: "The Future of Your Style", @@ -195,7 +203,7 @@ export const translations = { outfitsAndStyle: "Outfits & Style", readyClothes: "Ready Clothes", inLaundry: "In Laundry", - myLooks: "My Looks", + myLooks: "My Outfits", favorites: "Favorites", todayIn: "Today in Portugal", weatherUpdate: "22°C - Sunny", @@ -217,13 +225,13 @@ export const translations = { laundryMsg: "Here you find the pieces you marked as dirty. Wash them to return them to the main closet.", washing: "Washing", emptyBasket: "Empty Basket", - createNewLook: "Create New Look", - lookName: "Look Name", + createNewLook: "Create New Outfit", + lookName: "Outfit Name", selectedPieces: "Selected Pieces", selectPieces: "Select pieces...", - saveLook: "Save Look", + saveLook: "Save Outfit", closetLabel: "Closet", - lookHistory: "Look History", + lookHistory: "Outfit History", pieces: "Pieces", newItem: "New Item", preview: "Preview", @@ -240,7 +248,7 @@ export const translations = { darkMode: "Dark Mode", interfaceAppearance: "Interface Appearance", notifications: "Notifications", - lookReminders: "Look reminders", + lookReminders: "Outfit reminders", weatherAlerts: "Weather Alerts", weatherSuggestions: "Weather-based suggestions", systemAndData: "System and Data", @@ -260,7 +268,7 @@ export const translations = { fullCleanActions: "Full closet wipe actions.", clearAll: "Clear All", confirmDeletePerm: "Delete permanently?", - confirmDeleteLook: "Delete this Look?", + confirmDeleteLook: "Delete this Outfit?", confirmEmptyTrash: "Empty trash permanently?", confirmClearAll: "Move all active pieces to trash?", colorBlack: "Black", @@ -315,7 +323,7 @@ export const translations = { toBeWashed: "To be washed", unavailable: "Unavailable", availableLooks: "Available", - noLooksAvailable: "No look available", + noLooksAvailable: "No outfit available", location: "Location", locationEx: "E.g.: Lisbon, Portugal", ideaSuggestion: "Idea / Suggestion", @@ -325,10 +333,10 @@ export const translations = { notificationsModal: "Notifications", noNotifications: "No Notifications", markAllRead: "Mark all as read", - lookCopiedBy: "copied your look", - userSavedLook: "saved your look", + lookCopiedBy: "copied your outfit", + userSavedLook: "saved your outfit", inTheirCloset: "in their closet!", - sharedLookTitle: "Shared Look", + sharedLookTitle: "Shared Outfit", sharedBy: "Shared by", includedPieces: "Included Pieces", ignore: "Ignore", @@ -337,6 +345,7 @@ export const translations = { msgSentSuccess: "Message sent successfully!", msgSendError: "Error sending message. Check your connection.", addFuturePurchase: "Add piece as future purchase", + wishlist: "Wishlist", wishlistDesc: "Wishlist", someone: "someone", feedbackTitle: "Support and Feedback", @@ -345,8 +354,16 @@ export const translations = { personalizeColorDesc: "Personalize the color", saveChanges: "Save Changes", pasteLink: "Paste Link", - pasteSharedLookLink: "Paste the shared look link:", + pasteSharedLookLink: "Paste the shared outfit link:", invalidSharedLink: "Invalid link. Make sure you copied the full link.", + planning: "Planning", + today: "Today", + monthLabel: "Month", + weekLabel: "Week", + chooseOutfit: "Choose Outfit", + removeOutfitDay: "Remove Outfit from this Day", + noOutfitCreated: "No outfit created", + piecesShort: "pieces", }, ES: { loginModeIntro: "El Futuro de Tu Estilo", @@ -360,16 +377,16 @@ export const translations = { dashboard: "Panel", closet: "Armario", laundry: "Lavandería", - outfits: "Looks", + outfits: "Outfits", settings: "Ajustes", online: "En línea", logout: "Cerrar Sesión", overview: "Visión General", myCloset: "Mi Armario", - outfitsAndStyle: "Looks y Estilo", + outfitsAndStyle: "Outfits y Estilo", readyClothes: "Ropa Lista", inLaundry: "En la Lavandería", - myLooks: "Mis Looks", + myLooks: "Mis Outfits", favorites: "Favoritos", todayIn: "Hoy en Portugal", weatherUpdate: "22°C - Soleado", @@ -391,13 +408,13 @@ export const translations = { laundryMsg: "Aquí encuentras las piezas que marcaste como sucias. Lávalas para que vuelvan al armario principal.", washing: "Lavando", emptyBasket: "Cesto Vacío", - createNewLook: "Crear Nuevo Look", - lookName: "Nombre del Look", + createNewLook: "Crear Nuevo Outfit", + lookName: "Nombre del Outfit", selectedPieces: "Piezas Seleccionadas", selectPieces: "Elige piezas...", - saveLook: "Guardar Look", + saveLook: "Guardar Outfit", closetLabel: "Armario", - lookHistory: "Historial de Looks", + lookHistory: "Historial de Outfits", pieces: "Piezas", newItem: "Nuevo Artículo", preview: "Vista Previa", @@ -434,7 +451,7 @@ export const translations = { fullCleanActions: "Acciones de limpieza total.", clearAll: "Limpiar Todo", confirmDeletePerm: "¿Borrar permanentemente?", - confirmDeleteLook: "¿Borrar este Look?", + confirmDeleteLook: "¿Borrar este Outfit?", confirmEmptyTrash: "¿Vaciar la papelera permanentemente?", confirmClearAll: "¿Mover todas las piezas activas a la papelera?", colorBlack: "Negro", @@ -489,7 +506,7 @@ export const translations = { toBeWashed: "Por lavar", unavailable: "No disponibles", availableLooks: "Disponibles", - noLooksAvailable: "Ningún look disponible", + noLooksAvailable: "Ningún outfit disponible", location: "Ubicación", locationEx: "Ej: Lisboa, Portugal", ideaSuggestion: "Idea / Sugerencia", @@ -499,10 +516,10 @@ export const translations = { notificationsModal: "Notificaciones", noNotifications: "Sin Notificaciones", markAllRead: "Marcar todas como leídas", - lookCopiedBy: "copió tu look", - userSavedLook: "guardó tu look", + lookCopiedBy: "copió tu outfit", + userSavedLook: "guardó tu outfit", inTheirCloset: "en su armario!", - sharedLookTitle: "Look Compartido", + sharedLookTitle: "Outfit Compartido", sharedBy: "Compartido por", includedPieces: "Piezas incluidas", ignore: "Ignorar", @@ -511,6 +528,7 @@ export const translations = { msgSentSuccess: "¡Mensaje enviado con éxito!", msgSendError: "Error al enviar. Revisa tu conexión.", addFuturePurchase: "Añadir pieza como compra futura", + wishlist: "Lista de Deseos", wishlistDesc: "Lista de Deseos", someone: "alguien", feedbackTitle: "Soporte y Comentarios", @@ -519,8 +537,16 @@ export const translations = { personalizeColorDesc: "Personaliza el color", saveChanges: "Guardar Cambios", pasteLink: "Pegar Enlace", - pasteSharedLookLink: "Pega el enlace del look compartido:", + pasteSharedLookLink: "Pega el enlace del outfit compartido:", invalidSharedLink: "Enlace no válido. Asegúrate de copiar el enlace completo.", + planning: "Planificación", + today: "Hoy", + monthLabel: "Mes", + weekLabel: "Semana", + chooseOutfit: "Elegir Outfit", + removeOutfitDay: "Quitar Outfit de este Día", + noOutfitCreated: "Ningún outfit creado", + piecesShort: "piezas", }, FR: { loginModeIntro: "Le Futur de Ton Style", @@ -543,7 +569,7 @@ export const translations = { outfitsAndStyle: "Tenues & Style", readyClothes: "Vêtements Prêts", inLaundry: "À la Blanchisserie", - myLooks: "Mes Looks", + myLooks: "Mes Outfits", favorites: "Favoris", todayIn: "Aujourd'hui au Portugal", weatherUpdate: "22°C - Ensoleillé", @@ -565,13 +591,13 @@ export const translations = { laundryMsg: "Ici vous trouvez les pièces que vous avez marquées comme sales. Lavez-les pour les remettre dans le placard principal.", washing: "En lavage", emptyBasket: "Panier Vide", - createNewLook: "Créer un Nouveau Look", - lookName: "Nom du Look", + createNewLook: "Créer un Nouvel Outfit", + lookName: "Nom de l'Outfit", selectedPieces: "Pièces Sélectionnées", selectPieces: "Sélectionnez des pièces...", - saveLook: "Enregistrer le Look", + saveLook: "Enregistrer l'Outfit", closetLabel: "Placard", - lookHistory: "Historique des Looks", + lookHistory: "Historique des Outfits", pieces: "Pièces", newItem: "Nouvel Article", preview: "Aperçu", @@ -588,7 +614,7 @@ export const translations = { darkMode: "Mode Sombre", interfaceAppearance: "Apparence de l'interface", notifications: "Notifications", - lookReminders: "Rappels de looks", + lookReminders: "Rappels d'outfits", weatherAlerts: "Alertes Météo", weatherSuggestions: "Suggestions selon la météo", systemAndData: "Système et Données", @@ -608,7 +634,7 @@ export const translations = { fullCleanActions: "Actions de nettoyage total.", clearAll: "Tout Effacer", confirmDeletePerm: "Supprimer définitivement ?", - confirmDeleteLook: "Supprimer ce Look ?", + confirmDeleteLook: "Supprimer cet Outfit ?", confirmEmptyTrash: "Vider la corbeille définitivement ?", confirmClearAll: "Déplacer toutes les pièces actives vers la corbeille ?", colorBlack: "Noir", @@ -663,7 +689,7 @@ export const translations = { toBeWashed: "À laver", unavailable: "Indisponibles", availableLooks: "Disponibles", - noLooksAvailable: "Aucun look disponible", + noLooksAvailable: "Aucun outfit disponible", location: "Emplacement", locationEx: "Ex: Lisbonne, Portugal", ideaSuggestion: "Idée / Suggestion", @@ -673,10 +699,10 @@ export const translations = { notificationsModal: "Notifications", noNotifications: "Aucune Notification", markAllRead: "Tout marquer comme lu", - lookCopiedBy: "a copié votre look", - userSavedLook: "a sauvegardé votre look", + lookCopiedBy: "a copié votre outfit", + userSavedLook: "a sauvegardé votre outfit", inTheirCloset: "dans son placard !", - sharedLookTitle: "Look Partagé", + sharedLookTitle: "Outfit Partagé", sharedBy: "Partagé par", includedPieces: "Pièces incluses", ignore: "Ignorer", @@ -685,6 +711,7 @@ export const translations = { msgSentSuccess: "Message envoyé avec succès !", msgSendError: "Erreur d'envoi. Vérifiez votre connexion.", addFuturePurchase: "Ajouter comme achat futur", + wishlist: "Liste de Souhaits", wishlistDesc: "Liste de Souhaits", someone: "quelqu'un", feedbackTitle: "Support et Commentaires", @@ -693,8 +720,16 @@ export const translations = { personalizeColorDesc: "Personnaliser la couleur", saveChanges: "Enregistrer les Modifications", pasteLink: "Coller le Lien", - pasteSharedLookLink: "Collez le lien du look partagé :", + pasteSharedLookLink: "Collez le lien de l'outfit partagé :", invalidSharedLink: "Lien invalide. Assurez-vous d'avoir copié le lien complet.", + planning: "Planification", + today: "Aujourd'hui", + monthLabel: "Mois", + weekLabel: "Semaine", + chooseOutfit: "Choisir un Outfit", + removeOutfitDay: "Retirer l'Outfit de ce Jour", + noOutfitCreated: "Aucun outfit créé", + piecesShort: "pièces", }, DE: { loginModeIntro: "Die Zukunft deines Stils", @@ -705,7 +740,7 @@ export const translations = { createAccount: "Neues Konto erstellen", haveAccount: "Ich habe bereits ein Konto", authErrorDisabled: "E-Mail-Anmeldung ist deaktiviert.", - dashboard: "Dashboard", + dashboard: "Startseite", closet: "Schrank", laundry: "Wäsche", outfits: "Outfits", @@ -717,7 +752,7 @@ export const translations = { outfitsAndStyle: "Outfits & Stil", readyClothes: "Fertige Kleidung", inLaundry: "In der Wäsche", - myLooks: "Meine Looks", + myLooks: "Meine Outfits", favorites: "Favoriten", todayIn: "Heute in Portugal", weatherUpdate: "22°C - Sonnig", @@ -739,13 +774,13 @@ export const translations = { laundryMsg: "Hier findest du die Stücke, die du als schmutzig markiert hast. Wasche sie, um sie in den Hauptschrank zurückzulegen.", washing: "Waschen", emptyBasket: "Leerer Korb", - createNewLook: "Neuen Look erstellen", - lookName: "Look Name", + createNewLook: "Neues Outfit erstellen", + lookName: "Outfit Name", selectedPieces: "Ausgewählte Stücke", selectPieces: "Stücke auswählen...", - saveLook: "Look speichern", + saveLook: "Outfit speichern", closetLabel: "Schrank", - lookHistory: "Look-Verlauf", + lookHistory: "Outfit-Verlauf", pieces: "Stücke", newItem: "Neuer Artikel", preview: "Vorschau", @@ -762,7 +797,7 @@ export const translations = { darkMode: "Dunkelmodus", interfaceAppearance: "Erscheinungsbild der Schnittstelle", notifications: "Benachrichtigungen", - lookReminders: "Look-Erinnerungen", + lookReminders: "Outfit-Erinnerungen", weatherAlerts: "Wetterwarnungen", weatherSuggestions: "Wetterbasierte Vorschläge", systemAndData: "System und Daten", @@ -782,7 +817,7 @@ export const translations = { fullCleanActions: "Aktionen zur vollständigen Bereinigung.", clearAll: "Alles löschen", confirmDeletePerm: "Dauerhaft löschen?", - confirmDeleteLook: "Diesen Look löschen?", + confirmDeleteLook: "Dieses Outfit löschen?", confirmEmptyTrash: "Papierkorb dauerhaft leeren?", confirmClearAll: "Alle aktiven Stücke in den Papierkorb verschieben?", colorBlack: "Schwarz", @@ -837,7 +872,7 @@ export const translations = { toBeWashed: "Zum Waschen", unavailable: "Nicht verfügbar", availableLooks: "Verfügbar", - noLooksAvailable: "Kein Look verfügbar", + noLooksAvailable: "Kein Outfit verfügbar", location: "Ort", locationEx: "Z.B.: Lissabon, Portugal", ideaSuggestion: "Idee / Vorschlag", @@ -847,10 +882,10 @@ export const translations = { notificationsModal: "Benachrichtigungen", noNotifications: "Keine Benachrichtigungen", markAllRead: "Alle als gelesen markieren", - lookCopiedBy: "hat deinen Look kopiert", - userSavedLook: "hat deinen Look gespeichert", + lookCopiedBy: "hat dein Outfit kopiert", + userSavedLook: "hat dein Outfit gespeichert", inTheirCloset: "in seinem Schrank!", - sharedLookTitle: "Geteilter Look", + sharedLookTitle: "Geteiltes Outfit", sharedBy: "Geteilt von", includedPieces: "Enthaltene Stücke", ignore: "Ignorieren", @@ -859,6 +894,7 @@ export const translations = { msgSentSuccess: "Nachricht erfolgreich gesendet!", msgSendError: "Fehler beim Senden. Überprüfe deine Verbindung.", addFuturePurchase: "Als zukünftigen Kauf hinzufügen", + wishlist: "Wunschzettel", wishlistDesc: "Wunschzettel", someone: "jemand", feedbackTitle: "Support und Feedback", @@ -867,7 +903,15 @@ export const translations = { personalizeColorDesc: "Farbe anpassen", saveChanges: "Änderungen Speichern", pasteLink: "Link Einfügen", - pasteSharedLookLink: "Fügen Sie den Link zum geteilten Look ein:", + pasteSharedLookLink: "Fügen Sie den Link zum geteilten Outfit ein:", invalidSharedLink: "Ungültiger Link. Stellen Sie sicher, dass Sie den vollständigen Link kopiert haben.", + planning: "Planung", + today: "Heute", + monthLabel: "Monat", + weekLabel: "Woche", + chooseOutfit: "Outfit Wählen", + removeOutfitDay: "Outfit von diesem Tag entfernen", + noOutfitCreated: "Kein Outfit erstellt", + piecesShort: "Stücke", } };