Skip to content

feat: add opt-in translation checks during compilation - #794

Open
everton-dgn wants to merge 4 commits into
opral:mainfrom
everton-dgn:feat/native-translation-checks
Open

everton-dgn wants to merge 4 commits into
opral:mainfrom
everton-dgn:feat/native-translation-checks

Conversation

@everton-dgn

Copy link
Copy Markdown
Contributor

Problem

Projects that require every configured locale to be complete currently need a separate validation step before compiling. Paraglide's locale fallback is useful, but it can also conceal an accidentally missing translation.

Change

Add an opt-in checkTranslations compiler option, available through paraglide.config, framework plugins, and the compiler API. It runs the Inlang SDK's checkBundle against the bundles already loaded for compilation and reports diagnostics before writing output. The default remains false, preserving existing fallback behavior.

The compiler now closes the loaded project in a finally block, including when validation fails. Documentation explains the checks and the boundary in development: watch integrations can retain the previous valid output after a failed compilation. Unused-message detection remains part of inlang check.

Validation

  • Eight regression tests cover opt-in behavior, translation diagnostics, plural-form variables, schema validation, byte-identical output for valid catalogs, and cleanup/recovery after failure.
  • The full pnpm run ci passed with VITEST_MAX_FORKS=2 VITEST_MIN_FORKS=1. An earlier unrestricted run timed out in an existing declaration-emission test; it passed on the full rerun.
  • Manual CLI and Vite production builds reject an incomplete catalog with the option enabled, preserve the previous generated output, and allow fallback with the option disabled.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T07:14:31.889970Z aa4b672 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5675792f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/compiler/compile-project.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbfece1855

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/bundler-plugins/unplugin.ts Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant