i18n on the web - deepseek translations
This commit is contained in:
@@ -50,9 +50,9 @@ impl Selection {
|
||||
|
||||
/// What the heading calls the scope, so the global one is not shown by its
|
||||
/// sentinel name.
|
||||
pub(crate) fn scope_label(&self) -> String {
|
||||
pub(crate) fn scope_label(&self, locale: &crate::i18n::Locale) -> String {
|
||||
if self.is_global() {
|
||||
"Global — all profiles".to_string()
|
||||
crate::tr!(*locale, "td-global-label")
|
||||
} else {
|
||||
self.profile.clone()
|
||||
}
|
||||
@@ -115,24 +115,31 @@ pub(crate) struct DetailColumn {
|
||||
|
||||
impl DetailColumn {
|
||||
/// The badge list rendered under each column name.
|
||||
pub(crate) fn flags(&self) -> Vec<String> {
|
||||
pub(crate) fn flags(&self, locale: &crate::i18n::Locale) -> Vec<String> {
|
||||
let mut flags = Vec::new();
|
||||
if !self.currency.is_empty() {
|
||||
flags.push(self.currency.clone());
|
||||
}
|
||||
if self.rounded {
|
||||
flags.push("half-up".to_string());
|
||||
flags.push(crate::tr!(*locale, "column-flag-half-up"));
|
||||
}
|
||||
if self.quantity_ledger {
|
||||
flags.push("quantity ledger".to_string());
|
||||
flags.push(crate::tr!(
|
||||
*locale,
|
||||
"column-flag-quantity-ledger"
|
||||
));
|
||||
}
|
||||
if self.read_only {
|
||||
flags.push("read only".to_string());
|
||||
flags.push(crate::tr!(*locale, "column-flag-read-only"));
|
||||
}
|
||||
if !self.generated_from.is_empty() {
|
||||
flags.push(format!("generated from {}", self.generated_from));
|
||||
flags.push(crate::tr!(
|
||||
*locale,
|
||||
"column-flag-generated-from",
|
||||
"source" => self.generated_from.clone(),
|
||||
));
|
||||
} else if self.generated {
|
||||
flags.push("generated".to_string());
|
||||
flags.push(crate::tr!(*locale, "column-flag-generated"));
|
||||
}
|
||||
flags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user