Update dependency gettext to v1 #104

Open
pv wants to merge 1 commit from renovate/gettext-1.x into master
Owner

This PR contains the following updates:

Package Type Update Change
gettext (source) prod major ~> 0.24 -> ~> 1.0

Release Notes

elixir-gettext/gettext (gettext)

v1.0.0

Compare Source

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! 🎉

v0.26.2

Compare Source

  • 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.

v0.26.1

Compare Source

  • Address backwards incompatible changes in previous release

v0.26.0

Compare Source

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.

Migration with Igniter

If your project is using igniter, you can run
mix igniter.update_gettext
to automatically migrate to the new API.

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.

v0.25.0

Compare Source

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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gettext](https://hex.pm/packages/gettext) ([source](https://github.com/elixir-gettext/gettext)) | prod | major | `~> 0.24` -> `~> 1.0` | --- ### Release Notes <details> <summary>elixir-gettext/gettext (gettext)</summary> ### [`v1.0.0`](https://github.com/elixir-gettext/gettext/blob/HEAD/CHANGELOG.md#v100) [Compare Source](https://github.com/elixir-gettext/gettext/compare/v0.26.2...v1.0.0) 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! 🎉 ### [`v0.26.2`](https://github.com/elixir-gettext/gettext/blob/HEAD/CHANGELOG.md#v0262) [Compare Source](https://github.com/elixir-gettext/gettext/compare/v0.26.1...v0.26.2) - 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. ### [`v0.26.1`](https://github.com/elixir-gettext/gettext/blob/HEAD/CHANGELOG.md#v0261) [Compare Source](https://github.com/elixir-gettext/gettext/compare/v0.26.0...v0.26.1) - Address backwards incompatible changes in previous release ### [`v0.26.0`](https://github.com/elixir-gettext/gettext/blob/HEAD/CHANGELOG.md#v0260) [Compare Source](https://github.com/elixir-gettext/gettext/compare/v0.25.0...v0.26.0) 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 `import`s 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 `import`ing 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: ```elixir 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 `import`s the Gettext backend. With this release, the above turns into: ```elixir 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](https://github.com/phoenixframework/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. ##### Migration with Igniter If your project is using [`igniter`](https://hex.pm/packages/igniter), you can run [`mix igniter.update_gettext`](https://hexdocs.pm/igniter/Mix.Tasks.Igniter.UpdateGettext.html) to automatically migrate to the new API. ##### 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. ### [`v0.25.0`](https://github.com/elixir-gettext/gettext/blob/HEAD/CHANGELOG.md#v0250) [Compare Source](https://github.com/elixir-gettext/gettext/compare/v0.24.0...v0.25.0) - Run merging for `mix gettext.extract`'s POT files even if they are unchanged. - Allow Expo 1.0+. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTMuMCIsInVwZGF0ZWRJblZlciI6IjQxLjExMy4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/gettext-1.x:renovate/gettext-1.x
git switch renovate/gettext-1.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff renovate/gettext-1.x
git switch renovate/gettext-1.x
git rebase master
git switch master
git merge --ff-only renovate/gettext-1.x
git switch renovate/gettext-1.x
git rebase master
git switch master
git merge --no-ff renovate/gettext-1.x
git switch master
git merge --squash renovate/gettext-1.x
git switch master
git merge --ff-only renovate/gettext-1.x
git switch master
git merge renovate/gettext-1.x
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: pv/sloan#104
No description provided.