mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 20:27:05 -06:00
Tabs: the position field's label is translated
The Tabs panel drew its X: and Y: label untranslated, so French showed "X:" in place of its catalog's "X :" with a no-break space, and Chinese showed an ASCII colon. The label now goes through the catalogs, and the Polish and Vietnamese catalogs get their X: and Y: rows.
This commit is contained in:
@@ -1885,6 +1885,8 @@ lighting Light Światło
|
||||
Repeat Tab Powtórz tabulator
|
||||
Right-Justified Tab Tabulator prawy
|
||||
Top-Justified Tab Tabulator górny
|
||||
X: X:
|
||||
Y: Y:
|
||||
Select a text object to set its tab stops. Zaznacz obiekt tekstowy, aby ustawić jego tabulatory.
|
||||
Select text Zaznacz tekst
|
||||
Snap to Unit Przyciągaj do jednostek
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -4002,7 +4002,9 @@ mark-style Japanese Kiểu Nhật
|
||||
X11 (XWayland) When a Pen Is Attached X11 (XWayland) khi có bút được kết nối
|
||||
If a drawing tablet's pen doesn't draw, choose an X11 (XWayland) option. Nếu bút của bảng vẽ không vẽ được, hãy chọn một tùy chọn X11 (XWayland).
|
||||
X11 (XWayland) X11 (XWayland)
|
||||
X: X:
|
||||
XML ID XML ID
|
||||
Y: Y:
|
||||
Yards Yard
|
||||
Yellow Vàng
|
||||
Your browser downloads the files (several as one .zip). Trình duyệt của bạn tải xuống các tệp (một số tệp gộp thành một .zip).
|
||||
|
||||
|
@@ -158,7 +158,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
egui::Grid::new("tabs-grid").num_columns(2).spacing([6.0, 4.0]).show(ui, |ui| {
|
||||
ui.label(egui::RichText::new(if vertical { "Y:" } else { "X:" }).color(t.text));
|
||||
ui.label(egui::RichText::new(if vertical { tl!("Y:") } else { tl!("X:") }).color(t.text));
|
||||
let x = stops.get(sel).map(|s| s.position);
|
||||
if let Some(v) = widgets::spin_field(ui, "tabs-x", x, app.session.general_unit(), 90.0, 1.0, 0.0, &[])
|
||||
&& let Some(i) = apply_moved(app, ui.ctx(), &mut stops, sel, v.max(0.0))
|
||||
|
||||
@@ -81,6 +81,27 @@ fn vertical_type_names_the_alignments_top_and_bottom_and_the_position_y() {
|
||||
}
|
||||
}
|
||||
|
||||
/// The position field's label is translated: French puts a no-break space before the colon,
|
||||
/// Chinese writes a full-width colon.
|
||||
#[test]
|
||||
fn position_label_is_translated() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({})).unwrap();
|
||||
app.session.execute("text.create", &json!({"x": 10, "y": 20, "text": "a b", "area": {"width": 300, "height": 100}})).unwrap();
|
||||
app.session.execute("text.tabs.set", &json!({"stops": [{"position": 50}]})).unwrap();
|
||||
let labels = |app: &mut VectorcraftApp| {
|
||||
let text = crate::tests_labels::painted_text(app, show);
|
||||
["X:", "Y:", "X\u{a0}:", "Y\u{a0}:", "X:", "Y:"].into_iter().filter(|l| text.lines().any(|t| t.trim() == *l)).collect::<Vec<_>>()
|
||||
};
|
||||
for (code, horizontal, vertical) in [("fr", "X\u{a0}:", "Y\u{a0}:"), ("zh-hans", "X:", "Y:"), ("en", "X:", "Y:")] {
|
||||
crate::i18n::set_current(crate::i18n::Lang::from_code(code).unwrap());
|
||||
app.session.execute("type.orientation.horizontal", &json!({})).unwrap();
|
||||
assert_eq!(labels(&mut app), [horizontal], "{code}");
|
||||
app.session.execute("type.orientation.vertical", &json!({})).unwrap();
|
||||
assert_eq!(labels(&mut app), [vertical], "{code}");
|
||||
}
|
||||
}
|
||||
|
||||
/// #924: Leader and Align On keep what is typed, frame after frame, until Enter applies it
|
||||
/// (spaces kept, eight characters at most).
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user