Skip to content

Conversation

@depfu
Copy link
Contributor

@depfu depfu bot commented Oct 1, 2025

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ gettext (0.22.3 → 1.0.0) · Repo · Changelog

Release Notes

1.0.0 (from changelog)

This is the first 1.0 release of Gettext, a silly 10 years (and 6 months) after we started working on it. There are very few changes from the latest 0.26 release, and none of them are breaking.

Here are the new goodies:

  • Add support for concatenating sigils if all parts are known at compile time (such as "Hello " <> ~s(world)).
  • Significantly increase the timeout for mix gettext.extract to two minutes.
  • Add Gettext.put_locale!/1.

Happy 10+ years of Elixir translations everyone! 🎉

0.26.2 (from changelog)

  • Introduces warning if plural messages are defined with the same singular message and conflicting plural messages.
  • Improves performance by striping not required metadata when compiling the Gettext backend.

0.26.1 (from changelog)

  • Address backwards incompatible changes in previous release

0.26.0 (from changelog)

This release changes the way you use Gettext. We're not crazy: it does so because doing so makes it a lot faster to compile projects that use Gettext. The changes you have to make to your code are minimal, and the old behavior is deprecated so that you will be guided on how to update.

The reason for this change is that it removes compile-time dependencies from modules that used to import a Gettext backend. In applications such as Phoenix applications, where every view and controller imports the Gettext backend, this change means a lot less compilation when you make translation changes!

Here's the new API. Now, instead of defining a Gettext backend (use Gettext) and then importing that to use its macros, you need to:

  1. Define a Gettext backend with use Gettext.Backend
  2. Import and use its macros with use Gettext, backend: MyApp.Gettext.

Before and After

Before this release, code using Gettext used to look something like this:

defmodule MyApp.Gettext do
use Gettext, otp_app: :my_app
end

defmodule MyAppWeb.Controller do
import MyApp.Gettext
end

This creates a compile-time dependency for every module that imports the Gettext backend.

With this release, the above turns into:

defmodule MyApp.Gettext do
use Gettext.Backend, otp_app: :my_app
end

defmodule MyAppWeb.Controller do
use Gettext, backend: MyApp.Gettext
end

We are also updating Phoenix generators to use the new API.

If you update Gettext and still use use Gettext, otp_app: :my_app to define a backend, Gettext will emit a warning now.

Detailed Changelog

This is a detailed list of the new things introduced in this release:

  • Add Gettext.Macros, which contains all the macros you know and love (*gettext). It also contains *gettext_with_backend variants to explicitly pass a backend at compile time and keep extraction working.
  • Document lgettext/5 and lngettext/7 callbacks in Gettext.Backend. These get generated in every Gettext backend.
  • Add the Gettext.domain/0 type.

0.25.0 (from changelog)

  • Run merging for mix gettext.extract's POT files even if they are unchanged.
  • Allow Expo 1.0+.

0.24.0 (from changelog)

  • Handle singular and plural messages with the same msgid as the same message.

    This change produces a Expo.PO.DuplicateMessagesError if you already have messages with the same singular msgid. This can be solved by calling the expo.msguniq mix task on your .po file:

    mix expo.msguniq \
      priv/gettext/LOCALE/LC_MESSAGES/DOMAIN.po \
      --output-file priv/gettext/LOCALE/LC_MESSAGES/DOMAIN.po

0.23.1 (from changelog)

  • Use the Hex version of the excoveralls dependency.

0.23.0 (from changelog)

  • Add the :custom_flags_to_keep Gettext option.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 57 commits:

↗️ expo (indirect, 0.4.1 → 1.1.0) · Repo · Changelog

Release Notes

1.1.0

What's Changed

  • Add PO Parser Metadata Stripping

Full Changelog: v1.0.1...v1.1.0

1.0.1

What's Changed

  • Fix backslash escaping in Expo.PO.compose/1

Full Changelog: v1.0.0...v1.0.1

1.0.0

What's Changed

  • Fix compose output of extracted comments on plural messages

New Contributors

Full Changelog: v0.5.2...v1.0.0

0.5.2

What's Changed

  • Fix Elixir 1.16 deprecations

Full Changelog: v0.5.1...v0.5.2

0.5.1

What's Changed

  • Fix instruction commands for Expo.PO.DuplicateMessagesError.
  • Fix FunctionClauseError in msguniq Mix task.
  • Fix duplicated flags and comments for Expo.Message.merge/2.

Full Changelog: v0.5.0...v0.5.1

0.5.0

What's Changed

  • Add mix expo.msquniq Mix task.
  • Detect duplicates for messages and plural messages.
  • Fix the Expo.Message.msgctxt/0 type.
  • Add the Expo.Message.split_lines/0 type.
  • Add Expo.Message.merge/2, Expo.Message.Singular.merge/2, and Expo.Message.Plural.merge/2.
  • Add Expo.Message.Plural.key/1.

Full Changelog: v0.4.1...v0.5.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 35 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Oct 1, 2025
@depfu
Copy link
Contributor Author

depfu bot commented Nov 4, 2025

Closed in favor of #98.

@depfu depfu bot closed this Nov 4, 2025
@depfu depfu bot deleted the depfu/update/elixir/gettext-1.0.0 branch November 4, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant