diff --git a/website/docs/ref/catalog-formats.md b/website/docs/ref/catalog-formats.md index caae2e609..ceb1707de 100644 --- a/website/docs/ref/catalog-formats.md +++ b/website/docs/ref/catalog-formats.md @@ -45,66 +45,14 @@ export default { PO formatter accepts the following options: -```ts -export type PoFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean; - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean; - - /** - * Print `js-lingui-id: Xs4as` statement in extracted comments section - * - * @default false - */ - printLinguiId?: boolean; - - /** - * By default, the po-formatter treats the pair `msgid` + `msgctx` as the source - * for generating an ID by hashing its value. - * - * For messages with explicit IDs, the formatter adds a special comment `js-lingui-explicit-id` as a flag. - * When this flag is present, the formatter will use the `msgid` as-is without any additional processing. - * - * @default false - */ - explicitIdAsDefault?: boolean; - - /** - * Custom attributes to append to the PO file header - * - * @default {} - */ - customHeaderAttributes?: { [key: string]: string }; - - /** - * Print values for unnamed placeholders as comments for each message. - * This can give more context to translators for better translations. - * By default, first 3 placeholders are shown. - * - * Example: - * - * t\`Hello ${user.name} ${value}\` - * - * Will be extracted as - * - * #. placeholder {0}: user.name - * msgid "Hello {0} {value}" - * - * @default true - */ - printPlaceholdersInComments?: boolean | { limit?: number }; -}; -``` +| Option | Type | Default | Description | +| ----------------------------- | ------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `origins` | boolean | `true` | Include comments in the PO file that indicate where each message is used in the source code. This provides additional context during the translation | +| `lineNumbers` | boolean | `true` | Include line numbers in the origin comments. This makes it easier to locate messages in the source code | +| `printLinguiId` | boolean | `false` | Add a `js-lingui-id: hash` comment to each message in the PO file. This ID is a hash generated by Lingui | +| `explicitIdAsDefault` | boolean | `false` | Use the `msgid` as is for messages with explicit IDs. The formatter will add the `js-lingui-explicit-id` flag for such strings | +| `customHeaderAttributes` | `{[key: string]: string}` | `{}` | Allows adding custom key-value pairs to the PO file header | +| `printPlaceholdersInComments` | boolean \| `{ limit?: number }` | `true` | Print values for unnamed placeholders as comments for each message. This can give translators more context for better translations. By default, the first 3 placeholders are displayed | ### Examples {#po-examples} @@ -166,37 +114,12 @@ export default { The PO Gettext formatter accepts the following options: -```ts -export type PoGettextFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean; - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean; - - /** - * Disable warning about unsupported `Select` feature encountered in catalogs - * - * @default false - */ - disableSelectWarning?: boolean; - - /** - * Overrides the default prefix for icu and plural comments in the final PO catalog. - * - * @default "js-lingui:" - */ - customICUPrefix?: string; -}; -``` +| Option | Type | Default | Description | +| ---------------------- | ------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `origins` | boolean | `true` | Include comments in the PO file that indicate where each message is used in the source code. This provides additional context during the translation | +| `lineNumbers` | boolean | `true` | Include line numbers in the origin comments. This makes it easier to locate messages in the source code | +| `disableSelectWarning` | boolean | `false` | Disable warnings about unsupported `Select` features encountered in catalogs. This can be useful if you're aware of the limitation and want to suppress related warnings | +| `customICUPrefix` | string | `"js-lingui:"` | Override the default prefix for ICU and plural comments in the final PO catalog | ### Examples {#po-gettext-examples} @@ -278,37 +201,12 @@ export default { JSON formatter accepts the following options: -```ts -export type JsonFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean; - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean; - - /** - * Different styles of how information could be printed - * - * @default "lingui" - */ - style?: "lingui" | "minimal"; - - /** - * Indentation of output JSON - * - * @default 2 - */ - indentation?: number; -}; -``` +| Option | Type | Default | Description | +| ------------- | ------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `style` | `"lingui"` \| `"minimal"` | `"lingui"` | Specify the output style of the JSON file. `lingui` includes full Lingui-specific metadata, while `minimal` may output a more compact format | +| `origins` | boolean | `true` | Include information in the JSON file about where each message is used in the source code. This provides additional context during the translation | +| `lineNumbers` | boolean | `true` | Include line numbers in the origin comments. This makes it easier to locate messages in the source code | +| `indentation` | number | `2` | Set the number of spaces to use for indentation in the output JSON file. This affects the readability of the file when opened in a text editor | ### Examples {#json-examples}