From 8c0afd1183f1c5ee6d7e40a6223f6a8264a43751 Mon Sep 17 00:00:00 2001 From: IMB11 Date: Mon, 4 Aug 2025 18:41:14 +0100 Subject: [PATCH] feat: update readme --- packages/moderation/README.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/packages/moderation/README.md b/packages/moderation/README.md index b15700e2c..cda97133c 100644 --- a/packages/moderation/README.md +++ b/packages/moderation/README.md @@ -22,7 +22,6 @@ The package is organized as follows: │ │ └── ... # One file per stage │ └── nags/ # Publishing checklist (nag system) files │ ├── core.ts # Core nags (required fields, basic validation) -│ ├── core.i18n.ts # Internationalization messages for core nags │ └── ... └── types/ # Type definitions ├── actions.ts # Action-related types (moderation) @@ -175,22 +174,7 @@ A nag represents a specific issue or suggestion for improvement. Each nag has: ### Internationalization -Each nag category has a corresponding `.i18n.ts` file containing message definitions: - -```typescript -// Example from core.i18n.ts -export default defineMessages({ - addDescriptionTitle: { - id: 'nags.add-description.title', - defaultMessage: 'Add a description', - }, - addDescriptionDescription: { - id: 'nags.add-description.description', - defaultMessage: - "A description that clearly describes the project's purpose and function is required.", - }, -}) -``` +Use vintl's `defineMessage` syntax. If you want to use context in the messages, you can do so like this: @@ -198,7 +182,7 @@ If you want to use context in the messages, you can do so like this: description: (context: NagContext) => { const { formatMessage } = useVIntl() - return formatMessage(messages.descriptionTooShortDescription, { + return formatMessage(defineMessage(...), { length: context.project.body?.length || 0, minChars: MIN_DESCRIPTION_CHARS, })