Support gettext ~> 1.0 for Phoenix 1.8 compatibility
- Dominant language
- Elixir
- Stars
- 1.3k
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
Beacon's `mix.exs` specifies `{:gettext, "~> 0.26"}`, which prevents installation in Phoenix 1.8 projects that require `{:gettext, "~> 1.0"}`.
```
Because "your app" depends on "beacon ~> 0.5" which depends on "gettext ~> 0.26",
"gettext ~> 0.26" is required.
So, because "your app" depends on "gettext ~> 1.0", version solving failed.
```
The fix is trivial — Beacon's codebase already uses the gettext 1.0-compatible API everywhere:
- `lib/beacon/gettext.ex` uses `use Gettext.Backend, otp_app: :beacon`
- All consumers use `use Gettext, backend: Beacon.Gettext`
- `translate_error/1` calls `Gettext.dngettext/6` and `Gettext.dgettext/4` directly (not deprecated macros)
The only change needed is in `mix.exs`:
```diff
- {:gettext, "~> 0.26"},
+ {:gettext, "~> 0.26 or ~> 1.0"},
```
This maintains backward compatibility with gettext 0.26 while allowing gettext 1.0+.
**Steps to reproduce:**
1. `mix phx.new my_app` (Phoenix 1.8)
2. Add `{:beacon, "~> 0.5"}` to deps
3. `mix deps.get` → Hex resolution failure
**Environment:**
- Elixir 1.18+ / OTP 27
- Phoenix 1.8 (ships with `{:gettext, "~> 1.0"}`)
- Beacon 0.5.x and main branch
Contributor guide
Research direction
Open mix.exs and inspect the gettext dependency declaration. Update the constraint as specified, then run mix deps.get in a Phoenix 1.8 reproduction or compatible project to confirm dependency resolution succeeds while gettext 0.26 remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100