Skip to content
pubscout

gettext

1.2.0, released 6 years ago by an unverified publisher

Platform agnostic gettext localization framework for Dart and Flutter

WASM-ready
$ flutter pub add gettext
Source repository

What it does

Provides a Dart implementation of the gettext localization framework, ported from node-gettext. It supports domains, contexts, and plurals with built-in plural forms for 136 languages, allowing you to change locale or domain on the fly.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to localize your Dart or Flutter application using standard gettext files (.json, .po, .mo).
  • You require dynamic locale and domain switching at runtime.
  • You need robust pluralization rules across many languages.

Skip it when

  • You prefer compile-time safe localization with code generation.
  • You rely entirely on the official Flutter intl package ecosystem.

Strengths

  • Supports domains, contexts, and plurals out of the box.
  • Ships with plural forms for 136 languages.
  • Platform agnostic implementation that also works with Flutter.

Weaknesses

  • Relies on manual translation loading and parsing rather than generated type-safe keys.
  • Requires external packages like gettext_parser to parse standard .po or .mo files.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import "package:gettext/gettext.dart";

final gt = new Gettext(onWarning: print);
gt.locale = "en_US";
gt.gettext("Hello");

Alternatives

Packages that do the same job and could replace gettext.

  • intl

    Standard localization library provided by the Dart team with built-in date, number, and message formatting.

  • slang

    Type-safe localization through code generation instead of dynamic runtime keys.

  • easy_localization

    Easy-to-use JSON/YAML localization for Flutter with built-in widget extensions.