Skip to content

Raw translation? #166

Answered by Baptistemontan
huuff asked this question in Q&A
Nov 25, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

{t!(i18n, payment_accept_terms, <a> = move |it| view!(<a href=t!(i18n, urls.terms_and_conditions)>{it}</a>))}

That does look awfull yes...

Nicest thing I can think of is

#[component]
fn TermsAndConditionsLink(children: Children) -> impl IntoView {
  let i18n = use_i18n();
  view! {
    <a href=t!(i18n, urls.terms_and_conditions)>
      {children}
    </a>
  }
}

t!(i18n, payment_accept_terms, <a> = <TermsAndConditionsLink />)

I'll think of a way to make that easier

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@huuff
Comment options

@Baptistemontan
Comment options

@huuff
Comment options

Answer selected by huuff
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants