Skip to content

docs: replace Legacy API usage with Composition API usage #2196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BobbieGoede
Copy link
Member

@BobbieGoede BobbieGoede commented Jun 2, 2025

There are more places where the deprecated Legacy API is mentioned (on the fallback page at least), should these be removed?

This replaces the config key to enable fallback interpolation, instead of replacing we could add a notice pointing out the original config key.

Summary by CodeRabbit

  • Documentation
    • Updated documentation to reflect the renaming of a configuration option from formatFallbackMessages to fallbackFormat in descriptive text and examples.

Copy link

coderabbitai bot commented Jun 2, 2025

Walkthrough

The documentation was updated to change the configuration option name from formatFallbackMessages to fallbackFormat throughout the descriptive text and example code. No other content or functionality was altered.

Changes

File(s) Change Summary
docs/guide/essentials/fallback.md Renamed config option from formatFallbackMessages to fallbackFormat in text and code examples.

Suggested labels

Type: Documentation

Suggested reviewers

  • kazupon

Poem

In the docs where options dwell,
A name was changed, and all is well.
From formatFallbackMessages to fallbackFormat
Clearer words, no need to chat!
Hopping forward, docs in sync,
Rabbits nod and softly wink. 🐇✨


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
docs/guide/essentials/fallback.md (1)

1-154: 💡 Verification agent

🧩 Analysis chain

Verify no leftover references to the old option.

Please search the docs to confirm there are no remaining occurrences of formatFallbackMessages.


🏁 Script executed:

#!/usr/bin/env bash
# Ensure no lingering Legacy API references in documentation
rg -n 'formatFallbackMessages' docs/guide/

Length of output: 129


Remove legacy formatFallbackMessages reference

The search revealed one remaining occurrence of the old option in the Composition API guide. Please update the table in docs/guide/advanced/composition.md to eliminate this reference:

• docs/guide/advanced/composition.md:533

Suggested diff:

- | `formatFallbackMessages` | `fallbackFormat` |
🧰 Tools
🪛 LanguageTool

[typographical] ~9-~9: After the expression ‘for example’ a comma is usually used.
Context: ...llback is activated automatically. For example de-DE-bavarian would fallback 1. `de-...

(COMMA_FOR_EXAMPLE)


[grammar] ~9-~9: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...ly. For example de-DE-bavarian would fallback 1. de-DE-bavarian 1. de-DE 1. de ...

(NOUN_VERB_CONFUSION)


[typographical] ~71-~71: After the expression ‘for example’ a comma is usually used.
Context: ...ocale by using an array of locales. For example ```javascript fallbackLocale: [ 'fr', ...

(COMMA_FOR_EXAMPLE)

🪛 markdownlint-cli2 (0.17.2)

54-54: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🧹 Nitpick comments (3)
docs/guide/essentials/fallback.md (3)

109-111: Add a migration notice for Legacy API users.

To aid developers migrating from the Legacy API, include a tip that the old option was named formatFallbackMessages: true in Legacy mode.

Proposed snippet:

@@ ## Fallback interpolation
- Set `fallbackFormat: true` to do template interpolation on translation keys when your language lacks a translation for a key.
+ Set `fallbackFormat: true` to do template interpolation on translation keys when your language lacks a translation for a key.

+:::tip Migration Notice
+In Legacy API mode, the equivalent option was `formatFallbackMessages: true`.
+Refer to the Migration Guide for details.
+:::

124-124: Rephrase for clarity and conciseness.

That sentence is a bit dense. Consider tightening it for better readability.

Example rewrite:

- In fact, you can even include template parameters in a key. Together with `fallbackFormat: true`, this lets you skip writing templates for your "base" language; the keys *are* your templates.
+ You can include template parameters directly in your keys. With `fallbackFormat: true`, these keys become your templates, removing the need for separate base-language templates.

136-136: Unify code block language identifiers.

This snippet is fenced as javascript, but earlier examples use js. For consistency across the guide, choose one.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4c6e3a and abb7c17.

📒 Files selected for processing (1)
  • docs/guide/essentials/fallback.md (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: release
  • GitHub Check: Unit test (windows-latest, 20)
  • GitHub Check: Build (windows-latest, 20)
  • GitHub Check: Build (ubuntu-latest, 20)
  • GitHub Check: Build (macos-latest, 20)
  • GitHub Check: upload

Copy link

github-actions bot commented Jun 2, 2025

Size Report

Bundles

File Size Gzip Brotli
core.esm-browser.prod.js 38.05 kB 11.62 kB 10.39 kB
core.global.prod.js 31.11 kB 10.78 kB 9.67 kB
core.runtime.esm-browser.prod.js 23.77 kB 7.71 kB 6.90 kB
core.runtime.global.prod.js 18.08 kB 7.04 kB 6.32 kB
message-compiler.esm-browser.prod.js 19.29 kB 5.76 kB 5.14 kB
message-compiler.global.prod.js 17.32 kB 5.55 kB 4.98 kB
petite-vue-i18n-core.esm-browser.prod.js 20.67 kB 6.96 kB 6.26 kB
petite-vue-i18n-core.global.prod.js 15.63 kB 6.06 kB 5.51 kB
petite-vue-i18n.esm-browser.prod.js 36.98 kB 11.34 kB 10.17 kB
petite-vue-i18n.global.prod.js 29.84 kB 10.19 kB 9.20 kB
petite-vue-i18n.runtime.esm-browser.prod.js 22.55 kB 7.33 kB 6.63 kB
petite-vue-i18n.runtime.global.prod.js 16.83 kB 6.40 kB 5.80 kB
vue-i18n.esm-browser.prod.js 50.68 kB 15.15 kB 13.55 kB
vue-i18n.global.prod.js 40.54 kB 13.61 kB 12.25 kB
vue-i18n.runtime.esm-browser.prod.js 36.25 kB 11.15 kB 10.02 kB
vue-i18n.runtime.global.prod.js 27.53 kB 9.85 kB 8.89 kB

Usages

Name Size Gzip Brotli
packages/size-check-core (@intlify/core) 9.22 kB 3.82 kB 3.46 kB
packages/size-check-petite-vue-i18n (petite-vue-i18n) 77.63 kB 30.24 kB 27.28 kB
packages/size-check-vue-i18n (vue-i18n) 82.85 kB 31.74 kB 28.64 kB

Copy link

pkg-pr-new bot commented Jun 2, 2025

Open in StackBlitz

@intlify/core

npm i https://pkg.pr.new/@intlify/core@2196

@intlify/core-base

npm i https://pkg.pr.new/@intlify/core-base@2196

@intlify/devtools-types

npm i https://pkg.pr.new/@intlify/devtools-types@2196

@intlify/message-compiler

npm i https://pkg.pr.new/@intlify/message-compiler@2196

petite-vue-i18n

npm i https://pkg.pr.new/petite-vue-i18n@2196

@intlify/shared

npm i https://pkg.pr.new/@intlify/shared@2196

vue-i18n

npm i https://pkg.pr.new/vue-i18n@2196

@intlify/vue-i18n-core

npm i https://pkg.pr.new/@intlify/vue-i18n-core@2196

commit: abb7c17

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