Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

1.7 KB
Raw Blame
import { defineConfig } from '@lingui/cli';
import { formatter } from '@lingui/format-po';

/**
 * Lingui i18n configuration for the OpenKnowledge editor frontend.
 *
 * `pseudo` is a generated pseudolocalization locale — `lingui compile` derives
 * it from `en` with no translation step, and `i18n:extract` writes no catalog
 * for it. Loading a development build with
 * `?lang=pseudo` activates it (`src/lib/dev-pseudo-locale.ts`), which visually
 * marks every wrapped string so unwrapped (still-hardcoded) copy is obvious
 * during the rolling string-migration. It is not a supported language: it never
 * reaches the config enum or the picker, and a shipped build neither answers to
 * the parameter nor carries the catalog.
 *
 * `locales` is `SUPPORTED_LOCALES` from `@inkeep/open-knowledge-core` plus the
 * generated `pseudo`. It is spelled out literally rather than imported: the
 * Lingui CLI loads this file through its own TS loader, before any workspace
 * build, so a cross-package import would make catalog extraction depend on
 * core's build output. `tests/meta/supported-locales-sync.test.ts` pins the two
 * lists equal instead — a config value with no catalog behind it is a user
 * choosing a language and getting English.
 */
export default defineConfig({
  sourceLocale: 'en',
  locales: [
    'en',
    'zh-Hans',
    'zh-Hant',
    'hi',
    'es',
    'ar',
    'fr',
    'bn',
    'pt-BR',
    'id',
    'ur',
    'ko',
    'pl',
    'pseudo',
  ],
  pseudoLocale: 'pseudo',
  catalogs: [
    {
      path: '<rootDir>/src/locales/{locale}/messages',
      include: ['src'],
      exclude: ['**/node_modules/**', '**/*.test.*', '**/*.e2e.*', '**/*.stories.*'],
    },
  ],
  format: formatter({ origins: false, printPlaceholdersInComments: false }),
});