xgotext

command
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: BSD-3-Clause, MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

xgotext

CLI tool to extract translation strings from Go packages into .pot files.

Installation

go install github.com/leonelquinteros/gotext/cli/xgotext@latest

Usage

Usage of xgotext:
  -default string
        Name of default domain (default "default")
  -exclude string
        Comma separated list of directories to exclude (default ".git")
  -in string
        input dir: /path/to/go/pkg
  -out string
        output dir: /path/to/i18n/files
  -pkg-tree string
        main path: /path/to/go/pkg
  -v    print currently handled directory

Exactly one of -in and -pkg-tree is required; -out is always required.

Details

The tool scans Go source files for method calls that match the getter names from the gotext package (Get, GetN, GetD, GetND, GetC, GetNC, GetDC, GetNDC) and writes the corresponding translation templates (.pot files, one per domain) to the output directory.

  • -in recursively traverses sub-directories down from the given input directory.
  • -pkg-tree scans a Go package tree, including packages that import gotext.
  • -exclude skips comma-separated directory prefixes in -in mode (defaults to .git).
  • -v prints paths/packages while they are processed.

Contribute

Please see the project's Contributing Guidelines.

Full usage details, including supported string constants and variables, are documented in the xgotext guide.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
dir

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL