The Lingui configuration defines how localization catalogs are generated, which locales are supported, and which files are included or excluded from translation.
Key configuration properties:
sourceLocale: The primary language of the codebase (e.g., en).locales: An array of supported locale identifiers (e.g., ['en', 'ar', 'he']).fallbackLocales: Defines the default locale to use when a translation is missing. Use the default key to specify the fallback (e.g., { default: 'en' }).format: Specifies the output format for message files. In this project, it uses @lingui/format-po with lineNumbers: false.catalogs: An array of catalog objects defining where messages are stored and which source files to scan.
Catalog Object Properties:
path: The template path for message files, using {locale} as a placeholder (e.g., <rootDir>/src/locales/{locale}/messages).include: Glob patterns for source files to be scanned for translatable strings.exclude: Glob patterns for files or directories to ignore during scanning. Note that in this project, showcase components are intentionally excluded to focus on component RTL previewing rather than marketing copy translation.
import { defineConfig } from "@lingui/cli";
import { formatter } from "@lingui/format-po";
export default defineConfig({
sourceLocale: "en",
locales: ["en", "ar", "he"],
fallbackLocales: {
default: "en",
},
format: formatter({ lineNumbers: false }),
catalogs: [
{
path: "<rootDir>/src/locales/{locale}/messages",
include: ["<rootDir>/src"],
exclude: [
"<rootDir>/src/components/showcases",
"<rootDir>/src/app/(home)/showcases",
"<rootDir>/src/locales",
],
},
],
});