🚚 Rename OptionTranslate to OptionTranslated
This commit is contained in:
parent
03dbb39bbc
commit
03d538eb41
10 changed files with 27 additions and 27 deletions
|
|
@ -31,7 +31,7 @@ pub struct Anchor {
|
||||||
classes : OptionClasses,
|
classes : OptionClasses,
|
||||||
anchor_type: AnchorType,
|
anchor_type: AnchorType,
|
||||||
href : OptionString,
|
href : OptionString,
|
||||||
html : OptionTranslate,
|
html : OptionTranslated,
|
||||||
left_icon : AnchorIcon,
|
left_icon : AnchorIcon,
|
||||||
right_icon : AnchorIcon,
|
right_icon : AnchorIcon,
|
||||||
target : AnchorTarget,
|
target : AnchorTarget,
|
||||||
|
|
@ -188,7 +188,7 @@ impl Anchor {
|
||||||
&self.href
|
&self.href
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn html(&self) -> &OptionTranslate {
|
pub fn html(&self) -> &OptionTranslated {
|
||||||
&self.html
|
&self.html
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ pub struct Block {
|
||||||
renderable: Renderable,
|
renderable: Renderable,
|
||||||
id : OptionId,
|
id : OptionId,
|
||||||
classes : OptionClasses,
|
classes : OptionClasses,
|
||||||
title : OptionTranslate,
|
title : OptionTranslated,
|
||||||
stuff : ArcComponents,
|
stuff : ArcComponents,
|
||||||
template : String,
|
template : String,
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ impl Block {
|
||||||
&self.classes
|
&self.classes
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn title(&self) -> &OptionTranslate {
|
pub fn title(&self) -> &OptionTranslated {
|
||||||
&self.title
|
&self.title
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ pub struct Branding {
|
||||||
weight : Weight,
|
weight : Weight,
|
||||||
renderable: Renderable,
|
renderable: Renderable,
|
||||||
app_name : String,
|
app_name : String,
|
||||||
slogan : OptionTranslate,
|
slogan : OptionTranslated,
|
||||||
logo : SiteLogo,
|
logo : SiteLogo,
|
||||||
frontpage : FnContextualPath,
|
frontpage : FnContextualPath,
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ impl Default for Branding {
|
||||||
weight : Weight::default(),
|
weight : Weight::default(),
|
||||||
renderable: Renderable::default(),
|
renderable: Renderable::default(),
|
||||||
app_name : config::SETTINGS.app.name.to_owned(),
|
app_name : config::SETTINGS.app.name.to_owned(),
|
||||||
slogan : OptionTranslate::default(),
|
slogan : OptionTranslated::default(),
|
||||||
logo : SiteLogo::default(),
|
logo : SiteLogo::default(),
|
||||||
frontpage : |_| "/",
|
frontpage : |_| "/",
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@ impl Branding {
|
||||||
&self.app_name
|
&self.app_name
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn slogan(&self) -> &OptionTranslate {
|
pub fn slogan(&self) -> &OptionTranslated {
|
||||||
&self.slogan
|
&self.slogan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ pub struct Button {
|
||||||
classes : OptionClasses,
|
classes : OptionClasses,
|
||||||
button_type: ButtonType,
|
button_type: ButtonType,
|
||||||
name : OptionString,
|
name : OptionString,
|
||||||
value : OptionTranslate,
|
value : OptionTranslated,
|
||||||
autofocus : OptionString,
|
autofocus : OptionString,
|
||||||
disabled : OptionString,
|
disabled : OptionString,
|
||||||
template : String,
|
template : String,
|
||||||
|
|
@ -155,7 +155,7 @@ impl Button {
|
||||||
&self.name
|
&self.name
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn value(&self) -> &OptionTranslate {
|
pub fn value(&self) -> &OptionTranslated {
|
||||||
&self.value
|
&self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ pub struct Input {
|
||||||
input_type : InputType,
|
input_type : InputType,
|
||||||
name : OptionName,
|
name : OptionName,
|
||||||
value : OptionString,
|
value : OptionString,
|
||||||
label : OptionTranslate,
|
label : OptionTranslated,
|
||||||
size : Option<u16>,
|
size : Option<u16>,
|
||||||
minlength : Option<u16>,
|
minlength : Option<u16>,
|
||||||
maxlength : Option<u16>,
|
maxlength : Option<u16>,
|
||||||
|
|
@ -32,7 +32,7 @@ pub struct Input {
|
||||||
disabled : OptionString,
|
disabled : OptionString,
|
||||||
readonly : OptionString,
|
readonly : OptionString,
|
||||||
required : OptionString,
|
required : OptionString,
|
||||||
help_text : OptionTranslate,
|
help_text : OptionTranslated,
|
||||||
template : String,
|
template : String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,7 +293,7 @@ impl Input {
|
||||||
&self.value
|
&self.value
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn label(&self) -> &OptionTranslate {
|
pub fn label(&self) -> &OptionTranslated {
|
||||||
&self.label
|
&self.label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -333,7 +333,7 @@ impl Input {
|
||||||
&self.required
|
&self.required
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn help_text(&self) -> &OptionTranslate {
|
pub fn help_text(&self) -> &OptionTranslated {
|
||||||
&self.help_text
|
&self.help_text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ pub struct Heading {
|
||||||
id : OptionId,
|
id : OptionId,
|
||||||
classes : OptionClasses,
|
classes : OptionClasses,
|
||||||
heading_type: HeadingType,
|
heading_type: HeadingType,
|
||||||
text : OptionTranslate,
|
text : OptionTranslated,
|
||||||
display : HeadingDisplay,
|
display : HeadingDisplay,
|
||||||
template : String,
|
template : String,
|
||||||
}
|
}
|
||||||
|
|
@ -183,7 +183,7 @@ impl Heading {
|
||||||
&self.heading_type
|
&self.heading_type
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn text(&self) -> &OptionTranslate {
|
pub fn text(&self) -> &OptionTranslated {
|
||||||
&self.text
|
&self.text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ pub struct Item {
|
||||||
weight : Weight,
|
weight : Weight,
|
||||||
renderable : Renderable,
|
renderable : Renderable,
|
||||||
item_type : ItemType,
|
item_type : ItemType,
|
||||||
description: OptionTranslate,
|
description: OptionTranslated,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ComponentTrait for Item {
|
impl ComponentTrait for Item {
|
||||||
|
|
@ -172,7 +172,7 @@ impl Item {
|
||||||
&self.item_type
|
&self.item_type
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn description(&self) -> &OptionTranslate {
|
pub fn description(&self) -> &OptionTranslated {
|
||||||
&self.description
|
&self.description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ pub struct Submenu {
|
||||||
weight : Weight,
|
weight : Weight,
|
||||||
renderable: Renderable,
|
renderable: Renderable,
|
||||||
id : OptionId,
|
id : OptionId,
|
||||||
title : OptionTranslate,
|
title : OptionTranslated,
|
||||||
items : Items,
|
items : Items,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ impl Submenu {
|
||||||
|
|
||||||
// Submenu GETTERS.
|
// Submenu GETTERS.
|
||||||
|
|
||||||
pub fn title(&self) -> &OptionTranslate {
|
pub fn title(&self) -> &OptionTranslated {
|
||||||
&self.title
|
&self.title
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ pub use opt_name::OptionName;
|
||||||
mod opt_string;
|
mod opt_string;
|
||||||
pub use opt_string::OptionString;
|
pub use opt_string::OptionString;
|
||||||
|
|
||||||
mod opt_translate;
|
mod opt_translated;
|
||||||
pub use opt_translate::OptionTranslate;
|
pub use opt_translated::OptionTranslated;
|
||||||
|
|
||||||
mod opt_classes;
|
mod opt_classes;
|
||||||
pub use opt_classes::{ClassesOp, OptionClasses};
|
pub use opt_classes::{ClassesOp, OptionClasses};
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@ use crate::html::{html, Markup};
|
||||||
use crate::locale::{L10n, LanguageIdentifier};
|
use crate::locale::{L10n, LanguageIdentifier};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct OptionTranslate(Option<L10n>);
|
pub struct OptionTranslated(Option<L10n>);
|
||||||
|
|
||||||
impl OptionTranslate {
|
impl OptionTranslated {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
OptionTranslate::default()
|
OptionTranslated::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with(value: L10n) -> Self {
|
pub fn with(value: L10n) -> Self {
|
||||||
OptionTranslate(Some(value))
|
OptionTranslated(Some(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
// OptionTranslate BUILDER.
|
// OptionTranslated BUILDER.
|
||||||
|
|
||||||
#[fn_builder]
|
#[fn_builder]
|
||||||
pub fn alter_value(&mut self, value: L10n) -> &mut Self {
|
pub fn alter_value(&mut self, value: L10n) -> &mut Self {
|
||||||
|
|
@ -22,7 +22,7 @@ impl OptionTranslate {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
// OptionTranslate GETTERS.
|
// OptionTranslated GETTERS.
|
||||||
|
|
||||||
pub fn using(&self, langid: &LanguageIdentifier) -> Option<String> {
|
pub fn using(&self, langid: &LanguageIdentifier) -> Option<String> {
|
||||||
if let Some(value) = &self.0 {
|
if let Some(value) = &self.0 {
|
||||||
Loading…
Add table
Add a link
Reference in a new issue