Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Extract-i18nNew to Visual Studio Code? Get it now.
Extract-i18n

Extract-i18n

heruiwoniou

|
73 installs
| (0) | Free
extract the translation
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Extract i18n

Commitizen friendly

Extract characters, translate and generate i18n file

Usage

shift + command/ctrl + p to search command

Setting

Commands

content is selection content

Extract Text

Replace only the selected string (automatically includes the immediate quotation marks)

  • <div>Dashboard Title</div>
    • <div>t("extract-i18n.dashboardTitle")</div>
  • <div>"Dashboard Title"</div>
    • <div>t("extract-i18n.dashboardTitle")</div>
  • <div>'Dashboard Title'</div>
    • <div>t("extract-i18n.dashboardTitle)</div>

Extract Text With Auto Brace Wrapper

Replace the selected string (automatically includes the immediate quotation marks) and auto wrapper the {}

  • <div>Dashboard Title</div>
    • <div>{t("extract-i18n.dashboardTitle")}</div>
  • <div>{"Dashboard Title"}</div>
    • <div>{t("extract-i18n.dashboardTitle")}</div>
  • <div>"Dashboard Title"</div>
    • <div>{t("extract-i18n.dashboardTitle")}</div>
  • <div>'Dashboard Title'</div>
    • <div>{t("extract-i18n.dashboardTitle)}</div>
  • <div title="Dashboard Title" />
    • <div title={t("extract-i18n.dashboardTitle)} />

Extract Modify Prefix:

Modify the key prefix

This is default replace content:

t("extract-i18n.dashboardTitle)

Modify default value extract-i18n -> dashboards

The new replacement will look like this:

t("dashboards.dashboardTitle)

Extract Modify Target

The specified JSON file is generated in the nearest Locales directory,

eg: ["en","zh"] -> **/locales/en.json, **/locales/zh.json

Extract Modify langsMap

The target's value (zh) maybe is not a keyword for translate api, it should be zh-CN

Extract Modify Template

default value: t("{{key}}")

Extract Engine

default is use bing-translate-api you can choose use custom service eg: extract-i18n-service

Extract CustomUrl

if engine is custom, translate will through this api to get result request: fetch("${custom}?to=en&text=你好", { method: 'GET' }).then(response => response.text())

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft