diff --git a/fix_app.cjs b/fix_app.cjs new file mode 100644 index 0000000..833b41c --- /dev/null +++ b/fix_app.cjs @@ -0,0 +1,45 @@ +const fs = require('fs'); + +let content = fs.readFileSync('src/App.jsx', 'utf8'); +let lines = content.split('\n'); + +// 1312 is index 1311. +// 1327 is index 1326. +// We want to remove from index 1311 up to (but not including) index 1326. +// Count to remove = 1326 - 1311 = 15 lines. + +const newContent = ` +
+ +
+ {['Vermelho', 'Azul', 'Amarelo', 'Verde', 'Laranja', 'Roxo', 'Branco', 'Preto', 'Cinzento', 'Bege'].map(c => { + const translatedColor = c === 'Vermelho' ? t('colorRed') : c === 'Azul' ? t('colorBlue') : c === 'Amarelo' ? t('colorYellow') : c === 'Verde' ? t('colorGreen') : c === 'Laranja' ? t('colorOrange') : c === 'Roxo' ? t('colorPurple') : c === 'Branco' ? t('colorWhite') : c === 'Preto' ? t('colorBlack') : c === 'Cinzento' ? t('colorGray') : c === 'Bege' ? t('colorBeige') : c; + return ( + + ); + })} +
+ + {itemColors.length === 0 &&

Selecione pelo menos uma cor

} +
`.split('\n'); + +lines.splice(1311, 16, ...newContent); + +fs.writeFileSync('src/App.jsx', lines.join('\n')); +console.log('App.jsx fixed successfully!'); diff --git a/patch_app.cjs b/patch_app.cjs new file mode 100644 index 0000000..e49599f --- /dev/null +++ b/patch_app.cjs @@ -0,0 +1,86 @@ +const fs = require('fs'); +let code = fs.readFileSync('src/App.jsx', 'utf8'); + +const replacements = [ + // Laundry message remove + [`

{t('laundryMsg')}

