i18n 26.9, error mode: English left is an error under a lang line (a template's words, a text attribute's, a choice that reads as words, a @Text row's English), ludic deps still counting english_left; hole counts and undescribed splits stay warnings. ludic.ui's own words are keys - ui_tk(ui_st, k"ui.right_click", plain) for the key field's Right / Middle / Left click and press a key..., its plain text for a program with no translator; the examples' en.po / tr.po carry ui.*, i18n_ui checks clean, rejected/i18n_keys/english_left holds the error, data_missing counts 2; LANGUAGE.md and the changeset; on lang/foundations 2288feeb; reseeded, bootstrap-cfree fixpoint holds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2288feeb59
commit
25a57c099b
18 changed files with 3667 additions and 3585 deletions
|
|
@ -236,6 +236,12 @@ function ui_tr(ui_st: UiState, s: string) -> string {
|
|||
if ui_st.ui_be != null and ui_st.ui_be.translate != null { return ui_st.ui_be.translate(s) }
|
||||
return s
|
||||
}
|
||||
# ludic.ui's own words by key (ui.* in the program's en.po); a program with no translator bound has
|
||||
# no languages, and draws `plain`
|
||||
function ui_tk(ui_st: UiState, k: Key, plain: string) -> string {
|
||||
if ui_st.tr_no or ui_st.ui_be == null or ui_st.ui_be.translate == null { return plain }
|
||||
return ui_st.ui_be.translate(string(k))
|
||||
}
|
||||
function ui_sound(ui_st: UiState, name: string) -> void {
|
||||
if ui_st.ui_be != null and ui_st.ui_be.sound != null { ui_st.ui_be.sound(name) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function ct_key_pressed_away(ui_st: mut UiState, hit: UiNode) -> void {
|
|||
if ui_st.ct_capture != "" and (hit == null or hit.key != ui_st.ct_capture) { ui_st.ct_capture = "" }
|
||||
}
|
||||
function ct_key_text(ui_st: UiState, n: UiNode) -> string {
|
||||
if ui_st.ct_capture == n.key { return ui_tr(ui_st, "press a key...") }
|
||||
if ui_st.ct_capture == n.key { return ui_tk(ui_st, k"ui.press_key", "press a key...") }
|
||||
if Value.kind(ui_attr(n, "shown")) != 0 { return ui_tr(ui_st, ui_attr_text(n, "shown")) }
|
||||
let v = Value.as_int(ui_attr(n, "value"))
|
||||
if v >= UI_MOUSE_LEFT and v <= UI_MOUSE_MIDDLE { return ct_mouse_name(ui_st, v) }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function ct_key_mouse(ui_st: mut UiState, root: UiNode) -> bool {
|
|||
return true
|
||||
}
|
||||
function ct_mouse_name(ui_st: UiState, v: int) -> string {
|
||||
if v == UI_MOUSE_RIGHT { return ui_tr(ui_st, "Right click") }
|
||||
if v == UI_MOUSE_MIDDLE { return ui_tr(ui_st, "Middle click") }
|
||||
return ui_tr(ui_st, "Left click")
|
||||
if v == UI_MOUSE_RIGHT { return ui_tk(ui_st, k"ui.right_click", "Right click") }
|
||||
if v == UI_MOUSE_MIDDLE { return ui_tk(ui_st, k"ui.middle_click", "Middle click") }
|
||||
return ui_tk(ui_st, k"ui.left_click", "Left click")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue