i18n on the web - deepseek translations

This commit is contained in:
Priec
2026-08-14 20:35:37 +02:00
parent 2dc0d94ba0
commit 8f1bfdbe0c
91 changed files with 4679 additions and 1237 deletions

View File

@@ -1,6 +1,7 @@
use askama::Template;
use crate::{
{i18n::Locale, tr},
schema::CURRENCY_CODES,
ui::{Alert, Nav, render},
};
@@ -24,6 +25,7 @@ struct AddTablePage<'a> {
#[derive(Template)]
#[template(path = "pages/add_table/builder.html")]
struct BuilderFragment<'a> {
nav: Nav,
page: &'a AddTablePageState,
column_types: Vec<String>,
temporal_types: Vec<String>,
@@ -45,6 +47,7 @@ pub(crate) fn render_page(page: &AddTablePageState) -> String {
pub(crate) fn render_builder(page: &AddTablePageState) -> String {
render(&BuilderFragment {
nav: page.nav.clone(),
page,
column_types: page.draft.columns.offered_types(),
temporal_types: page.draft.columns.temporal_types(),
@@ -55,8 +58,12 @@ pub(crate) fn render_builder(page: &AddTablePageState) -> String {
/// Used when the page itself cannot be loaded (auth or backend failure).
/// There is no draft left to render, so this replaces the builder — the dialog
/// is what tells the user why the form just emptied.
pub(crate) fn render_submission_error(message: &str) -> String {
render(&Alert::error("Could not create the table", message))
pub(crate) fn render_submission_error(locale: Locale, message: &str) -> String {
render(&Alert::error(
locale,
&tr!(locale, "builder-err-title"),
message,
))
}
#[cfg(test)]