Payload CMS Content Localization Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Payload CMS Content Localization Setup
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Content Localization in Payload CMS

Payload supports multilingual content at the field level: each field marked as localized stores separate values for each locale. In PostgreSQL this is a column with JSONB object {ru: "...", en: "...", uk: "..."}.

Locale Configuration

// payload.config.ts
export default buildConfig({
  localization: {
    locales: [
      { label: 'Русский', code: 'ru' },
      { label: 'English', code: 'en' },
      { label: 'Українська', code: 'uk' },
    ],
    defaultLocale: 'ru',
    fallback: true,  // if no translation exists — use default locale
  },
})

Localized Fields

// collections/Posts.ts
fields: [
  {
    name: 'title',
    type: 'text',
    localized: true,  // separate value per locale
    required: true,
  },
  {
    name: 'content',
    type: 'richText',
    localized: true,
  },
  {
    name: 'slug',
    type: 'text',
    localized: true,  // slug can be localized too
    unique: true,
  },
  {
    name: 'featuredImage',
    type: 'upload',
    relationTo: 'media',
    // NOT localized — same image for all locales
  },
]

Queries with Locale

// Get posts in Russian
const posts = await payload.find({
  collection: 'posts',
  locale: 'ru',
})

// Get post in all languages at once
const allLocales = await payload.findByID({
  collection: 'posts',
  id: postId,
  locale: 'all',
})
// allLocales.title = { ru: '...', en: '...', uk: '...' }

// REST API:
// GET /api/posts?locale=en
// GET /api/posts/123?locale=all

Integration with Next.js i18n

// app/[locale]/posts/[slug]/page.tsx
import { getPayload } from 'payload'
import { notFound } from 'next/navigation'

type Locale = 'ru' | 'en' | 'uk'

export default async function PostPage({
  params,
}: {
  params: { locale: Locale; slug: string }
}) {
  const payload = await getPayload({ config })

  const result = await payload.find({
    collection: 'posts',
    locale: params.locale,
    where: {
      and: [
        { slug: { equals: params.slug } },
        { _status: { equals: 'published' } },
      ],
    },
  })

  if (!result.docs[0]) notFound()
  return <PostPage post={result.docs[0]} />
}

export async function generateStaticParams() {
  const payload = await getPayload({ config })
  const locales: Locale[] = ['ru', 'en', 'uk']
  const params: { locale: Locale; slug: string }[] = []

  for (const locale of locales) {
    const posts = await payload.find({ collection: 'posts', locale, limit: 1000 })
    posts.docs.forEach(post => {
      if (post.slug) params.push({ locale, slug: post.slug as string })
    })
  }
  return params
}

Timeline

Setting up localization for 3 languages with existing collections adaptation and Next.js routing — 1–2 days.