Merge pull request #4416 from dotCooCoo/fix/tabs-position-label-translated

Tabs: the position field's label is translated
This commit is contained in:
BFlat
2026-10-29 11:00:43 +07:00
committed by GitHub
4 changed files with 26 additions and 1 deletions
+2
View File
@@ -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.
+2
View File
@@ -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).
1 # Vietnamese (vi) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
4002
4003
4004
4005
4006
4007
4008
4009
4010
+1 -1
View File
@@ -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))
+21
View File
@@ -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]