# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, scoop, winget, zypper 安装 gettext

查看 gettext 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:gettext
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gettext
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gettext
```

  证据: MacPorts ports tree: devel/gettext/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add gettext
```

  证据: Alpine Linux edge package indexes: gettext from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install gettext
```

  证据: Debian stable package indexes: gettext from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install gettext
```

  证据: Fedora Rawhide package metadata: gettext from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#gettext
```

  证据: nixpkgs package indexes: gettext from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S gettext
```

  证据: Arch Linux sync databases: gettext from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz

- zypper (92%):

```sh
sudo zypper install gettext-runtime
```

  证据: openSUSE Tumbleweed package metadata: gettext-runtime from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/gettext
```

  证据: Scoop official bucket manifest trees: bucket/gettext.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id mlocati.GetText -e
```

  证据: Windows Package Manager source index: mlocati.GetText from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:gettext
- **软件包管理器:** Homebrew
- **版本:** 1.0
- **来源摘要:** GNU internationalization (i18n) and localization (l10n) library
- **主页:** <https://www.gnu.org/software/gettext/>
- **最后更新:** 2026-07-17T11:18:44-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- autopoint (别名)
- envsubst (别名)
- gettext (别名)
- gettext.sh (别名)
- gettextize (别名)
- msgattrib (别名)
- msgcat (别名)
- msgcmp (别名)
- msgcomm (别名)
- msgconv (别名)
- msgen (别名)
- msgexec (别名)
- msgfilter (别名)
- msgfmt (别名)
- msggrep (别名)
- msginit (别名)
- msgmerge (别名)
- msgpre (别名)
- msgunfmt (别名)
- msguniq (别名)
- ngettext (别名)
- po-fetch (别名)
- printf_gettext (别名)
- printf_ngettext (别名)
- recode-sr-latin (别名)
- spit (别名)
- xgettext (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.0
## 项目历史与用法

GNU gettext is the GNU internationalization and localization toolkit for message catalogs. It supplies runtime APIs, command-line tools, PO and MO file workflows, and maintainer and translator conventions used by many Unix-like software projects.

### 项目历史

GNU's own history traces the work to 1994 internationalization experiments around GNU fileutils and the `glocale` effort. Ulrich Drepper rewrote the approach in April 1995, and the package went through names such as `msgutils` and `nlsutils` before `gettext` was accepted as the GNU package name.

The first official GNU gettext release, numbered 0.7, appeared in July 1995 and included PO mode. In 1997, GNU libc 2.0 included the `gettext`, `textdomain`, and `bindtextdomain` functions; in 2000, plural-form handling via `ngettext` entered GNU libc, and Bruno Haible took over GNU gettext maintenance.

### 采用历史

gettext became central to GNU and Unix-like localization because it separates programming from translation: source strings are marked in code, `xgettext` extracts templates, translators edit PO files, `msgmerge` refreshes them across source changes, and `msgfmt` compiles machine-readable catalogs. Its workflow gave maintainers, translators, distributors, and users a shared file format and toolchain.

### 使用方式

Practitioners use gettext by marking translatable strings in program sources, initializing a text domain, extracting POT templates, maintaining language-specific PO files, compiling MO files, and installing catalogs under locale directories. Shell users and build systems also use utilities such as `gettext`, `ngettext`, `xgettext`, `msginit`, `msgmerge`, `msgfmt`, `msgattrib`, `msgcat`, and `envsubst`.

### 为什么软件包爱好者会关心

For package ecosystems, gettext is infrastructure rather than an optional convenience. Source distributions often carry POT and PO files, binary packages install compiled catalogs, and build recipes depend on tools such as `autopoint`, `gettextize`, `msgfmt`, and `xgettext` to keep translation workflows reproducible.

### 时间线

- 1994: GNU fileutils internationalization work led to broader GNU native-language-support experiments.
- 1995: Ulrich Drepper wrote GNU gettext and the first official release, 0.7, appeared in July.
- 1997: GNU libc 2.0 included gettext-related functions.
- 2000: `ngettext` plural-form handling entered GNU libc and Bruno Haible took over GNU gettext maintenance.
- 2001: GNU libc 2.2.x was released with full internationalization support according to the GNU gettext manual.

### Related projects

- GNU gettext is tied to GNU libc, the GNU Translation Project, PO mode, Autotools workflows, and localization tools that consume or convert PO files.

### 来源

- <https://git.savannah.gnu.org/cgit/gettext.git>
- <https://www.gnu.org/software/gettext/manual/gettext.html>
- <https://www.gnu.org/software/gettext/manual/html_node/Files.html>
- <https://www.gnu.org/software/gettext/manual/html_node/History.html>
- <https://www.gnu.org/software/gettext/manual/html_node/Introduction.html>
- <https://www.gnu.org/software/gettext/manual/html_node/Overview.html>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - autopoint - 0.23.1-2: normalized package name match | Debian stable package indexes: autopoint from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for setting up gettext infrastructure in a source package | https://www.gnu.org/software/gettext/
- Debian apt - gettext - 0.23.1-2: normalized package name match | Debian stable package indexes: gettext from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Internationalization utilities | https://www.gnu.org/software/gettext/
- Debian apt - gettext-base - 0.23.1-2: normalized package name match | Debian stable package indexes: gettext-base from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Internationalization utilities for the base system | https://www.gnu.org/software/gettext/
- Debian apt - gettext-doc - 0.23.1-2: normalized package name match | Debian stable package indexes: gettext-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation for GNU gettext | https://www.gnu.org/software/gettext/
- Debian apt - gettext-el - 0.23.1-2: normalized package name match | Debian stable package indexes: gettext-el from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Emacs mode for editing gettext .po files | https://www.gnu.org/software/gettext/
- Debian apt - libasprintf-dev - 0.23.1-2: normalized package name match | Debian stable package indexes: libasprintf-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | use fprintf and friends in C++ - static libraries and headers | https://www.gnu.org/software/gettext/
- Debian apt - libasprintf0v5 - 0.23.1-2: normalized package name match | Debian stable package indexes: libasprintf0v5 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | use fprintf and friends in C++ - shared library | https://www.gnu.org/software/gettext/
- Debian apt - libgettextpo-dev - 0.23.1-2: normalized package name match | Debian stable package indexes: libgettextpo-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | process PO files - static libraries and headers | https://www.gnu.org/software/gettext/
- Debian apt - libgettextpo0 - 0.23.1-2: normalized package name match | Debian stable package indexes: libgettextpo0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | process PO files - shared library | https://www.gnu.org/software/gettext/
- Nix - gettext: normalized package name match | nixpkgs package indexes: gettext from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - autopoint - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: autopoint from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | tool for setting up gettext infrastructure in a source package | https://www.gnu.org/software/gettext/
- Ubuntu apt - gettext - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: gettext from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNU Internationalization utilities | https://www.gnu.org/software/gettext/
- Ubuntu apt - gettext-base - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: gettext-base from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNU Internationalization utilities for the base system | https://www.gnu.org/software/gettext/
- Ubuntu apt - gettext-doc - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: gettext-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Documentation for GNU gettext | https://www.gnu.org/software/gettext/
- Ubuntu apt - gettext-el - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: gettext-el from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Emacs mode for editing gettext .po files | https://www.gnu.org/software/gettext/
- Ubuntu apt - libasprintf-dev - 0.21-14ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libasprintf-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | use fprintf and friends in C++ - static libraries and headers | https://www.gnu.org/software/gettext/


## Combined YAML source

View the package source record on GitHub. [combined/gettext.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gettext.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
