ludic.i18n: a language's lookups kept once read; switching back restores them
i18n_use re-read and re-parsed the .po on every change of language (ev_SettingsChanged, SetLang) and dropped the old tables for good: the play of 22 minutes left lines_of 650 KB, fs_read_text 409 KB, PoEntry 113 KB and unquote 273 KB unreachable, and three of its @alloc_ok sites were declared but unbounded. Each language's tables are now filed by index once built (tables.ludic, I18nTables) and put back by reference; a new probe (i18n_init) or a different file for a code (lang_add) reads it again. Test: a language switched back to is its kept tables, not its file read again; a new probe reads it (9 tests pass). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
28ad6f62ea
commit
1667d7f16e
6 changed files with 112 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ export state I18nState {
|
|||
plural: Dict = null # a plural msgid (the singular) -> index into forms / 3
|
||||
forms: []string = null # three forms per entry, "" where the file has fewer
|
||||
plural_rule: int = 0 # PL_*
|
||||
tabs: []I18nTables = null # by language: its lookups once read, kept for the next switch
|
||||
}
|
||||
|
||||
# where the shipped languages are (a directory with languages.txt and <code>.po), and the atlas a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue