main.js.
Prerequisites
- Obsidian i18n is installed and enabled
- the target plugin is installed in the current vault
- the target plugin directory contains
main.js - if you want AI translation, at least one provider profile is configured
End-to-end flow
1
Open the Manager
Click the globe icon, or run the command that opens the i18n panel.
2
Find the target plugin
Use the 插件 tab and locate the installed plugin by name or ID.
3
Run Extract
Click Extract. The plugin reads
main.js and generates a local translation source with AST and Regex sections.4
Inspect AST and Regex rows
AST rows carry node type and variable-name context. Regex rows come from Regex matches against source text.
5
Open the AI panel
Use the AST or Regex AI panel.
6
Set language, batch size, concurrency, and timeout
These panels write back to
language, llmBatchSize, llmConcurrencyLimit, and llmTimeout. Defaults are zh-cn, 10, 3, and 60000.7
Translate
By default, only rows whose
target is empty, whitespace-only, or equal to source are sent. Existing translated rows are resent only when overwrite is enabled.8
Review the output
Check placeholders such as
${variable} and escape sequences such as \n before applying.9
Apply
Click Apply. If the result is wrong, click Restore before applying again.