From d70d9254e77977babb2f67b2ed4c70afdb6ef8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Mon, 7 Oct 2024 16:36:25 +0200 Subject: [PATCH] Add `translations` field to `I18n`'s `Debug` implementation --- CHANGELOG.md | 7 +++++++ leptos-fluent/src/lib.rs | 13 +------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b529924..ba4040ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## [Unreleased] + +### Enhancements + +- Add `translations` field to `I18n`'s `Debug` implementation. + ## 2024-09-25 - [0.1.23] ### Enhancements @@ -523,6 +529,7 @@ version to `0.1` during installation. - Added all ISO-639-1 and ISO-639-2 languages. +[Unreleased]: https://github.com/mondeja/leptos-fluent/compare/v0.1.23...master [0.1.23]: https://github.com/mondeja/leptos-fluent/compare/v0.1.22...v0.1.23 [0.1.22]: https://github.com/mondeja/leptos-fluent/compare/v0.1.21...v0.1.22 [0.1.21]: https://github.com/mondeja/leptos-fluent/compare/v0.1.20...v0.1.21 diff --git a/leptos-fluent/src/lib.rs b/leptos-fluent/src/lib.rs index c2b7741c..5e4f98c3 100644 --- a/leptos-fluent/src/lib.rs +++ b/leptos-fluent/src/lib.rs @@ -424,7 +424,7 @@ impl IntoAttribute for &&'static Language { /// Used to provide the current language, the available languages and all /// the translations. It is capable of doing what is needed to translate /// and manage translations in a whole application. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct I18n { /// Signal that holds the current language. pub language: RwSignal<&'static Language>, @@ -466,17 +466,6 @@ impl I18n { } } -impl core::fmt::Debug for I18n { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - let language = self.language; - with!(|language| f - .debug_struct("I18n") - .field("language", language) - .field("languages", &self.languages) - .finish()) - } -} - // get language #[cfg(feature = "nightly")] impl FnOnce<()> for I18n {