Skip to content

docs(v8): add "Use with Locize" recipe#922

Open
adrai wants to merge 3 commits into
jsverse:gitbook-docsfrom
adrai:add-locize-guide
Open

docs(v8): add "Use with Locize" recipe#922
adrai wants to merge 3 commits into
jsverse:gitbook-docsfrom
adrai:add-locize-guide

Conversation

@adrai

@adrai adrai commented May 19, 2026

Copy link
Copy Markdown

Adds a new Recipe page documenting how to use Transloco with Locize, per the contribution invitation on the Sandbox & Examples page ("Share your unique use cases, innovative solutions, or integrations").

The recipe lives at docs/v8/resources/recipies/use-with-locize.md and walks through:

  • Implementing a custom TranslocoLoader that fetches translations from the Locize CDN
  • Implementing a custom TranslocoMissingHandler that pushes missing keys back via locizer (analogous to i18next's saveMissing)
  • Wiring both into app.config.ts via provideTransloco + provideTranslocoMissingHandler (Standalone and NgModule tabs, mirroring the existing Using Xliff recipe's format)

Both Locize CDN endpoints are documented:

  • Standard CDN (api.lite.locize.app, BunnyCDN-backed, default for new projects)
  • Pro CDN (api.locize.app, AWS CloudFront-backed)

Locize is maintained by the same team that builds i18next.

Also adds a one-line entry under "Example repositories" in sandbox-and-examples.md pointing at the companion runnable Angular 21 + Transloco 8 example at github.com/locize/transloco-example (recently refreshed for the v8 standalone-components API).

Sidebar entry added to SUMMARY.md under Resources › Recipes.

Happy to adjust scope, wording, code-tab labels, or sidebar placement if a different shape would land better.


Summary by cubic

Adds a “Use with Locize” recipe to the v8 docs showing how to load translations from Locize with @jsverse/transloco using a custom TranslocoLoader, plus a TranslocoMissingHandler (via locizer) to push missing keys. Updates the sidebar and examples, and adds bundler-agnostic guidance for sourcing the Locize API key.

  • New Features
    • New recipe at docs/v8/resources/recipies/use-with-locize.md with Standalone and NgModule setup (provideTransloco, provideTranslocoMissingHandler, provideHttpClient()); initializes locizer in the handler constructor so isDevMode() runs post-bootstrap.
    • Bundler-agnostic API key guidance: covers @angular/build (Vite) env vars, webpack @angular-devkit/build-angular file-replacement, and runtime fetch; code uses a devApiKey placeholder and warns not to commit keys.
    • Documents Locize CDN endpoints: api.lite.locize.app (Standard) and api.locize.app (Pro). Adds locize/transloco-example to Sandbox & Examples and a sidebar entry in SUMMARY.md.

Written for commit da20417. Summary will update on new commits. Review in cubic

Adds a Recipe documenting the pattern for loading translations from
Locize via a custom TranslocoLoader plus pushing missing keys back via
a custom TranslocoMissingHandler. Covers both Locize CDN endpoints
(Standard api.lite.locize.app and Pro api.locize.app), the
standalone-components setup, and links to the runnable example at
github.com/locize/transloco-example.

Also wires the example into the Sandbox & Examples page.
Copilot AI review requested due to automatic review settings May 19, 2026 11:45
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93806ab1-f88a-46af-a4d6-3b79eb7025ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds documentation for integrating Transloco with the Locize translation management system, including a new recipe page and references from the sandbox/examples page and the v8 SUMMARY.

Changes:

  • New recipe page use-with-locize.md describing custom TranslocoLoader and TranslocoMissingHandler for Locize.
  • Added reference to the new recipe in sandbox-and-examples.md with a link to an example repo.
  • Added the new recipe entry to the v8 SUMMARY.md table of contents.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
docs/v8/resources/recipies/use-with-locize.md New recipe describing Locize integration with code samples for standalone and NgModule setups.
docs/v8/resources/sandbox-and-examples.md Adds an "Example repositories" section linking to the locize/transloco-example repo and the new recipe.
docs/v8/SUMMARY.md Adds the new recipe to the v8 docs sidebar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


### Example repositories

* [locize/transloco-example](https://github.com/locize/transloco-example) — Angular 21 + Transloco 8 wired against the [Locize](https://www.locize.com/?from=transloco-docs) translation management CDN, with a custom `TranslocoMissingHandler` that pushes new keys back via `saveMissing`. See the matching [Use with Locize](recipies/use-with-locize.md) recipe.
Comment thread docs/v8/resources/recipies/use-with-locize.md Outdated
Comment on lines +105 to +108
When a key is requested in the active language **and** the active
language equals the default (reference) language, push the key to
Locize so translators can fill it in. Guard the apiKey on `isDevMode()`
so production builds never carry the write-enabled credential.
Comment thread docs/v8/resources/recipies/use-with-locize.md
Comment thread docs/v8/SUMMARY.md
* [Recipes](resources/recipies/README.md)
* [Prefetch User Language](resources/recipies/prefetch-user-language.md)
* [Using Xliff](resources/recipies/using-xliff.md)
* [Use with Locize](resources/recipies/use-with-locize.md)
@pkg-pr-new

pkg-pr-new Bot commented May 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@jsverse/transloco

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco@922

@jsverse/transloco-locale

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-locale@922

@jsverse/transloco-messageformat

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-messageformat@922

@jsverse/transloco-optimize

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-optimize@922

@jsverse/transloco-persist-lang

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-lang@922

@jsverse/transloco-persist-translations

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-translations@922

@jsverse/transloco-preload-langs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-preload-langs@922

@jsverse/transloco-schematics

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-schematics@922

@jsverse/transloco-scoped-libs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-scoped-libs@922

@jsverse/transloco-utils

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-utils@922

@jsverse/transloco-validator

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-validator@922

commit: da20417

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/v8/resources/recipies/use-with-locize.md Outdated
Comment thread docs/v8/resources/recipies/use-with-locize.md Outdated
- Move locizer.init into the handler's constructor so isDevMode() runs
  after Angular bootstrap (was at module-load, which is unreliable
  depending on bundler setup).
- Add a hint/warning block about not committing the Locize apiKey to
  source — recommend sourcing from a git-ignored env file via the
  build tool's env-var injection (e.g. import.meta.env.VITE_*).
- NgModule example: replace deprecated HttpClientModule with
  provideHttpClient() to match the standalone example and Angular 21+
  conventions.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/v8/resources/recipies/use-with-locize.md Outdated
Replace the Vite-only import.meta.env example with a bullet list that
covers @angular/build (Vite-based, Angular 17+ default), webpack-based
@angular-devkit/build-angular:browser (legacy environments.ts
file-replacement), and runtime-fetch patterns. The code example now
shows a generic devApiKey constant with a pointer to the warning block.
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.

2 participants