You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,7 @@ These attributes can be applied to the struct itself.
116
116
-**`impl_vec_data_provider`** - If given, then [`TableDataProvider`] is automatically implemented for `Vec<ThisStruct>` to allow
117
117
for easy local data use. See the [simple example](https://github.com/synphonyte/leptos-struct-table/blob/master/examples/simple/src/main.rs) for more information.
118
118
-**`row_type`** - Specifies the type of the rows in the table. Defaults to the struct that this is applied to. See the [custom_type example](https://github.com/synphonyte/leptos-struct-table/blob/master/examples/custom_type/src/main.rs) for more information.
119
+
-**`i18n`** - Allows to specify the i18n scope for all fields of the struct as well as the `i18n` module path which defaults to `crate::i18n`. See [I18n](#i18n) for more information.
119
120
120
121
### Field attributes
121
122
@@ -133,6 +134,7 @@ These attributes can be applied to any field in the struct.
133
134
-**`format`** - Quick way to customize the formatting of cells without having to create a custom renderer. See [Formatting](#formatting) below for more information.
134
135
-**`getter`** - Specifies a method that returns the value of the field instead of accessing the field directly when rendering.
135
136
-**`none_value`** - Specifies a display value for `Option` types when they are `None`. Defaults to empty string
137
+
-**`i18n`** - Overrides the i18n key for the field. See [I18n](#i18n) for more information.
136
138
137
139
#### Formatting
138
140
@@ -343,10 +345,12 @@ Please have a look at the [pagination example](https://github.com/Synphonyte/lep
343
345
## I18n
344
346
345
347
To translate the column titles of the table using `leptos-i18n` you can enable the `"i18n"`
346
-
feature. The field names of the struct are used as keys.
348
+
feature. The field names of the struct are used as keys by default and can be customized using the `i18n` attribute.
Copy file name to clipboardExpand all lines: src/lib.rs
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,7 @@
107
107
//! - **`impl_vec_data_provider`** - If given, then [`TableDataProvider`] is automatically implemented for `Vec<ThisStruct>` to allow
108
108
//! for easy local data use. See the [simple example](https://github.com/synphonyte/leptos-struct-table/blob/master/examples/simple/src/main.rs) for more information.
109
109
//! - **`row_type`** - Specifies the type of the rows in the table. Defaults to the struct that this is applied to. See the [custom_type example](https://github.com/synphonyte/leptos-struct-table/blob/master/examples/custom_type/src/main.rs) for more information.
110
+
//! - **`i18n`** - Allows to specify the i18n scope for all fields of the struct as well as the `i18n` module path which defaults to `crate::i18n`. See [I18n](#i18n) for more information.
110
111
//!
111
112
//! ## Field attributes
112
113
//!
@@ -124,6 +125,7 @@
124
125
//! - **`format`** - Quick way to customize the formatting of cells without having to create a custom renderer. See [Formatting](#formatting) below for more information.
125
126
//! - **`getter`** - Specifies a method that returns the value of the field instead of accessing the field directly when rendering.
126
127
//! - **`none_value`** - Specifies a display value for `Option` types when they are `None`. Defaults to empty string
128
+
//! - **`i18n`** - Overrides the i18n key for the field. See [I18n](#i18n) for more information.
0 commit comments