Skip to content

Catalogue 0.2.0: The module gets its own translations

Catalogue 0.2.0 gives the catalogue module its own translations instead of borrowing the host app’s, and translates the admin tab labels by the admin’s language.

Its own translations

All catalogue texts now go through the module’s own translation backend, PhoenixKitCatalogue.Gettext, instead of PhoenixKitWeb.Gettext. The admin tabs carry that backend, so their labels are translated when the page renders. The source tree has English, Russian and Estonian translation files with the tab labels, page titles, statuses, messages and other text.

The package published to Hex, though, lists only lib, guides and a few top-level files, so those translation files are not in it. A site that installs this version from Hex sees the catalogue texts in English.

Upgrading

No migration. Translated tab labels need PhoenixKit 1.7.107 or later. A host that reads a catalogue tab’s raw label should note that labels are now translated when shown.

Full release notes: Catalogue 0.2.0

0.2.0 · 11 May 2026

Added

  • Per-module gettext backend — PhoenixKitCatalogue.Gettext (lib/phoenix_kit_catalogue/gettext.ex). The module now owns its translations instead of borrowing PhoenixKitWeb.Gettext from the host app.
  • i18n-aware tab registration — all 19 %Tab{} structs in admin_tabs/0 carry gettext_backend: PhoenixKitCatalogue.Gettext and gettext_domain: "default". Tab labels are now translated at render-time via Tab.localized_label/1 (requires phoenix_kit >= 1.7.107).
  • Translation files — priv/gettext/{en,ru,et}/LC_MESSAGES/default.po with complete translations for tab labels, page titles, status strings, error messages, flash messages, and UI copy. Russian uses 3 plural forms per CLDR; Estonian uses 2.
  • Smoke test — test/gettext_test.exs verifies backend compilation, Russian/Estonian tab-label translation, fallback for tabs without a backend, and fallback to msgid for untranslated strings.

Changed

  • All Gettext.gettext(PhoenixKitWeb.Gettext, ...) and Gettext.ngettext(PhoenixKitWeb.Gettext, ...) calls replaced with PhoenixKitCatalogue.Gettext. Affects 18 files in lib/. This is a transparent change for end users — behaviour is identical as long as translations are kept in sync.
  • Version bumped 0.1.17 → 0.2.0 (minor: tab labels are now locale-dependent, which is a visible behaviour change for downstream callers relying on raw English strings from Tab.label).

Notes

  • {:phoenix_kit, "~> 1.7"} constraint kept as-is (core is at 1.7.107 locally). A bump to ~> 1.8 is gated on the core hex release; Tab.gettext_backend and Tab.localized_label/1 are already present at 1.7.107.

Catalogue 0.2.0. Install or update: {:phoenix_kit_catalogue, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.