Fixed multi component i18n strings and added serverside impressum
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_sdk::{i18n::use_i18, translate};
|
||||
|
||||
use crate::components::{UnderConstruction, H1, HR};
|
||||
use crate::components::{Bolding, UnderConstruction, H1, HR};
|
||||
|
||||
#[component]
|
||||
pub fn PublicationsProjects() -> Element {
|
||||
@@ -60,7 +60,7 @@ fn Publications() -> Element {
|
||||
}
|
||||
}
|
||||
fn Publication(prop: PublicationProp) -> Element {
|
||||
let pattern = "T.-D. Tran";
|
||||
let pattern = vec!["T.-D. Tran".to_string(), "Tuan-Dat Tran".to_string()];
|
||||
rsx! {
|
||||
Link {
|
||||
class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700",
|
||||
@@ -73,9 +73,9 @@ fn Publication(prop: PublicationProp) -> Element {
|
||||
span { class: "text-lg text-gray-900 dark:text-white", "{prop.conference}" },
|
||||
p {
|
||||
class:"font-normal text-gray-700 dark:text-gray-400 italic",
|
||||
Authors {
|
||||
Bolding {
|
||||
authors: "{prop.authors}",
|
||||
pattern: "{pattern}",
|
||||
patterns: pattern,
|
||||
},
|
||||
}
|
||||
p {
|
||||
@@ -129,7 +129,7 @@ struct ProjectProp {
|
||||
}
|
||||
|
||||
fn Project(prop: ProjectProp) -> Element {
|
||||
let pattern = "T.-D. Tran";
|
||||
let pattern = vec!["T.-D. Tran".to_string(), "Tuan-Dat Tran".to_string()];
|
||||
|
||||
rsx! {
|
||||
Link {
|
||||
@@ -143,9 +143,9 @@ fn Project(prop: ProjectProp) -> Element {
|
||||
p { class: "text-lg text-gray-900 dark:text-white", "{prop.kind}" },
|
||||
p {
|
||||
class:"font-normal text-gray-700 dark:text-gray-400",
|
||||
Authors {
|
||||
Bolding {
|
||||
authors: "{prop.authors}",
|
||||
pattern: "{pattern}",
|
||||
patterns: pattern,
|
||||
},
|
||||
}
|
||||
p {
|
||||
@@ -155,23 +155,3 @@ fn Project(prop: ProjectProp) -> Element {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Props)]
|
||||
struct AuthorProp {
|
||||
authors: String,
|
||||
pattern: String,
|
||||
}
|
||||
|
||||
fn Authors(prop: AuthorProp) -> Element {
|
||||
if let Some(start) = prop.authors.find(&prop.pattern) {
|
||||
let end = start + prop.pattern.len();
|
||||
let left = &prop.authors[..start];
|
||||
let middle = &prop.authors[start..end];
|
||||
let right = &prop.authors[end..];
|
||||
rsx! {
|
||||
"{left}" , b { "{middle}" }, "{right}",
|
||||
}
|
||||
} else {
|
||||
rsx! { "{prop.authors}" }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user