GIMP Gettext Language Environment Variables

The GNU Image Manipulation Program (GIMP) relies on GNU gettext and GLib to handle interface localization and catalog management. The search paths and directories GIMP traverses to find translated .mo message catalog files are determined by a combination of standard GNU locale environment variables, path-redirection variables, and application-level data path overrides.

Locale and Language Selection Variables

GIMP uses standard GNU gettext priority rules to determine the language subdirectories searched within its locale folders. These variables define the language codes (e.g., en_US, de, ja) used in constructing the lookup path, which typically takes the form $DIR/<locale>/LC_MESSAGES/gimp*.mo:

  • LANGUAGE: Overrides all other locale variables specifically for message catalogs. It accepts a colon-separated list of language codes in order of preference (e.g., LANGUAGE="de:fr:en"). GIMP searches each path in this list sequentially until a matching translation file is resolved.
  • LC_ALL: Overrides all individual LC_* category settings. If LANGUAGE is unset, LC_ALL dictates the locale directory path used for GIMP message catalogs.
  • LC_MESSAGES: Controls UI message translation paths when LC_ALL and LANGUAGE are unset, allowing the user to change GIMP's language catalogs without altering regional conventions like numeric or date formatting.
  • LANG: Serves as the system-wide fallback variable. If none of the higher-priority variables are defined, gettext builds its search paths based on LANG.

Base Search Path Environment Variables

While the language code determines the terminal subdirectory, specific path-oriented environment variables dictate the base directory where gettext searches for these catalog files:

  • TEXTDOMAINDIR: The primary GNU gettext environment variable that overrides the base directory path set by bindtextdomain(). When set, gettext redirects searches for the application's domain files (such as gimp20.mo or gimp30.mo) to $TEXTDOMAINDIR/<locale>/LC_MESSAGES/.
  • LOCPATH: Used by the underlying C library (glibc) to redirect the search path for compiled locale definitions themselves. While not a direct message catalog variable, altering LOCPATH changes how gettext resolves non-standard locale definitions before locating language files.

GIMP-Specific Directory Variables

GIMP resolves its default locale catalog path relative to its runtime prefix or through data directory overrides:

  • GIMP2_DATADIR / GIMP3_DATADIR: Used to override the shared data prefix. GIMP dynamically constructs its locale directory at runtime by checking standard relative locations (such as <datadir>/locale). Overriding the core data directory shifts the base tree from which the application locates its bundled share/locale assets.