fix: resolve contact form placeholders, restore process block layout, and fix testimonials carousel scroll logic
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import { getPayload } from 'payload'
|
||||
import configPromise from '../src/payload.config'
|
||||
|
||||
async function run() {
|
||||
console.log('Rozpoczynam naprawę tłumaczenia bloku Team dla DE...')
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
|
||||
const pages = await payload.find({
|
||||
collection: 'pages',
|
||||
locale: 'de',
|
||||
limit: 100
|
||||
})
|
||||
|
||||
let updated = false
|
||||
for (const page of pages.docs) {
|
||||
if (!page.layout) continue
|
||||
|
||||
let changed = false
|
||||
const newLayout = page.layout.map((block: any) => {
|
||||
if (block.blockType === 'team') {
|
||||
if (block.title === 'Nasz zespół' || block.title === 'Unser Team') {
|
||||
console.log(`[DE] Wartość przed: title="${block.title}", subtitle="${block.subtitle}"`)
|
||||
block.title = 'Unser Team'
|
||||
block.subtitle = 'Lernen Sie die Experten kennen, die sich mit Engagement um Ihre Finanzen kümmern. Jeder von uns bringt langjährige Erfahrung mit, um Ihnen Sicherheit und Ruhe zu garantieren.'
|
||||
console.log(`[DE] Wartość po: title="${block.title}", subtitle="${block.subtitle}"`)
|
||||
|
||||
if (block.members && block.members.length > 0) {
|
||||
// Przetłumacz na sztywno Janusza jeśli jest w bazie, żeby rola/opis też miały sens
|
||||
if (block.members[0].name.includes('Janusz')) {
|
||||
block.members[0].role = 'Inhaber / Beratungsstellenleiter'
|
||||
block.members[0].description = 'Langjähriger Steuerrechtspraktiker mit Spezialisierung auf die Beratung polnischer Arbeitnehmer in Deutschland.'
|
||||
// keep URL as is
|
||||
}
|
||||
}
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
return block
|
||||
})
|
||||
|
||||
if (changed) {
|
||||
console.log(`Aktualizacja strony DE: ${page.title} (ID: ${page.id})`)
|
||||
await payload.update({
|
||||
collection: 'pages',
|
||||
id: page.id,
|
||||
locale: 'de',
|
||||
data: { layout: newLayout }
|
||||
})
|
||||
updated = true
|
||||
}
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
console.log('Zaktualizowano pomyślnie.')
|
||||
} else {
|
||||
console.log('Nie znaleziono bloku Team do aktualizacji na DE.')
|
||||
}
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
run()
|
||||
Reference in New Issue
Block a user