Skip to content

Commit 2b628d1

Browse files
committed
update docs
1 parent eb122dc commit 2b628d1

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
//! cargo add yew-i18n
1717
//! ```
1818
//!
19-
//! To integrate the library into your Yew application, you can use the `YewI18nProvider` component.
19+
//! To integrate the library into your Yew application, you can use the `I18nProvider` component.
2020
//! Here's a simple example of how to use it:
2121
//!
2222
//! ```rust,no_run
2323
//! use yew::prelude::*;
24-
//! use yew_i18n::{YewI18nProvider, YewI18nProviderConfig, use_translation};
24+
//! use std::collections::HashMap;
25+
//! use yew_i18n::{I18nProvider, YewI18nProviderConfig, use_translation};
2526
//!
2627
//! // Your Yew component structure here...
2728
//!
@@ -32,12 +33,13 @@
3233
//! let translation = use_translation();
3334
//!
3435
//! html! {
35-
//! <YewI18nProvider
36+
//! <I18nProvider
3637
//! supported_languages={vec!["en", "fr"]}
3738
//! translations={HashMap::new()}
3839
//! >
40+
//! <div />
3941
//! // Your components that need translation here...
40-
//! </YewI18nProvider>
42+
//! </I18nProvider>
4143
//! }
4244
//! }
4345
//! ```
@@ -54,7 +56,8 @@
5456
//! for detailed configuration options.
5557
//!
5658
//! ```rust,no_run
57-
//! use yew_i18n::{YewI18nProviderConfig, YewI18n};
59+
//! use yew::prelude::*;
60+
//! use yew_i18n::{YewI18nProviderConfig, YewI18nConfig, YewI18n, I18nProvider};
5861
//! use std::collections::HashMap;
5962
//!
6063
//! let i18n_provider_config = YewI18nProviderConfig {
@@ -64,7 +67,7 @@
6467
//! };
6568
//!
6669
//! let i18n_provider_component = html! {
67-
//! <YewI18nProvider ..i18n_provider_config />
70+
//! <I18nProvider ..i18n_provider_config />
6871
//! };
6972
//!
7073
//! let supported_languages = vec!["en", "fr"];

0 commit comments

Comments
 (0)