🚚 Rename OptionTranslate to OptionTranslated

This commit is contained in:
Manuel Cillero 2023-10-21 21:31:18 +02:00
parent 03dbb39bbc
commit 03d538eb41
10 changed files with 27 additions and 27 deletions

View file

@ -31,7 +31,7 @@ pub struct Anchor {
classes : OptionClasses,
anchor_type: AnchorType,
href : OptionString,
html : OptionTranslate,
html : OptionTranslated,
left_icon : AnchorIcon,
right_icon : AnchorIcon,
target : AnchorTarget,
@ -188,7 +188,7 @@ impl Anchor {
&self.href
}
pub fn html(&self) -> &OptionTranslate {
pub fn html(&self) -> &OptionTranslated {
&self.html
}

View file

@ -11,7 +11,7 @@ pub struct Block {
renderable: Renderable,
id : OptionId,
classes : OptionClasses,
title : OptionTranslate,
title : OptionTranslated,
stuff : ArcComponents,
template : String,
}
@ -116,7 +116,7 @@ impl Block {
&self.classes
}
pub fn title(&self) -> &OptionTranslate {
pub fn title(&self) -> &OptionTranslated {
&self.title
}

View file

@ -9,7 +9,7 @@ pub struct Branding {
weight : Weight,
renderable: Renderable,
app_name : String,
slogan : OptionTranslate,
slogan : OptionTranslated,
logo : SiteLogo,
frontpage : FnContextualPath,
}
@ -21,7 +21,7 @@ impl Default for Branding {
weight : Weight::default(),
renderable: Renderable::default(),
app_name : config::SETTINGS.app.name.to_owned(),
slogan : OptionTranslate::default(),
slogan : OptionTranslated::default(),
logo : SiteLogo::default(),
frontpage : |_| "/",
}
@ -120,7 +120,7 @@ impl Branding {
&self.app_name
}
pub fn slogan(&self) -> &OptionTranslate {
pub fn slogan(&self) -> &OptionTranslated {
&self.slogan
}

View file

@ -18,7 +18,7 @@ pub struct Button {
classes : OptionClasses,
button_type: ButtonType,
name : OptionString,
value : OptionTranslate,
value : OptionTranslated,
autofocus : OptionString,
disabled : OptionString,
template : String,
@ -155,7 +155,7 @@ impl Button {
&self.name
}
pub fn value(&self) -> &OptionTranslate {
pub fn value(&self) -> &OptionTranslated {
&self.value
}

View file

@ -22,7 +22,7 @@ pub struct Input {
input_type : InputType,
name : OptionName,
value : OptionString,
label : OptionTranslate,
label : OptionTranslated,
size : Option<u16>,
minlength : Option<u16>,
maxlength : Option<u16>,
@ -32,7 +32,7 @@ pub struct Input {
disabled : OptionString,
readonly : OptionString,
required : OptionString,
help_text : OptionTranslate,
help_text : OptionTranslated,
template : String,
}
@ -293,7 +293,7 @@ impl Input {
&self.value
}
pub fn label(&self) -> &OptionTranslate {
pub fn label(&self) -> &OptionTranslated {
&self.label
}
@ -333,7 +333,7 @@ impl Input {
&self.required
}
pub fn help_text(&self) -> &OptionTranslate {
pub fn help_text(&self) -> &OptionTranslated {
&self.help_text
}

View file

@ -33,7 +33,7 @@ pub struct Heading {
id : OptionId,
classes : OptionClasses,
heading_type: HeadingType,
text : OptionTranslate,
text : OptionTranslated,
display : HeadingDisplay,
template : String,
}
@ -183,7 +183,7 @@ impl Heading {
&self.heading_type
}
pub fn text(&self) -> &OptionTranslate {
pub fn text(&self) -> &OptionTranslated {
&self.text
}

View file

@ -29,7 +29,7 @@ pub struct Item {
weight : Weight,
renderable : Renderable,
item_type : ItemType,
description: OptionTranslate,
description: OptionTranslated,
}
impl ComponentTrait for Item {
@ -172,7 +172,7 @@ impl Item {
&self.item_type
}
pub fn description(&self) -> &OptionTranslate {
pub fn description(&self) -> &OptionTranslated {
&self.description
}
}

View file

@ -12,7 +12,7 @@ pub struct Submenu {
weight : Weight,
renderable: Renderable,
id : OptionId,
title : OptionTranslate,
title : OptionTranslated,
items : Items,
}
@ -91,7 +91,7 @@ impl Submenu {
// Submenu GETTERS.
pub fn title(&self) -> &OptionTranslate {
pub fn title(&self) -> &OptionTranslated {
&self.title
}

View file

@ -22,8 +22,8 @@ pub use opt_name::OptionName;
mod opt_string;
pub use opt_string::OptionString;
mod opt_translate;
pub use opt_translate::OptionTranslate;
mod opt_translated;
pub use opt_translated::OptionTranslated;
mod opt_classes;
pub use opt_classes::{ClassesOp, OptionClasses};

View file

@ -3,18 +3,18 @@ use crate::html::{html, Markup};
use crate::locale::{L10n, LanguageIdentifier};
#[derive(Default)]
pub struct OptionTranslate(Option<L10n>);
pub struct OptionTranslated(Option<L10n>);
impl OptionTranslate {
impl OptionTranslated {
pub fn new() -> Self {
OptionTranslate::default()
OptionTranslated::default()
}
pub fn with(value: L10n) -> Self {
OptionTranslate(Some(value))
OptionTranslated(Some(value))
}
// OptionTranslate BUILDER.
// OptionTranslated BUILDER.
#[fn_builder]
pub fn alter_value(&mut self, value: L10n) -> &mut Self {
@ -22,7 +22,7 @@ impl OptionTranslate {
self
}
// OptionTranslate GETTERS.
// OptionTranslated GETTERS.
pub fn using(&self, langid: &LanguageIdentifier) -> Option<String> {
if let Some(value) = &self.0 {