LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ngettext

handles plural forms in translations

TLDR

Translate with plural form
$ ngettext "[singular]" "[plural]" [count]
copy
Translate with domain
$ ngettext -d [domain] "[singular]" "[plural]" [count]
copy
Use specific locale
$ LANG=[de_DE] ngettext "[1 file]" "[%d files]" [5]
copy
Specify directory
$ ngettext -d [domain] -e "[singular]" "[plural]" [count]
copy

SYNOPSIS

ngettext [options] singular plural count

DESCRIPTION

ngettext handles plural forms in translations. It's part of GNU gettext.The tool selects correct plural form based on count. Language-specific plural rules.

PARAMETERS

SINGULAR

Singular form message.
PLURAL
Plural form message.
COUNT
Number for plural selection.
-d DOMAIN
Message domain.
-e
Enable escape sequences.
--help
Display help information.

INSTALL

sudo apt install gettext-base
copy
sudo dnf install gettext
copy
sudo pacman -S gettext
copy
sudo apk add gettext
copy
brew install gettext
copy
nix profile install nixpkgs#gettext
copy

CAVEATS

Part of gettext. Shell utility. Locale-dependent output.

HISTORY

ngettext is part of GNU gettext, providing plural form support for internationalized programs.

SEE ALSO

gettext(1), envsubst(1), msgfmt(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid