ludic.i18n: a glued key's name is a-z, 0-9, _ and . only (every key en.po holds), so a word glued on after it is not read as part of it; keys_test: "Not owned. " + a key, and a capital straight after one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 00:52:49 +03:00
parent 96c6e27d98
commit d703d79feb
2 changed files with 4 additions and 2 deletions

View file

@ -2,8 +2,9 @@
# name + "\n" + its blurb): each marked name made in the language in use, then the line as English. Interim,
# until every such line is a key of its own (26.9); a mark with arguments cannot be told from the line after it
# a key's name: its alphabet, and a full stop at its end left to the sentence
function kx_name_byte(c: int) -> bool { return (c >= 97 and c <= 122) or (c >= 65 and c <= 90) or (c >= 48 and c <= 57) or c == 95 or c == 46 or c == 45 }
# a key's name: a-z, 0-9, _ and . (every key the compiler derives or a game writes), a full stop at its
# end left to the sentence
function kx_name_byte(c: int) -> bool { return (c >= 97 and c <= 122) or (c >= 48 and c <= 57) or c == 95 or c == 46 }
function kx_name_end(s: string, i: int) -> int {
var e = i

View file

@ -91,6 +91,7 @@ program I18nKeysTest {
let elk = tr(k"species.elk.a_name")
expect(L(i18n_st, "Saw " + elk + ", 30 cm.") == "Saw an elk, 30 cm." and L(i18n_st, "Saw " + elk + ".") == "Saw an elk.")
expect(L(i18n_st, elk + ": 30 cm") == "an elk: 30 cm" and L(i18n_st, elk + "\n" + tr(k"pause.quit")) == "an elk\nQuit")
expect(L(i18n_st, "Not owned. " + tr(k"pause.quit")) == "Not owned. Quit" and L(i18n_st, elk + "Quit") == "an elkQuit")
expect(L(i18n_st, trf(k"catch.saw", "Seen: " + elk, "5:30", "", "")) == "You saw Seen: an elk at 5:30.")
i18n_load_text(i18n_st, tt())
expect(L(i18n_st, "Day " + tr(k"pause.resume")) == "Devam. gun") # the name made, then the line's own pattern