Skip to content

Conversation

@BoboTiG
Copy link
Member

@BoboTiG BoboTiG commented Oct 5, 2025

It also comes with those small optimizations & changes:

  • definitions_to_ignore was alreay working, so nothing done on this side.
  • templates_ignored is now taken properly into account, and all templates were tested/cleaned-up.
  • Enforced variants: undefined variant templates will raise a KeyError, allowing to catch missed templates easily.
  • Better variants/reverse variants clean-up for several locales.
  • Better HTML clean-up after expansion.
  • --check-word[s] are gone
  • user_functions.py is gone (the 3 functions still in use were moved to files where there are in use (two in utils.py, and one in get_word.py).
  • only two scripts are kept: for namespaces, even if this will never change, I might remove this one at some point), and da-langs.py since we cannot use a Python module to guess all language names directly (lang codes with 3 letters, for instance, are only available from the Wiktionary Lua module; and maybe using the Lua moduel directly would be the best!).

The new tree is sober, and cleaner:

  • When a locale has variants support, including reverse variants, a file named variant_handlers.py contains everything needed.
  • When a locale needs to override a template/module, a file named template_overrides.py contains everything needed. Ideally, this file should be small, and even better: not existant. But for FR, for instance, we need to change the output of two templates since they create a full HTML tree with sections, tables, titles, etc. And we are only interested in one sentence in all of that.
  • When a locale needs to change module/template code directly in the database, a file named template_adapters.py contains everything needed. This will do database changes only once, then it will be a no-op until no new changes are added. This is useful to remove code that we would need to clean-up afterward like "see also" stuff, ot langs names not useful to show, or even fix etymologies rendering for PT.

Note: all tests pass locally (modulo you have all locale databases). That's important or the future to know that it actually works, and nothing is broken. We will be able to iterate to unlock GitHub CI runs at some point (not in my priority list to be honest).

Related to #2520.

It also comes with those small optimizations:

- Enforced variants: undefined variant templates will raise a `KeyError`, allowing to catch missed templates easily.
- Better variants/reverse variants clean-up for multiple locales.
@BoboTiG BoboTiG merged commit ee1cf63 into master Oct 5, 2025
1 of 3 checks passed
@BoboTiG BoboTiG deleted the feat-lua-runner-v2-clean-up branch October 5, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant