i18n: a key used only in a listener counts as used - the key check walked prog but not the bodies kept beside it (@On listeners, the lifecycle hooks, tests, computed fields, scenes), so their keys were never checked against en.po and ludic schema listed them unused (the game's 15 itemuse.* keys, emitted through ItemPlace); they are walked now as privates.ludic walks them. examples/lang/i18n_listen and its schema case (added, not run); reseeded, bootstrap-cfree fixpoint holds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e2aa928e95
commit
56762050fb
8 changed files with 64333 additions and 63946 deletions
14
examples/lang/i18n_listen/i18n_listen.ludic
Normal file
14
examples/lang/i18n_listen/i18n_listen.ludic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# i18n_listen.ludic - a key used only inside an @On listener is a used key: the check walks the
|
||||
# bodies kept beside the program's declarations (listeners, hooks, tests, scenes), so listen.put is
|
||||
# checked against en.po and `ludic schema` does not report it unused.
|
||||
#
|
||||
# Running it prints: listen.put
|
||||
program I18nListen {
|
||||
event Put { n: int = 0 }
|
||||
function tr(key: Key) -> string {
|
||||
let s = string(key)
|
||||
return s[1..len(s)]
|
||||
}
|
||||
@On(Put) handler Said { print(tr(k"listen.put")) }
|
||||
entry { emit Put(n: 1) }
|
||||
}
|
||||
8
examples/lang/i18n_listen/lang/en.po
Normal file
8
examples/lang/i18n_listen/lang/en.po
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# The source language of the listener keys example.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
#. What is said when something is put down.
|
||||
msgid "listen.put"
|
||||
msgstr "Put down"
|
||||
2
examples/lang/i18n_listen/package.ludic
Normal file
2
examples/lang/i18n_listen/package.ludic
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# the listener keys example (i18n_listen.ludic): lang/en.po is the source every key is checked against
|
||||
lang "lang" en
|
||||
Loading…
Add table
Add a link
Reference in a new issue