i18n for Go
Przeczytaj po polsku
Manage go-i18n translations without leaving
VS Code: scan sources, merge and check catalogs from the sidebar, and edit
.po entries in a form instead of by hand.
Features
- Translations view — an activity bar view lists every language in the
module's
po/ directory with its translated, fuzzy and missing counts, and
the entries in each group.
- Entry editor — click an entry to see its msgid, context, translator
comment, source references (click to jump to the code) and format flags, and
to edit the translation, one field per plural form, or mark it fuzzy.
- Scan, merge, check — run
i18n scan, i18n merge and i18n check from
the view's toolbar or the Command Palette. Output goes to the i18n output
channel.
- Add language — create a new
po/<lang>.po and fill it from the template.
Requirements
The extension drives the i18n command-line tool from go-i18n, v0.4.0 or
later. Platform-specific builds of the extension bundle it, so no setup is
needed. On other platforms, install it with:
go install gitlab.com/zygoon/go-i18n/cmd/i18n@latest
To use a different binary, set i18n.binaryPath. Resolution order: that
setting, the bundled binary, then i18n on your PATH.
The extension activates in workspaces that contain a po/*.pot template.
Project layout
Like the CLI, the extension uses internal/l10n or l10n under the workspace
root, whichever exists, as the directory holding po/, and the workspace root
itself if neither does. Set i18n.root to use another directory; it is passed
to i18n as -C.
Commands
| Command |
What it does |
| i18n: Scan Sources |
Regenerate the .pot template from Go sources. |
| i18n: Merge Translations |
Update every .po file from the template. |
| i18n: Check Translations |
Report missing, fuzzy or inconsistent translations. |
| i18n: Add Language |
Create a .po file for a new language. |
| i18n: Refresh |
Reload the Translations view. |
Settings
| Setting |
Default |
Description |
i18n.binaryPath |
i18n |
Path to the i18n binary. |
i18n.root |
(empty) |
Directory holding po/; empty means auto-detect. |
License
Apache-2.0, see LICENSE.