From d703d79feb0af0d11faf75070ec84c3e5617a4ee Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Wed, 30 Sep 2026 00:52:49 +0300 Subject: [PATCH] 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 --- packages/ludic.i18n/mixed.ludic | 5 +++-- packages/ludic.i18n/tests/keys_test.ludic | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ludic.i18n/mixed.ludic b/packages/ludic.i18n/mixed.ludic index 13bbeb49..a1576e37 100644 --- a/packages/ludic.i18n/mixed.ludic +++ b/packages/ludic.i18n/mixed.ludic @@ -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 diff --git a/packages/ludic.i18n/tests/keys_test.ludic b/packages/ludic.i18n/tests/keys_test.ludic index 5ddbf7da..045692eb 100644 --- a/packages/ludic.i18n/tests/keys_test.ludic +++ b/packages/ludic.i18n/tests/keys_test.ludic @@ -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