From b086ff1b5b5125ad4ea9668a39738dc3ccb93951 Mon Sep 17 00:00:00 2001 From: Darren Gegantino Date: Thu, 24 Oct 2024 18:20:52 +0800 Subject: [PATCH] Fix compilation error caused by `use Gettext` deprecation --- lib/gettext.ex | 2 +- lib/torch/i18n/backend.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gettext.ex b/lib/gettext.ex index 8b5d336c..257e818c 100644 --- a/lib/gettext.ex +++ b/lib/gettext.ex @@ -14,5 +14,5 @@ defmodule Torch.Gettext do dgettext("errors", "Here is the error message to translate") See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :torch + use Gettext.Backend, otp_app: :torch end diff --git a/lib/torch/i18n/backend.ex b/lib/torch/i18n/backend.ex index 30151c56..c08b4463 100644 --- a/lib/torch/i18n/backend.ex +++ b/lib/torch/i18n/backend.ex @@ -4,7 +4,7 @@ defmodule Torch.I18n.Backend do also be overridden to include custom translations. """ - import Torch.Gettext, only: [dgettext: 2] + use Gettext, backend: Torch.Gettext def message("Contains"), do: dgettext("default", "Contains") def message("Equals"), do: dgettext("default", "Equals")