translations fixed to be safe

This commit is contained in:
Priec
2026-08-15 12:44:36 +02:00
parent 6ef2694fef
commit 794efac594
26 changed files with 746 additions and 418 deletions

View File

@@ -443,14 +443,10 @@ impl ColumnDefinition {
options.push(crate::tr!(*locale, "builder-option-indexed"));
}
if !self.currency.is_empty() {
let mode = match self.money_mode {
MoneyMode::Exact => "exact",
MoneyMode::Rounded => "half-up",
};
options.push(format!(
"{}, {}",
self.currency,
crate::tr!(*locale, &format!("td-money-{mode}")),
self.money_mode.display_label(locale),
));
}
options.join(", ")
@@ -1162,6 +1158,7 @@ pub(crate) fn validate_identifier(
locale,
"error-identifier-too-long",
"label" => label,
"limit" => MAX_IDENTIFIER_LENGTH as i64,
));
}
if value
@@ -1238,7 +1235,13 @@ pub(crate) fn validate_table_name(
return Some(error);
}
if value.len() > MAX_TABLE_NAME_LENGTH {
return Some(crate::tr!(locale, "schema-err-table-name-too-long"));
// The limit is arithmetic, not a literal: it moves when a system column
// is added. The message reads it rather than restating it.
return Some(crate::tr!(
locale,
"schema-err-table-name-too-long",
"limit" => MAX_TABLE_NAME_LENGTH as i64,
));
}
if RESERVED_TABLE_NAMES.contains(&value) {
return Some(crate::tr!(