mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 20:01:07 +01:00
Merge pull request #8890 from dotCooCoo/fix/banner-hem-and-grommet-messages-and-saving
i18n: banner hem and grommet errors and the recovery failure line have rows in every complete catalog
This commit is contained in:
12 files changed
+296
-7
No files matched your search
@@ -9068,3 +9068,15 @@ file-filter Applications Приложения
|
||||
@msg image {_1} cannot be distorted this way: its corners would not make a convex shape изображението {_1} не може да се изкриви така: ъглите му не биха образували изпъкнала форма
|
||||
@msg image {_1} cannot be distorted this way: its corners would cross the warp's horizon изображението {_1} не може да се изкриви така: ъглите му биха пресекли хоризонта на деформацията
|
||||
@msg image {_1} cannot be distorted this way: its corners would be too close together for a perspective map изображението {_1} не може да се изкриви така: ъглите му биха били твърде близо един до друг за перспективно преобразуване
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` трябва да е повече от 0 и най-много {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` трябва да е от 0 до {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` трябва да е от 0,01 до 1000 pt
|
||||
@msg select the banner, or mark every artboard изберете банера или маркирайте всички работни области
|
||||
@msg the banner has no width or height банерът няма ширина или височина
|
||||
@msg the grommet inset is too large for the banner отстъпът на капсите е твърде голям за банера
|
||||
@msg the hem is too deep for the banner подгъвът е твърде дълбок за банера
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets разстоянието дава повече от {MAX_GROMMETS} капси
|
||||
@msg there is no banner to mark няма банер за маркиране
|
||||
@msg turn on at least one side включете поне една страна
|
||||
@msg with no hem and no grommets there is nothing to mark без подгъв и без капси няма нищо за маркиране
|
||||
@msg {saving} failed: {e} {saving} неуспешно: {e}
|
||||
|
Can't render this file because it is too large.
|
@@ -8836,6 +8836,18 @@ breakText Glyphs Glifs
|
||||
Margin Marge
|
||||
Box Caixa
|
||||
Swatch Mostra
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` ha de ser més gran que 0 i com a màxim {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` ha d’estar entre 0 i {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` ha d’estar entre 0,01 i 1000 pt
|
||||
@msg select the banner, or mark every artboard seleccioneu la pancarta o marqueu tots els taulers
|
||||
@msg the banner has no width or height la pancarta no té amplada ni alçada
|
||||
@msg the grommet inset is too large for the banner la distància dels ullets a la vora és massa gran per a la pancarta
|
||||
@msg the hem is too deep for the banner la vora és massa profunda per a la pancarta
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets l’espaiat genera més de {MAX_GROMMETS} ullets
|
||||
@msg there is no banner to mark no hi ha cap pancarta per marcar
|
||||
@msg turn on at least one side activeu almenys un costat
|
||||
@msg with no hem and no grommets there is nothing to mark sense vora ni ullets no hi ha res per marcar
|
||||
@msg {saving} failed: {e} {saving} ha fallat: {e}
|
||||
Banner Hems and Grommets… Vores i ullets de pancarta…
|
||||
Banner Hems and Grommets Vores i ullets de pancarta
|
||||
Hem Vora
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10841,6 +10841,7 @@ breakText Glyphs Glyffer
|
||||
Box Ramme
|
||||
Swatch Farveprøve
|
||||
Direction Retning
|
||||
@msg {saving} failed: {e} {saving} mislykkedes: {e}
|
||||
Banner Hems and Grommets… Bannersømme og maljer…
|
||||
Banner Hems and Grommets Bannersømme og maljer
|
||||
Hem Søm
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8808,6 +8808,18 @@ breakText Glyphs Γλύφοι
|
||||
Margin Περιθώριο
|
||||
Box Πλαίσιο
|
||||
Swatch Δείγμα χρώματος
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt το `spacing` πρέπει να είναι μεγαλύτερο από 0 και το πολύ {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt το `{key}` πρέπει να είναι από 0 έως {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt το `{key}` πρέπει να είναι από 0,01 έως 1000 pt
|
||||
@msg select the banner, or mark every artboard επιλέξτε το πανό ή σημειώστε όλους τους πίνακες σχεδίασης
|
||||
@msg the banner has no width or height το πανό δεν έχει πλάτος ή ύψος
|
||||
@msg the grommet inset is too large for the banner η απόσταση των τρουκς από την άκρη είναι πολύ μεγάλη για το πανό
|
||||
@msg the hem is too deep for the banner το στρίφωμα είναι πολύ βαθύ για το πανό
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets το διάστημα δημιουργεί περισσότερα από {MAX_GROMMETS} τρουκς
|
||||
@msg there is no banner to mark δεν υπάρχει πανό για σήμανση
|
||||
@msg turn on at least one side ενεργοποιήστε τουλάχιστον μία πλευρά
|
||||
@msg with no hem and no grommets there is nothing to mark χωρίς στρίφωμα και χωρίς τρουκς δεν υπάρχει τίποτα για σήμανση
|
||||
@msg {saving} failed: {e} {saving}: απέτυχε: {e}
|
||||
Banner Hems and Grommets… Στριφώματα και τρουκς πανό…
|
||||
Banner Hems and Grommets Στριφώματα και τρουκς πανό
|
||||
Hem Στρίφωμα
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8911,6 +8911,16 @@ breakText Glyphs Glifos
|
||||
Margin Margen
|
||||
Box Caja
|
||||
Swatch Muestra
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` debe estar entre 0,01 y 1000 pt
|
||||
@msg select the banner, or mark every artboard seleccione la pancarta o marque todas las mesas de trabajo
|
||||
@msg the banner has no width or height la pancarta no tiene anchura ni altura
|
||||
@msg the grommet inset is too large for the banner la distancia de los ojales al borde es demasiado grande para la pancarta
|
||||
@msg the hem is too deep for the banner el dobladillo es demasiado profundo para la pancarta
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets el espaciado genera más de {MAX_GROMMETS} ojales
|
||||
@msg there is no banner to mark no hay ninguna pancarta que marcar
|
||||
@msg turn on at least one side active al menos un lado
|
||||
@msg with no hem and no grommets there is nothing to mark sin dobladillo ni ojales no hay nada que marcar
|
||||
@msg {saving} failed: {e} {saving} falló: {e}
|
||||
@msg 'caller', 'callee' and 'arguments' cannot be used on strict mode functions 'caller', 'callee' y 'arguments' no se pueden usar en funciones en modo estricto
|
||||
@msg Boolean.prototype.{name} was called on a value that is not a Boolean Se llamó a Boolean.prototype.{name} con un valor que no es un Boolean
|
||||
@msg CMYK images whose samples couldn't be read in CMYK were imported in RGB Las imágenes CMYK cuyas muestras no se pudieron leer en CMYK se importaron en RGB
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8889,6 +8889,18 @@ breakText Glyphs Merkit
|
||||
Margin Marginaali
|
||||
Box Kehys
|
||||
Swatch Värimalli
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing`-arvon on oltava yli 0 ja enintään {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}`-arvon on oltava väliltä 0–{MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}`-arvon on oltava väliltä 0,01–1000 pt
|
||||
@msg select the banner, or mark every artboard valitse banneri tai merkitse kaikki piirtoalustat
|
||||
@msg the banner has no width or height bannerilla ei ole leveyttä eikä korkeutta
|
||||
@msg the grommet inset is too large for the banner purjerenkaiden etäisyys reunasta on liian suuri bannerille
|
||||
@msg the hem is too deep for the banner päärme on liian syvä bannerille
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets välistyksellä tulisi yli {MAX_GROMMETS} purjerengasta
|
||||
@msg there is no banner to mark merkittävää banneria ei ole
|
||||
@msg turn on at least one side ota käyttöön vähintään yksi sivu
|
||||
@msg with no hem and no grommets there is nothing to mark ilman päärmettä ja purjerenkaita ei ole mitään merkittävää
|
||||
@msg {saving} failed: {e} {saving} epäonnistui: {e}
|
||||
Banner Hems and Grommets… Bannerin päärmeet ja purjerenkaat…
|
||||
Banner Hems and Grommets Bannerin päärmeet ja purjerenkaat
|
||||
Hem Päärme
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10617,6 +10617,16 @@ breakText Glyphs Glyphes
|
||||
@msg the paths are too many or too tangled to find where they cross les tracés sont trop nombreux ou trop enchevêtrés pour trouver où ils se croisent
|
||||
@msg the rectangle or line reaches too many paths to check le rectangle ou la ligne atteint trop de tracés pour être vérifié
|
||||
@msg {name} must be a number {name} doit être un nombre
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` doit être compris entre 0,01 et 1000 pt
|
||||
@msg select the banner, or mark every artboard sélectionnez la banderole ou marquez tous les plans de travail
|
||||
@msg the banner has no width or height la banderole n’a ni largeur ni hauteur
|
||||
@msg the grommet inset is too large for the banner la distance des œillets au bord est trop grande pour la banderole
|
||||
@msg the hem is too deep for the banner l’ourlet est trop profond pour la banderole
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets l’espacement produit plus de {MAX_GROMMETS} œillets
|
||||
@msg there is no banner to mark il n’y a aucune banderole à marquer
|
||||
@msg turn on at least one side activez au moins un côté
|
||||
@msg with no hem and no grommets there is nothing to mark sans ourlet ni œillets, il n’y a rien à marquer
|
||||
@msg {saving} failed: {e} {saving} : échec : {e}
|
||||
Banner Hems and Grommets… Ourlets et œillets de banderole…
|
||||
Banner Hems and Grommets Ourlets et œillets de banderole
|
||||
Hem Ourlet
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10235,6 +10235,18 @@ theme Appearance अपीयरेंस
|
||||
Margin मार्जिन
|
||||
Box बॉक्स
|
||||
Swatch स्वॉच
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` 0 से अधिक और अधिकतम {MAX_DISTANCE} pt होना चाहिए
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` 0 से {MAX_DISTANCE} pt तक होना चाहिए
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` 0.01 से 1000 pt तक होना चाहिए
|
||||
@msg select the banner, or mark every artboard बैनर चुनें, या हर आर्टबोर्ड को मार्क करें
|
||||
@msg the banner has no width or height बैनर की कोई चौड़ाई या ऊँचाई नहीं है
|
||||
@msg the grommet inset is too large for the banner बैनर के लिए किनारे से आईलेट की दूरी बहुत अधिक है
|
||||
@msg the hem is too deep for the banner बैनर के लिए हेम बहुत गहरा है
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets इस स्पेसिंग से {MAX_GROMMETS} से अधिक आईलेट बनते हैं
|
||||
@msg there is no banner to mark मार्क करने के लिए कोई बैनर नहीं है
|
||||
@msg turn on at least one side कम से कम एक साइड चालू करें
|
||||
@msg with no hem and no grommets there is nothing to mark बिना हेम और बिना आईलेट के मार्क करने के लिए कुछ नहीं है
|
||||
@msg {saving} failed: {e} {saving} विफल: {e}
|
||||
Banner Hems and Grommets… बैनर हेम और आईलेट…
|
||||
Banner Hems and Grommets बैनर हेम और आईलेट
|
||||
Hem हेम
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8611,6 +8611,18 @@ breakText Glyphs Glif
|
||||
Box Kotak
|
||||
Swatch Sampel warna
|
||||
Direction Arah
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` harus lebih dari 0 dan paling besar {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` harus dari 0 sampai {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` harus dari 0,01 sampai 1000 pt
|
||||
@msg select the banner, or mark every artboard seleksi spanduk, atau tandai setiap artboard
|
||||
@msg the banner has no width or height spanduk tidak memiliki lebar atau tinggi
|
||||
@msg the grommet inset is too large for the banner jarak mata ayam dari tepi terlalu besar untuk spanduk
|
||||
@msg the hem is too deep for the banner lipatan terlalu dalam untuk spanduk
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets spasi ini menghasilkan lebih dari {MAX_GROMMETS} mata ayam
|
||||
@msg there is no banner to mark tidak ada spanduk untuk ditandai
|
||||
@msg turn on at least one side aktifkan setidaknya satu sisi
|
||||
@msg with no hem and no grommets there is nothing to mark tanpa lipatan dan tanpa mata ayam tidak ada yang perlu ditandai
|
||||
@msg {saving} failed: {e} {saving} gagal: {e}
|
||||
Banner Hems and Grommets… Lipatan dan Mata Ayam Spanduk…
|
||||
Banner Hems and Grommets Lipatan dan Mata Ayam Spanduk
|
||||
Hem Lipatan
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1148,6 +1148,26 @@ fn untranslated_report_checks_every_message_crate_and_schema_phrase() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Banner Hems and Grommets' errors and the status of a recovery copy that failed without a folder
|
||||
/// to name have an `@msg` row in every complete-message catalog.
|
||||
#[test]
|
||||
fn banner_and_recovery_messages_are_translated_in_every_complete_catalog() {
|
||||
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../engine/src/cmd/addons/cutting/banner.rs");
|
||||
let code = std::fs::read_to_string(&path).unwrap_or_default();
|
||||
let mut messages = source_messages(without_test_module(&code), &[("bad(", 1)], &std::collections::BTreeMap::new());
|
||||
assert!(messages.len() >= 11, "scan found only {} banner messages: {messages:?}", messages.len());
|
||||
let recovery = "{saving} failed: {e}";
|
||||
assert!(message_literals_in(&["ui-egui"]).contains(recovery), "the scan skips {recovery:?}");
|
||||
messages.push(recovery.to_string());
|
||||
let catalog = shared();
|
||||
let mut missing = vec![];
|
||||
for code in COMPLETE_MESSAGES {
|
||||
let lang = lang(code);
|
||||
missing.extend(messages.iter().filter(|m| catalog.get(lang, "@msg", m).is_none()).map(|m| format!("{code}: {m}")));
|
||||
}
|
||||
assert!(missing.is_empty(), "{} banner and recovery messages have no @msg row:\n{}", missing.len(), missing.join("\n"));
|
||||
}
|
||||
|
||||
/// The names [`MENU_KEEP_AS_IS`] lists are menu labels, and no catalog that keeps them in English
|
||||
/// translates them.
|
||||
#[test]
|
||||
@@ -1580,6 +1600,82 @@ fn unreadable(e: impl std::fmt::Display) -> String {
|
||||
assert!(message_literals_in(&["engine"]).contains("Data Recovery can't keep copies in {path}: {e}"));
|
||||
}
|
||||
|
||||
/// The scan reads the values of a local that a `.status(name)` shows, from the nearest `let` of
|
||||
/// that name in the same function whose block is still open at the call: a `format!` string and
|
||||
/// each arm of a `match`, a `'"'` arm included. It reads a local whose string holds `fn `. It
|
||||
/// skips a local that no status shows, a `let` of the name in another function or in a block that
|
||||
/// ended before the call, and a status given a value.
|
||||
#[test]
|
||||
fn message_scan_reads_locals_given_to_a_status() {
|
||||
let code = r#"
|
||||
fn other() {
|
||||
let line = format!("the other function's line: {e}");
|
||||
log(line);
|
||||
}
|
||||
|
||||
fn saved(app: &mut App, saving: &str, e: &str, place: Option<&str>) {
|
||||
let unused = format!("a line no status shows: {e}");
|
||||
let line = format!("{saving} failed: {e}");
|
||||
app.status(line);
|
||||
let line = match place {
|
||||
Some(folder) => format!("Couldn't save to {folder}: {e}"),
|
||||
None => "Couldn't save".to_string(),
|
||||
};
|
||||
log(&line);
|
||||
app.status(line);
|
||||
app.status(true);
|
||||
}
|
||||
|
||||
fn scoped(app: &mut App) {
|
||||
let note = "Outer message";
|
||||
{
|
||||
let note = "Inner message";
|
||||
log(note);
|
||||
}
|
||||
app.status(note);
|
||||
}
|
||||
|
||||
fn braced(app: &mut App) {
|
||||
let tip = "Kept open";
|
||||
log("}", '}', '\'', '\\');
|
||||
// }
|
||||
app.status(tip);
|
||||
}
|
||||
|
||||
fn named(app: &mut App) {
|
||||
let line = "Invalid fn declaration";
|
||||
app.status(line);
|
||||
}
|
||||
|
||||
fn quoted(app: &mut App, quote: char) {
|
||||
let line = match quote {
|
||||
'"' => "Double quote",
|
||||
_ => "Other quote",
|
||||
};
|
||||
app.status(line);
|
||||
}
|
||||
"#;
|
||||
let want = [
|
||||
"{saving} failed: {e}",
|
||||
"Couldn't save to {folder}: {e}",
|
||||
"Couldn't save",
|
||||
"Outer message",
|
||||
"Kept open",
|
||||
"Invalid fn declaration",
|
||||
"Double quote",
|
||||
"Other quote",
|
||||
];
|
||||
assert_eq!(source_messages(code, &[], &std::collections::BTreeMap::new()), want);
|
||||
let ui = message_literals_in(&["ui-egui"]);
|
||||
for m in [
|
||||
"{saving} failed: {e}",
|
||||
"Couldn't save recovery data for {title}: {e}. Copies go to {folder}, the folder set in Preferences; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder)",
|
||||
"Couldn't save recovery data for {title}: {e}. Copies go to {folder}, the default recovery folder; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder)",
|
||||
] {
|
||||
assert!(ui.contains(m), "the scan skips {m:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The scan stops at a test module whose `cfg` is `test` or `all(test, …)`, and reads on past a
|
||||
/// declaration of a test file and a module that is not only for tests.
|
||||
#[test]
|
||||
@@ -1870,6 +1966,7 @@ fn named_const<'a>(rest: &str, consts: &'a std::collections::BTreeMap<String, Ve
|
||||
/// [`LATER_MESSAGE_VARIANTS`] gives; not [`NAME_VARIANTS`]),
|
||||
/// the messages a `.map_err` closure returns (`.map_err(|e| format!("…: {e}"))`, see
|
||||
/// [`closure_returns`]) or the handler a `.map_err(name)` names returns (see [`handler_returns`]),
|
||||
/// the values of a local that a `.status(name)` shows (see [`status_locals`]),
|
||||
/// and the message argument of each call in `helpers` (a call and the number of arguments before
|
||||
/// its message), a literal, a `format!` string or the name of one of `consts` (see
|
||||
/// [`str_consts`]), each one with or without a `&` before it. A key's name alone (`` `tint` ``)
|
||||
@@ -1901,6 +1998,7 @@ fn source_messages(code: &str, helpers: &[(&str, usize)], consts: &std::collecti
|
||||
}
|
||||
}
|
||||
let in_handlers = handlers.into_iter().flat_map(|name| handler_returns(code, name));
|
||||
let in_status_locals = status_locals(code).into_iter().map(|rest| (rest, false));
|
||||
let in_helpers = helpers.iter().flat_map(|&(call, before)| {
|
||||
code.match_indices(call)
|
||||
.filter(|&(at, _)| call.starts_with('.') || !code[..at].ends_with(|c: char| c.is_alphanumeric() || c == '_' || c == '.'))
|
||||
@@ -1916,7 +2014,7 @@ fn source_messages(code: &str, helpers: &[(&str, usize)], consts: &std::collecti
|
||||
let mut out = vec![];
|
||||
let in_map_err = in_map_err.map(|rest| (rest, false));
|
||||
let in_handlers = in_handlers.map(|rest| (rest, false));
|
||||
for (rest, takes_format) in after_markers.chain(in_variants).chain(in_map_err).chain(in_handlers).chain(in_helpers) {
|
||||
for (rest, takes_format) in after_markers.chain(in_variants).chain(in_map_err).chain(in_handlers).chain(in_status_locals).chain(in_helpers) {
|
||||
let rest = rest.trim_start();
|
||||
let rest = rest.strip_prefix('&').map_or(rest, str::trim_start);
|
||||
let formatted = rest.strip_prefix("format!(").map(str::trim_start);
|
||||
@@ -1948,6 +2046,7 @@ fn skip_args(args: &str, n: usize) -> Option<&str> {
|
||||
match c {
|
||||
'(' | '[' | '{' => depth += 1,
|
||||
')' | ']' | '}' => depth = depth.checked_sub(1)?,
|
||||
'\'' => skip_char_literal(args, at, &mut chars),
|
||||
'"' => loop {
|
||||
match chars.next()?.1 {
|
||||
'\\' => {
|
||||
@@ -1993,7 +2092,82 @@ fn handler_returns<'a>(code: &'a str, name: &str) -> Vec<&'a str> {
|
||||
out
|
||||
}
|
||||
|
||||
/// Where each value of a local that a `.status(name)` in `code` shows can start: the statement of
|
||||
/// the nearest `let name = ` before that call in the same function whose block is still open at
|
||||
/// the call (`let line = format!("…");`, `let line = match place { … };`, up to its `;`), read as
|
||||
/// [`closure_returns`] reads a closure. A `let` in a block that a `}` closes before the call is
|
||||
/// skipped; a brace inside a string or character literal ([`quoted_end`]) does not open or close a
|
||||
/// block. `code` comes from [`source_messages`] with its comments removed ([`without_comments`]), so
|
||||
/// a brace in a comment is not seen. A local that no `.status(name)` shows is not read.
|
||||
fn status_locals(code: &str) -> Vec<&str> {
|
||||
let mut out = vec![];
|
||||
for (at, m) in code.match_indices(".status(") {
|
||||
let rest = &code[at + m.len()..];
|
||||
let name = &rest[..rest.find(|c: char| !c.is_ascii_alphanumeric() && c != '_').unwrap_or(rest.len())];
|
||||
if !name.starts_with(|c: char| c.is_ascii_lowercase() || c == '_') || !rest[name.len()..].starts_with(')') {
|
||||
continue;
|
||||
}
|
||||
let bound = format!("let {name} = ");
|
||||
let open_at_call = |b: usize| {
|
||||
let (mut depth, mut i) = (0usize, b);
|
||||
while let Some(c) = code.get(i..at).and_then(|s| s.chars().next()) {
|
||||
if let Some(end) = (c == '"' || c == '\'').then(|| quoted_end(code, i)).flatten() {
|
||||
i = end;
|
||||
continue;
|
||||
}
|
||||
match c {
|
||||
'{' => depth += 1,
|
||||
'}' => match depth.checked_sub(1) {
|
||||
Some(d) => depth = d,
|
||||
None => return false,
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
i += c.len_utf8();
|
||||
}
|
||||
true
|
||||
};
|
||||
let nearest = code[..at]
|
||||
.rmatch_indices(bound.as_str())
|
||||
.find(|&(b, _)| !code[..b].ends_with(|c: char| c.is_alphanumeric() || c == '_') && open_at_call(b));
|
||||
if let Some((b, _)) = nearest
|
||||
&& !declares_fn(&code[b..at])
|
||||
{
|
||||
out.extend(closure_returns(statement(&code[b + bound.len()..])));
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Whether `code` holds the keyword `fn ` outside its string and character literals
|
||||
/// ([`quoted_end`]).
|
||||
fn declares_fn(code: &str) -> bool {
|
||||
let mut i = 0;
|
||||
while let Some(c) = code[i..].chars().next() {
|
||||
if let Some(end) = (c == '"' || c == '\'').then(|| quoted_end(code, i)).flatten() {
|
||||
i = end;
|
||||
continue;
|
||||
}
|
||||
if code[i..].starts_with("fn ") && !code[..i].ends_with(|c: char| c.is_alphanumeric() || c == '_') {
|
||||
return true;
|
||||
}
|
||||
i += c.len_utf8();
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
/// Moves `chars`, just past the `'` at `text[at]`, to the end of the character literal it opens
|
||||
/// ([`quoted_end`]); a lifetime's `'` leaves it where it is.
|
||||
fn skip_char_literal(text: &str, at: usize, chars: &mut std::str::CharIndices) {
|
||||
if let Some(end) = quoted_end(text, at) {
|
||||
for _ in text[at + 1..end].chars() {
|
||||
chars.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The statement `code` starts with, up to its `;` or the bracket that closes the block it is in.
|
||||
/// A bracket, `;` or `"` inside a character literal (`'"'`) is skipped.
|
||||
fn statement(code: &str) -> &str {
|
||||
let (mut depth, mut chars) = (0usize, code.char_indices());
|
||||
while let Some((at, c)) = chars.next() {
|
||||
@@ -2004,6 +2178,7 @@ fn statement(code: &str) -> &str {
|
||||
None => return &code[..at],
|
||||
},
|
||||
';' if depth == 0 => return &code[..at],
|
||||
'\'' => skip_char_literal(code, at, &mut chars),
|
||||
'"' => loop {
|
||||
match chars.next() {
|
||||
Some((_, '\\')) => {
|
||||
@@ -2028,7 +2203,8 @@ fn statement(code: &str) -> &str {
|
||||
/// only when the local's name is used, outside a string literal and a `format!`, in a value the closure returns
|
||||
/// (`let why = if … { format!("…") } else { … }; Error(why)`), and not when the local only goes
|
||||
/// elsewhere (`let level = if … { "warning" } else { "error" }; log(level);`). A `return` counts
|
||||
/// wherever it is, except inside a closure the body holds (`unwrap_or_else(|| return …)`).
|
||||
/// wherever it is, except inside a closure the body holds (`unwrap_or_else(|| return …)`). A
|
||||
/// character literal (`'"'`, `'{'`) is skipped, so it does not open a string or a block.
|
||||
fn closure_returns(body: &str) -> Vec<&str> {
|
||||
let ident = |c: char| c.is_alphanumeric() || c == '_';
|
||||
// The name a `let` statement starting at `at` binds (empty for a pattern), if it is one.
|
||||
@@ -2087,6 +2263,7 @@ fn closure_returns(body: &str) -> Vec<&str> {
|
||||
{
|
||||
found.push((&body[at + "return".len()..], None, true));
|
||||
}
|
||||
'\'' => skip_char_literal(body, at, &mut chars),
|
||||
'"' => loop {
|
||||
match chars.next() {
|
||||
Some((_, '\\')) => {
|
||||
@@ -2141,14 +2318,20 @@ fn without_format_args(code: &str) -> String {
|
||||
out
|
||||
}
|
||||
|
||||
/// `code` with the text of its string literals removed, the quotes kept.
|
||||
/// `code` with the text of its string literals removed, the quotes kept. A character literal
|
||||
/// (`'"'`) stays as it is.
|
||||
fn without_strings(code: &str) -> String {
|
||||
let (mut out, mut chars) = (String::new(), code.chars());
|
||||
while let Some(c) = chars.next() {
|
||||
let (mut out, mut chars) = (String::new(), code.char_indices());
|
||||
while let Some((at, c)) = chars.next() {
|
||||
out.push(c);
|
||||
if c == '"' {
|
||||
if c == '\''
|
||||
&& let Some(end) = quoted_end(code, at)
|
||||
{
|
||||
out.push_str(&code[at + 1..end]);
|
||||
skip_char_literal(code, at, &mut chars);
|
||||
} else if c == '"' {
|
||||
loop {
|
||||
match chars.next() {
|
||||
match chars.next().map(|(_, c)| c) {
|
||||
Some('\\') => {
|
||||
chars.next();
|
||||
}
|
||||
|
||||
@@ -8508,6 +8508,18 @@ breakText Glyphs Glyph
|
||||
Margin Lề
|
||||
Box Khung
|
||||
Swatch Mẫu màu
|
||||
@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` phải lớn hơn 0 và tối đa {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` phải từ 0 đến {MAX_DISTANCE} pt
|
||||
@msg `{key}` must be from 0.01 to 1000 pt `{key}` phải từ 0,01 đến 1000 pt
|
||||
@msg select the banner, or mark every artboard hãy chọn băng rôn, hoặc đánh dấu mọi bảng vẽ
|
||||
@msg the banner has no width or height băng rôn không có chiều rộng hoặc chiều cao
|
||||
@msg the grommet inset is too large for the banner khoảng cách từ mép đến khoen quá lớn so với băng rôn
|
||||
@msg the hem is too deep for the banner viền gấp quá sâu so với băng rôn
|
||||
@msg the spacing makes more than {MAX_GROMMETS} grommets khoảng cách này tạo ra hơn {MAX_GROMMETS} khoen
|
||||
@msg there is no banner to mark không có băng rôn nào để đánh dấu
|
||||
@msg turn on at least one side hãy bật ít nhất một cạnh
|
||||
@msg with no hem and no grommets there is nothing to mark không có viền gấp và khoen thì không có gì để đánh dấu
|
||||
@msg {saving} failed: {e} {saving} thất bại: {e}
|
||||
Banner Hems and Grommets… Viền gấp và khoen băng rôn…
|
||||
Banner Hems and Grommets Viền gấp và khoen băng rôn
|
||||
Hem Viền gấp
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1176,6 +1176,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- The untranslated-strings report reads a message written over two lines with a `\` at the end of the first as one line, the text the program shows, and the Georgian catalog's (`ka`) row for PDF export's warning about knockout groups with too many translucent elements matches that text (`message_scan_joins_a_literal_continued_on_the_next_line`, `untranslated_report`).
|
||||
- The untranslated-strings report reads the escapes in a message (`\r`, `\0`, `\x41`, `\u{e9}` and the others the Rust Reference lists at https://doc.rust-lang.org/reference/tokens.html#character-escapes) as the characters the program shows, and leaves out a literal with an escape Rust does not accept, such as `\q` or `\u{D800}` (`message_scan_decodes_rust_character_escapes`, `message_scan_rejects_invalid_rust_escapes`).
|
||||
- The status bar translates the plug-in host's other errors (manifest, module and run checks, the output an importer, exporter or effect returns, and the approval a plug-in's permissions need) in every language that translates every message. A JSON object or array inside a message stays as written, and a message that wraps another one, such as `plug-in manifest: {0}`, is matched by its own row before a row that starts with a placeholder. The reasons inside these errors (what is wrong with a parameter's spec or dialog keys, the value a parameter needs, what is wrong with an object, stroke, paint or effect in a plug-in's output) are translated with them, and the untranslated-strings report lists the reasons the plug-in host's error helpers take (`plugin_messages_are_translated_in_every_complete_catalog`, `plugin_errors_translate_with_their_values`, `plugin_error_reasons_are_translated_with_the_error`, `message_scan_reads_plugin_helpers`, `templates_that_start_with_text_match_first`).
|
||||
- The status bar translates the errors of Object › Plug-ins › Cutting Tools › Banner Hems and Grommets… and the line for a recovery copy that fails in a store with no folder to name (`{saving} failed: {e}`) in every language that translates every message. The untranslated-strings report also lists the messages a status takes from a local variable, such as the recovery folder errors (`banner_and_recovery_messages_are_translated_in_every_complete_catalog`, `message_scan_reads_locals_given_to_a_status`).
|
||||
- The status bar translates `script.run`'s refusals of `answers` in every language that translates every message: a value that is not a list, more than 10,000 answers, more than 1 MiB, an answer at an index that is not an object, does not have exactly `kind` and `value`, has a `value` its kind of dialog does not take, holds a prompt's text longer than 16 KiB or has an unknown `kind`, and `answers` given to a run in the app. The index, the counts and the code names are shown as they are, and the command's error stays in English. The untranslated-strings report also lists the refusals of `script.run`'s parameters (`script_answers_errors_are_translated`, `message_scan_reads_script_run_param_refusals`).
|
||||
- The status bar also translates `script.run`'s other refusals of its parameters in every language that translates every message: a `maxFuel` outside 1 to 100,000,000,000, `args` nested more than 64 levels deep (with the place in `args`), `args` that is not an object or is larger than 1 MiB, an empty `path`, a `source` given with `installed`, a `path` that does not name a .js or .jsx file, and neither or both of `path` and `source`. The code names, the place in `args`, the file suffixes and the limits are shown as they are, and the command's error stays in English (`script_run_param_errors_are_translated`).
|
||||
- The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). A native speaker has not reviewed the wording.
|
||||
|
||||
Reference in new issue
Block a user