`, ``], + + // Create Section + [` Criar Secção`, ` {t('createSection')}`], + [`Ainda não tem secções criadas`, `{t('noSectionsCreated')}`], + + // Look card share tooltip + [`{copiedLookId === look.id ? 'Link copiado!' : 'Partilhar'}`, `{copiedLookId === look.id ? t('linkCopied') : t('share')}`], + + // Laundry looks + [`peça(s) na lavandaria`, `{t('piecesInLaundry')}`], + [`A ser lavados`, `{t('toBeWashed')}`], + [`Indisponíveis`, `{t('unavailable')}`], + [`Disponíveis (`, `{t('availableLooks')} (`], + [`Nenhum look disponível`, `{t('noLooksAvailable')}`], + + // Profile + [``, `{t('sendMessage')}`], + [`'Mensagem enviada com sucesso!'`, `t('msgSentSuccess')`], + [`'Erro ao enviar mensagem. Verifica a tua ligação.'`, `t('msgSendError')`], + + // Notifications + [`Notificações`, `{t('notificationsModal')}`], + [`Sem Notificações`, `{t('noNotifications')}`], + [`O utilizador Adicionar peça como compra futura

`, `

{t('addFuturePurchase')}

`], + [`Lista de Desejos`, `{t('wishlistDesc')}`], + + // Settings + [`

Suporte e Feedback

`, `

{t('feedbackTitle')}

`], + [`

Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!

`, `

{t('feedbackDesc')}

`], + [`

Cor do Tema

`, `

{t('themeColorTitle')}

`], + [`

Personalize a cor

`, `

{t('personalizeColorDesc')}

`], + [`Guardar Alterações`, `{t('saveChanges')}`] +]; + +for (const [oldText, newText] of replacements) { + code = code.split(oldText).join(newText); +} + +// Color map replacement +const colorMapReplace = `['Vermelho', 'Azul', 'Amarelo', 'Verde', 'Laranja', 'Roxo', 'Branco', 'Preto', 'Cinzento', 'Bege'].map(c => (`; +if(code.includes(colorMapReplace)) { + code = code.replace( + colorMapReplace, + `['Vermelho', 'Azul', 'Amarelo', 'Verde', 'Laranja', 'Roxo', 'Branco', 'Preto', 'Cinzento', 'Bege'].map(c => {\n const translatedColor = c === 'Vermelho' ? t('colorRed') : c === 'Azul' ? t('colorBlue') : c === 'Amarelo' ? t('colorYellow') : c === 'Verde' ? t('colorGreen') : c === 'Laranja' ? t('colorOrange') : c === 'Roxo' ? t('colorPurple') : c === 'Branco' ? t('colorWhite') : c === 'Preto' ? t('colorBlack') : c === 'Cinzento' ? t('colorGray') : c === 'Bege' ? t('colorBeige') : c;\n return (` + ); + // Be very precise replacing `{c}` to `{translatedColor}` + code = code.replace( + /className=\{\`px-4 py-2 rounded-xl text-xs font-bold transition-all border-2 \$\{itemColors\.includes\(c\) \? 'border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600\/30' : 'border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700'\}\`\}\n\s*>\n\s*\{c\}\n\s*<\/button>/, + match => match.replace('{c}', '{translatedColor}') + ); + // Replace the closing block + code = code.replace( + /<\/button>\n\s*\)\)/, + `\n )})` + ); +} + +fs.writeFileSync('src/App.jsx', code); +console.log('App.jsx updated successfully'); diff --git a/safe_patch.cjs b/safe_patch.cjs new file mode 100644 index 0000000..6183ce9 --- /dev/null +++ b/safe_patch.cjs @@ -0,0 +1,85 @@ +const fs = require('fs'); +let code = fs.readFileSync('src/App.jsx', 'utf8'); + +const replacements = [ + // 1. Remove the laundry message exactly + [`

{t('laundryMsg')}

`, ``], + + // 2. Simple exact text string replacements without modifying complex tags or logic + [`> Criar Secção`, `> {t('createSection')}`], + [`Ainda não tem secções criadas`, `{t('noSectionsCreated')}`], + + [`{copiedLookId === look.id ? 'Link copiado!' : 'Partilhar'}`, `{copiedLookId === look.id ? t('linkCopied') : t('share')}`], + + [`peça(s) na lavandaria`, `{t('piecesInLaundry')}`], + [`>A ser lavados<`, `>{t('toBeWashed')}<`], + [`— Indisponíveis (`, `— {t('unavailable')} (`], + [`— Disponíveis (`, `— {t('availableLooks')} (`], + [`Nenhum look disponível`, `{t('noLooksAvailable')}`], + + [``, `{t('sendMessage')}`], + [`'Mensagem enviada com sucesso!'`, `t('msgSentSuccess')`], + [`'Erro ao enviar mensagem. Verifica a tua ligação.'`, `t('msgSendError')`], + + [`Notificações`, `{t('notificationsModal')}`], + [`Sem Notificações`, `{t('noNotifications')}`], + [`>guardou o seu look<`, `>{t('userSavedLook')}<`], + [`no armário dele!`, `{t('inTheirCloset')}`], + + [`Look Partilhado`, `{t('sharedLookTitle')}`], + [`Partilhado por`, `{t('sharedBy')}`], + [`'alguém'`, `t('someone')`], + [`Peças incluídas`, `{t('includedPieces')}`], + [`>Ignorar<`, `>{t('ignore')}<`], + [`A copiar...`, `{t('copying')}`], + [`Copiar para o meu armário`, `{t('copyToMyCloset')}`], + + [`>Adicionar peça como compra futura<`, `>{t('addFuturePurchase')}<`], + [`>{t('wishlist') || 'Lista de Desejos'}<`, `>{t('wishlist') || t('wishlistDesc')}<`], + + [`>Suporte e Feedback<`, `>{t('feedbackTitle')}<`], + [`>Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!<`, `>{t('feedbackDesc')}<`], + [`>Cor do Tema<`, `>{t('themeColorTitle')}<`], + [`>Personalize a cor<`, `>{t('personalizeColorDesc')}<`], + [`Guardar Alterações`, `{t('saveChanges')}`] +]; + +for (const [oldText, newText] of replacements) { + code = code.split(oldText).join(newText); +} + +// Color map safe replacement using very exact match to avoid breaking braces +const oldMapColorCode = `['Vermelho', 'Azul', 'Amarelo', 'Verde', 'Laranja', 'Roxo', 'Branco', 'Preto', 'Cinzento', 'Bege'].map(c => ( + { + const translatedColor = c === 'Vermelho' ? t('colorRed') : c === 'Azul' ? t('colorBlue') : c === 'Amarelo' ? t('colorYellow') : c === 'Verde' ? t('colorGreen') : c === 'Laranja' ? t('colorOrange') : c === 'Roxo' ? t('colorPurple') : c === 'Branco' ? t('colorWhite') : c === 'Preto' ? t('colorBlack') : c === 'Cinzento' ? t('colorGray') : c === 'Bege' ? t('colorBeige') : c; + return ( + + {c} + + ))}`; +const newInnerCode = ` className={\`px-4 py-2 rounded-xl text-xs font-bold transition-all border-2 \${itemColors.includes(c) ? 'border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600/30' : 'border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700'}\`} + > + {translatedColor} + + ); + })}`; +if (code.includes(oldInnerCode)) { + code = code.replace(oldInnerCode, newInnerCode); +} else { + console.log("WARNING: oldInnerCode not found!"); +} + +fs.writeFileSync('src/App.jsx', code); +console.log('Safe patch applied'); diff --git a/src/App.jsx b/src/App.jsx index e762488..a4dfe7f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1060,7 +1060,7 @@ export default function App() {

{t('laundryBasket')}

-

{t('laundryMsg')}

+
@@ -1117,12 +1117,12 @@ export default function App() { {t('assignSections')}
{sections.length === 0 ? (
-

Ainda não tem secções criadas

+

{t('noSectionsCreated')}

) : (
@@ -1209,7 +1209,7 @@ export default function App() { > {copiedLookId === look.id ? : } - {copiedLookId === look.id ? 'Link copiado!' : 'Partilhar'} + {copiedLookId === look.id ? t('linkCopied') : t('share')} @@ -1237,7 +1237,7 @@ export default function App() {

- {look.items.filter(id => { const it = clothes.find(c => c.id === id); return it?.status === 'laundry'; }).length} peça(s) na lavandaria + {look.items.filter(id => { const it = clothes.find(c => c.id === id); return it?.status === 'laundry'; }).length} {t('piecesInLaundry')}

)} @@ -1251,14 +1251,14 @@ export default function App() {
-

{t('lookHistory')} — Disponíveis ({availableLooks.length})

+

{t('lookHistory')} — {t('availableLooks')} ({availableLooks.length})

{availableLooks.length > 0 ? (
{availableLooks.map(renderLookCard)}
) : ( -
Nenhum look disponível
+
{t('noLooksAvailable')}
)}
@@ -1267,7 +1267,7 @@ export default function App() {
-

A ser lavados — Indisponíveis ({laundryLooks.length})

+

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

{laundryLooks.map(renderLookCard)} @@ -1312,8 +1312,8 @@ export default function App() {
@@ -1345,12 +1345,12 @@ export default function App() { {t('assignSections')}
{sections.length === 0 ? (
-

Ainda não tem secções criadas

+

{t('noSectionsCreated')}

) : (
@@ -1434,7 +1434,7 @@ export default function App() {
- +
- + @@ -1631,12 +1631,12 @@ export default function App() {
setShowNotificationsModal(false)}> e.stopPropagation()}>
-

Notificações

+

{t('notificationsModal')}

{notifications.length === 0 ? ( -
Sem Notificações
+
{t('noNotifications')}
) : notifications.map(notif => (
@@ -1645,7 +1645,7 @@ export default function App() {

{notif.type === 'look_copied' && ( - <>O utilizador {notif.copiedByEmail} guardou o seu look "{notif.lookName}" no armário dele! + <>O utilizador {notif.copiedByEmail} guardou o seu look "{notif.lookName}" {t('inTheirCloset')} )}

@@ -1864,7 +1864,7 @@ export default function App() {

)} - {/* Modal de Look Partilhado */} + {/* Modal de {t('sharedLookTitle')} */} {showSharedLookModal && sharedLookData && (
{ setShowSharedLookModal(false); setSharedLookData(null); }}>
- Look Partilhado + {t('sharedLookTitle')}

{sharedLookData.lookName}

-

{sharedLookData.items.length} peça{sharedLookData.items.length !== 1 ? 's' : ''} • Partilhado por {sharedLookData.ownerEmail?.split('@')[0] || 'alguém'}

+

{sharedLookData.items.length} peça{sharedLookData.items.length !== 1 ? 's' : ''} • {t('sharedBy')} {sharedLookData.ownerEmail?.split('@')[0] || t('someone')}

{/* Peças do look */}
-

Peças incluídas

+

{t('includedPieces')}

{sharedLookData.items.map((item, idx) => (
@@ -1927,9 +1927,9 @@ export default function App() { style={{ background: 'linear-gradient(135deg, hsl(var(--primary-600)), hsl(var(--primary-500)))' }} > {sharedLookCopying ? ( - <> A copiar... + <> {t('copying')} ) : ( - <> Copiar para o meu armário + <> {t('copyToMyCloset')} )}
diff --git a/src/lib/i18n.js b/src/lib/i18n.js index 47923dd..5dfd3f5 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -131,8 +131,43 @@ export const translations = { allSections: "Todas", confirmDeleteSection: "Apagar esta secção?", sectionPlaceholder: "Ex: Trabalho, Festa...", - emojiPlaceholder: "Ex: 💼" - }, + emojiPlaceholder: "Ex: 💼", + createSection: "Criar Secção", + noSectionsCreated: "Ainda não tem secções criadas", + linkCopied: "Link copiado!", + share: "Partilhar", + piecesInLaundry: "peça(s) na lavandaria", + toBeWashed: "A ser lavados", + unavailable: "Indisponíveis", + availableLooks: "Disponíveis", + noLooksAvailable: "Nenhum look disponível", + location: "Localidade", + locationEx: "Ex: Lisboa, Portugal", + ideaSuggestion: "Ideia / Sugestão", + bugError: "Bug / Erro", + writeMessage: "Escreva aqui a sua mensagem...", + sendMessage: "Enviar Mensagem", + notificationsModal: "Notificações", + noNotifications: "Sem Notificações", + userSavedLook: "guardou o seu look", + inTheirCloset: "no armário dele!", + sharedLookTitle: "Look Partilhado", + sharedBy: "Partilhado por", + includedPieces: "Peças incluídas", + ignore: "Ignorar", + copying: "A copiar...", + copyToMyCloset: "Copiar para o meu armário", + msgSentSuccess: "Mensagem enviada com sucesso!", + msgSendError: "Erro ao enviar mensagem. Verifica a tua ligação.", + addFuturePurchase: "Adicionar peça como compra futura", + wishlistDesc: "Lista de Desejos", + someone: "alguém", + feedbackTitle: "Suporte e Feedback", + feedbackDesc: "Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!", + themeColorTitle: "Cor do Tema", + personalizeColorDesc: "Personalize a cor", + saveChanges: "Guardar Alterações", +}, EN: { loginModeIntro: "The Future of Your Style", emailPlaceholder: "Email", @@ -265,8 +300,43 @@ export const translations = { allSections: "All", confirmDeleteSection: "Delete this section?", sectionPlaceholder: "E.g.: Work, Party...", - emojiPlaceholder: "E.g.: 💼" - }, + emojiPlaceholder: "E.g.: 💼", + createSection: "Create Section", + noSectionsCreated: "No sections created yet", + linkCopied: "Link copied!", + share: "Share", + piecesInLaundry: "piece(s) in laundry", + toBeWashed: "To be washed", + unavailable: "Unavailable", + availableLooks: "Available", + noLooksAvailable: "No look available", + location: "Location", + locationEx: "E.g.: Lisbon, Portugal", + ideaSuggestion: "Idea / Suggestion", + bugError: "Bug / Error", + writeMessage: "Write your message here...", + sendMessage: "Send Message", + notificationsModal: "Notifications", + noNotifications: "No Notifications", + userSavedLook: "saved your look", + inTheirCloset: "in their closet!", + sharedLookTitle: "Shared Look", + sharedBy: "Shared by", + includedPieces: "Included Pieces", + ignore: "Ignore", + copying: "Copying...", + copyToMyCloset: "Copy to my closet", + msgSentSuccess: "Message sent successfully!", + msgSendError: "Error sending message. Check your connection.", + addFuturePurchase: "Add piece as future purchase", + wishlistDesc: "Wishlist", + someone: "someone", + feedbackTitle: "Support and Feedback", + feedbackDesc: "Do you have any ideas, suggestions, or found a problem? Send a message directly to us!", + themeColorTitle: "Theme Color", + personalizeColorDesc: "Personalize the color", + saveChanges: "Save Changes", +}, ES: { loginModeIntro: "El Futuro de Tu Estilo", emailPlaceholder: "Correo electrónico", @@ -399,8 +469,43 @@ export const translations = { allSections: "Todas", confirmDeleteSection: "¿Eliminar esta sección?", sectionPlaceholder: "Ej: Trabajo, Fiesta...", - emojiPlaceholder: "Ej: 💼" - }, + emojiPlaceholder: "Ej: 💼", + createSection: "Crear Sección", + noSectionsCreated: "Aún no hay secciones creadas", + linkCopied: "¡Enlace copiado!", + share: "Compartir", + piecesInLaundry: "pieza(s) en la lavandería", + toBeWashed: "Por lavar", + unavailable: "No disponibles", + availableLooks: "Disponibles", + noLooksAvailable: "Ningún look disponible", + location: "Ubicación", + locationEx: "Ej: Lisboa, Portugal", + ideaSuggestion: "Idea / Sugerencia", + bugError: "Error / Fallo", + writeMessage: "Escribe aquí tu mensaje...", + sendMessage: "Enviar Mensaje", + notificationsModal: "Notificaciones", + noNotifications: "Sin Notificaciones", + userSavedLook: "guardó tu look", + inTheirCloset: "en su armario!", + sharedLookTitle: "Look Compartido", + sharedBy: "Compartido por", + includedPieces: "Piezas incluidas", + ignore: "Ignorar", + copying: "Copiando...", + copyToMyCloset: "Copiar a mi armario", + msgSentSuccess: "¡Mensaje enviado con éxito!", + msgSendError: "Error al enviar. Revisa tu conexión.", + addFuturePurchase: "Añadir pieza como compra futura", + wishlistDesc: "Lista de Deseos", + someone: "alguien", + feedbackTitle: "Soporte y Comentarios", + feedbackDesc: "¿Tienes alguna idea, sugerencia o encontraste un problema? ¡Envíanos un mensaje directamente!", + themeColorTitle: "Color del Tema", + personalizeColorDesc: "Personaliza el color", + saveChanges: "Guardar Cambios", +}, FR: { loginModeIntro: "Le Futur de Ton Style", emailPlaceholder: "E-mail", @@ -533,8 +638,43 @@ export const translations = { allSections: "Toutes", confirmDeleteSection: "Supprimer cette section ?", sectionPlaceholder: "Ex: Travail, Fête...", - emojiPlaceholder: "Ex: 💼" - }, + emojiPlaceholder: "Ex: 💼", + createSection: "Créer une Section", + noSectionsCreated: "Aucune section créée", + linkCopied: "Lien copié !", + share: "Partager", + piecesInLaundry: "pièce(s) à la blanchisserie", + toBeWashed: "À laver", + unavailable: "Indisponibles", + availableLooks: "Disponibles", + noLooksAvailable: "Aucun look disponible", + location: "Emplacement", + locationEx: "Ex: Lisbonne, Portugal", + ideaSuggestion: "Idée / Suggestion", + bugError: "Bug / Erreur", + writeMessage: "Écrivez votre message ici...", + sendMessage: "Envoyer le Message", + notificationsModal: "Notifications", + noNotifications: "Aucune Notification", + userSavedLook: "a sauvegardé votre look", + inTheirCloset: "dans son placard !", + sharedLookTitle: "Look Partagé", + sharedBy: "Partagé par", + includedPieces: "Pièces incluses", + ignore: "Ignorer", + copying: "Copie en cours...", + copyToMyCloset: "Copier dans mon placard", + msgSentSuccess: "Message envoyé avec succès !", + msgSendError: "Erreur d'envoi. Vérifiez votre connexion.", + addFuturePurchase: "Ajouter comme achat futur", + wishlistDesc: "Liste de Souhaits", + someone: "quelqu'un", + feedbackTitle: "Support et Commentaires", + feedbackDesc: "Avez-vous des idées, des suggestions ou trouvé un problème ? Envoyez-nous un message directement !", + themeColorTitle: "Couleur du Thème", + personalizeColorDesc: "Personnaliser la couleur", + saveChanges: "Enregistrer les Modifications", +}, DE: { loginModeIntro: "Die Zukunft deines Stils", emailPlaceholder: "E-Mail", @@ -667,6 +807,41 @@ export const translations = { allSections: "Alle", confirmDeleteSection: "Diesen Bereich löschen?", sectionPlaceholder: "Zb: Arbeit, Party...", - emojiPlaceholder: "Zb: 💼" - } + emojiPlaceholder: "Zb: 💼", + createSection: "Bereich erstellen", + noSectionsCreated: "Noch keine Bereiche erstellt", + linkCopied: "Link kopiert!", + share: "Teilen", + piecesInLaundry: "Stück(e) in der Wäsche", + toBeWashed: "Zum Waschen", + unavailable: "Nicht verfügbar", + availableLooks: "Verfügbar", + noLooksAvailable: "Kein Look verfügbar", + location: "Ort", + locationEx: "Z.B.: Lissabon, Portugal", + ideaSuggestion: "Idee / Vorschlag", + bugError: "Fehler / Bug", + writeMessage: "Schreibe hier deine Nachricht...", + sendMessage: "Nachricht Senden", + notificationsModal: "Benachrichtigungen", + noNotifications: "Keine Benachrichtigungen", + userSavedLook: "hat deinen Look gespeichert", + inTheirCloset: "in seinem Schrank!", + sharedLookTitle: "Geteilter Look", + sharedBy: "Geteilt von", + includedPieces: "Enthaltene Stücke", + ignore: "Ignorieren", + copying: "Kopieren...", + copyToMyCloset: "In meinen Schrank kopieren", + msgSentSuccess: "Nachricht erfolgreich gesendet!", + msgSendError: "Fehler beim Senden. Überprüfe deine Verbindung.", + addFuturePurchase: "Als zukünftigen Kauf hinzufügen", + wishlistDesc: "Wunschzettel", + someone: "jemand", + feedbackTitle: "Support und Feedback", + feedbackDesc: "Hast du Ideen, Vorschläge oder ein Problem gefunden? Sende uns direkt eine Nachricht!", + themeColorTitle: "Themenfarbe", + personalizeColorDesc: "Farbe anpassen", + saveChanges: "Änderungen Speichern", +} }; diff --git a/update_i18n.cjs b/update_i18n.cjs new file mode 100644 index 0000000..0575b18 --- /dev/null +++ b/update_i18n.cjs @@ -0,0 +1,211 @@ +const fs = require('fs'); +let code = fs.readFileSync('src/lib/i18n.js', 'utf8'); + +const newKeys = { + PT: { + createSection: "Criar Secção", + noSectionsCreated: "Ainda não tem secções criadas", + linkCopied: "Link copiado!", + share: "Partilhar", + piecesInLaundry: "peça(s) na lavandaria", + toBeWashed: "A ser lavados", + unavailable: "Indisponíveis", + availableLooks: "Disponíveis", + noLooksAvailable: "Nenhum look disponível", + location: "Localidade", + locationEx: "Ex: Lisboa, Portugal", + ideaSuggestion: "Ideia / Sugestão", + bugError: "Bug / Erro", + writeMessage: "Escreva aqui a sua mensagem...", + sendMessage: "Enviar Mensagem", + notificationsModal: "Notificações", + noNotifications: "Sem Notificações", + userSavedLook: "guardou o seu look", + inTheirCloset: "no armário dele!", + sharedLookTitle: "Look Partilhado", + sharedBy: "Partilhado por", + includedPieces: "Peças incluídas", + ignore: "Ignorar", + copying: "A copiar...", + copyToMyCloset: "Copiar para o meu armário", + msgSentSuccess: "Mensagem enviada com sucesso!", + msgSendError: "Erro ao enviar mensagem. Verifica a tua ligação.", + addFuturePurchase: "Adicionar peça como compra futura", + wishlistDesc: "Lista de Desejos", + someone: "alguém", + feedbackTitle: "Suporte e Feedback", + feedbackDesc: "Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!", + themeColorTitle: "Cor do Tema", + personalizeColorDesc: "Personalize a cor", + saveChanges: "Guardar Alterações" + }, + EN: { + createSection: "Create Section", + noSectionsCreated: "No sections created yet", + linkCopied: "Link copied!", + share: "Share", + piecesInLaundry: "piece(s) in laundry", + toBeWashed: "To be washed", + unavailable: "Unavailable", + availableLooks: "Available", + noLooksAvailable: "No look available", + location: "Location", + locationEx: "E.g.: Lisbon, Portugal", + ideaSuggestion: "Idea / Suggestion", + bugError: "Bug / Error", + writeMessage: "Write your message here...", + sendMessage: "Send Message", + notificationsModal: "Notifications", + noNotifications: "No Notifications", + userSavedLook: "saved your look", + inTheirCloset: "in their closet!", + sharedLookTitle: "Shared Look", + sharedBy: "Shared by", + includedPieces: "Included Pieces", + ignore: "Ignore", + copying: "Copying...", + copyToMyCloset: "Copy to my closet", + msgSentSuccess: "Message sent successfully!", + msgSendError: "Error sending message. Check your connection.", + addFuturePurchase: "Add piece as future purchase", + wishlistDesc: "Wishlist", + someone: "someone", + feedbackTitle: "Support and Feedback", + feedbackDesc: "Do you have any ideas, suggestions, or found a problem? Send a message directly to us!", + themeColorTitle: "Theme Color", + personalizeColorDesc: "Personalize the color", + saveChanges: "Save Changes" + }, + ES: { + createSection: "Crear Sección", + noSectionsCreated: "Aún no hay secciones creadas", + linkCopied: "¡Enlace copiado!", + share: "Compartir", + piecesInLaundry: "pieza(s) en la lavandería", + toBeWashed: "Por lavar", + unavailable: "No disponibles", + availableLooks: "Disponibles", + noLooksAvailable: "Ningún look disponible", + location: "Ubicación", + locationEx: "Ej: Lisboa, Portugal", + ideaSuggestion: "Idea / Sugerencia", + bugError: "Error / Fallo", + writeMessage: "Escribe aquí tu mensaje...", + sendMessage: "Enviar Mensaje", + notificationsModal: "Notificaciones", + noNotifications: "Sin Notificaciones", + userSavedLook: "guardó tu look", + inTheirCloset: "en su armario!", + sharedLookTitle: "Look Compartido", + sharedBy: "Compartido por", + includedPieces: "Piezas incluidas", + ignore: "Ignorar", + copying: "Copiando...", + copyToMyCloset: "Copiar a mi armario", + msgSentSuccess: "¡Mensaje enviado con éxito!", + msgSendError: "Error al enviar. Revisa tu conexión.", + addFuturePurchase: "Añadir pieza como compra futura", + wishlistDesc: "Lista de Deseos", + someone: "alguien", + feedbackTitle: "Soporte y Comentarios", + feedbackDesc: "¿Tienes alguna idea, sugerencia o encontraste un problema? ¡Envíanos un mensaje directamente!", + themeColorTitle: "Color del Tema", + personalizeColorDesc: "Personaliza el color", + saveChanges: "Guardar Cambios" + }, + FR: { + createSection: "Créer une Section", + noSectionsCreated: "Aucune section créée", + linkCopied: "Lien copié !", + share: "Partager", + piecesInLaundry: "pièce(s) à la blanchisserie", + toBeWashed: "À laver", + unavailable: "Indisponibles", + availableLooks: "Disponibles", + noLooksAvailable: "Aucun look disponible", + location: "Emplacement", + locationEx: "Ex: Lisbonne, Portugal", + ideaSuggestion: "Idée / Suggestion", + bugError: "Bug / Erreur", + writeMessage: "Écrivez votre message ici...", + sendMessage: "Envoyer le Message", + notificationsModal: "Notifications", + noNotifications: "Aucune Notification", + userSavedLook: "a sauvegardé votre look", + inTheirCloset: "dans son placard !", + sharedLookTitle: "Look Partagé", + sharedBy: "Partagé par", + includedPieces: "Pièces incluses", + ignore: "Ignorer", + copying: "Copie en cours...", + copyToMyCloset: "Copier dans mon placard", + msgSentSuccess: "Message envoyé avec succès !", + msgSendError: "Erreur d'envoi. Vérifiez votre connexion.", + addFuturePurchase: "Ajouter comme achat futur", + wishlistDesc: "Liste de Souhaits", + someone: "quelqu'un", + feedbackTitle: "Support et Commentaires", + feedbackDesc: "Avez-vous des idées, des suggestions ou trouvé un problème ? Envoyez-nous un message directement !", + themeColorTitle: "Couleur du Thème", + personalizeColorDesc: "Personnaliser la couleur", + saveChanges: "Enregistrer les Modifications" + }, + DE: { + createSection: "Bereich erstellen", + noSectionsCreated: "Noch keine Bereiche erstellt", + linkCopied: "Link kopiert!", + share: "Teilen", + piecesInLaundry: "Stück(e) in der Wäsche", + toBeWashed: "Zum Waschen", + unavailable: "Nicht verfügbar", + availableLooks: "Verfügbar", + noLooksAvailable: "Kein Look verfügbar", + location: "Ort", + locationEx: "Z.B.: Lissabon, Portugal", + ideaSuggestion: "Idee / Vorschlag", + bugError: "Fehler / Bug", + writeMessage: "Schreibe hier deine Nachricht...", + sendMessage: "Nachricht Senden", + notificationsModal: "Benachrichtigungen", + noNotifications: "Keine Benachrichtigungen", + userSavedLook: "hat deinen Look gespeichert", + inTheirCloset: "in seinem Schrank!", + sharedLookTitle: "Geteilter Look", + sharedBy: "Geteilt von", + includedPieces: "Enthaltene Stücke", + ignore: "Ignorieren", + copying: "Kopieren...", + copyToMyCloset: "In meinen Schrank kopieren", + msgSentSuccess: "Nachricht erfolgreich gesendet!", + msgSendError: "Fehler beim Senden. Überprüfe deine Verbindung.", + addFuturePurchase: "Als zukünftigen Kauf hinzufügen", + wishlistDesc: "Wunschzettel", + someone: "jemand", + feedbackTitle: "Support und Feedback", + feedbackDesc: "Hast du Ideen, Vorschläge oder ein Problem gefunden? Sende uns direkt eine Nachricht!", + themeColorTitle: "Themenfarbe", + personalizeColorDesc: "Farbe anpassen", + saveChanges: "Änderungen Speichern" + } +}; + +for (const lang in newKeys) { + const keys = newKeys[lang]; + const langRegex = new RegExp(`${lang}: \\{([\\s\\S]*?)\\}`, 'g'); + let match = langRegex.exec(code); + if (match) { + let currentKeys = match[1]; + let newKeysString = ""; + for (const [k, v] of Object.entries(keys)) { + if (!currentKeys.includes(`${k}:`)) { + newKeysString += ` ${k}: "${v}",\n`; + } + } + if (newKeysString.length > 0) { + code = code.replace(currentKeys, currentKeys.trimEnd() + ",\n" + newKeysString); + } + } +} + +fs.writeFileSync('src/lib/i18n.js', code); +console.log('i18n.js updated successfully');