Skip to content

Commit

Permalink
Add translations field to I18n's Debug implementation (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja authored Oct 7, 2024
1 parent 2007093 commit afbda58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [Unreleased]

### Enhancements

- Add `translations` field to `I18n`'s `Debug` implementation.

## 2024-09-25 - [0.1.23]

### Enhancements
Expand Down Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions leptos-fluent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit afbda58

Please sign in to comment.