const fs = require('fs'); let code = fs.readFileSync('src/App.jsx', 'utf8'); const replacements = [ // Laundry message remove [`
{t('laundryMsg')}
`, ``], // Create Section [`{t('addFuturePurchase')}
`], [`Lista de Desejos`, `{t('wishlistDesc')}`], // Settings [`Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!
`, `{t('feedbackDesc')}
`], [`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');