Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Dart Chinese ExtractorNew to Visual Studio Code? Get it now.
Dart Chinese Extractor

Dart Chinese Extractor

Minessential

| (0) | Free
Extract Chinese strings from Flutter/Dart files, replace them with i18n accessors, and generate ARB files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dart Chinese Extractor

Extract Chinese strings from Flutter/Dart files, replace them with i18n accessors, and generate or update ARB files in one guided workflow.

Chinese version: README.zh-CN.md

Screenshots

Screenshots

Features

  • Adds a context menu command for *.dart files: Dart Chinese Extractor: Extract Chinese and Generate ARB
  • Parses Dart syntax with Web Tree-sitter to find string literals safely
  • Detects Chinese text in plain strings and interpolated strings such as $name or ${expr}
  • Shows a two-pane review panel with recognized strings on the left and key inputs on the right
  • Prefills keys when an existing ARB entry already contains the same message
  • Lets you clear all key inputs with confirmation
  • Validates key format before writing changes
  • Replaces source strings with accessors such as S.of(context).title
  • Generates method-style accessor calls for interpolated strings, such as S.of(context).hello(name)
  • Creates or updates ARB files, including @key.placeholders

Usage

  1. Open a Flutter project in VS Code.
  2. Open a *.dart file.
  3. Right-click in the editor and run Dart Chinese Extractor: Extract Chinese and Generate ARB.
  4. Review the detected Chinese strings on the left side of the panel.
  5. Enter one key per row on the right side.
  6. Click Next to replace the Dart source and update the ARB file.

Configuration

Add mine_chinese_extractor to the nearest Flutter package pubspec.yaml:

mine_chinese_extractor:
  accessor_prefix: S.of(context).
  arb_dir: lib/l10n
  arb_file_name: intl_zh.arb
  locale: zh

Options:

  • accessor_prefix: accessor prefix used in Dart replacements. Default: S.of(context).
  • arb_dir: ARB directory relative to the nearest pubspec.yaml. Default: lib/l10n
  • arb_file_name: ARB file name. Default: intl_zh.arb
  • locale: value written to @@locale when the ARB file does not already define one. Default: zh

In monorepos, the extension searches upward from the current Dart file and uses the nearest pubspec.yaml. If no mine_chinese_extractor section is found, it continues with the defaults.

Generated Output

For a string like:

Text('你好,$name')

the extension can generate an ARB entry like:

{
  "@@locale": "zh",
  "helloName": "你好,{name}",
  "@helloName": {
    "placeholders": {
      "name": {}
    }
  }
}

and replace the Dart code with:

Text(S.of(context).helloName(name))

Development

pnpm install
pnpm run build
pnpm run vsix
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft