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');