Repository navigation
Starlark lint API: no way to read the enabled project languages (strings() includes languages that are not enabled) #1306
Description
1. mxcli version: v0.25.0 (2026-10-05T09:18:28Z) (Windows)
2. Mendix version: 11.12.5
Repro app: a fresh mxcli new app, built by the script below
3. Scenario
A Starlark lint rule cannot find out which languages the project has enabled. strings() returns one row per stored translation, also for a language the project does not enable: a fresh app with only en_US enabled already has nl_NL rows. Enabling nl_NL does not change anything a rule can see, and there is no builtin such as languages(). show settings does print the enabled languages, so mxcli reads them already. Related: #1262 (page title in the default language).
Self-contained repro, run in an empty directory:
#!/usr/bin/env bash
# Repro: a Starlark lint rule cannot tell which project languages are enabled. Needs mxcli.
set -e
cd "$(dirname "$0")"
export MXCLI_LOG_DIR="$PWD/logs" # own log dir: the diag holds only this repro
P=Repro/Repro.mpr
mxcli new Repro --version 11.12.5 --skip-build > /dev/null
cat > step1.mdl <<'MDL'
mdl 1;
alter settings LANGUAGE add or modify 'nl_NL' (CheckCompleteness: true);
MDL
mkdir -p Repro/.claude/lint-rules
cat > Repro/.claude/lint-rules/langs.star <<'STAR'
RULE_ID = "DUMP002"
RULE_NAME = "dumpLanguages"
DESCRIPTION = "Print the languages a rule can see"
CATEGORY = "pages"
SEVERITY = "info"
REQUIRES = ["full"]
def check():
seen = {}
for s in strings():
seen[s.language] = seen.get(s.language, 0) + 1
return [violation(message = "strings() languages: %s" % sorted(seen.items()),
location = location(module = "MyFirstModule", document_type = "module", document_name = "MyFirstModule"))]
STAR
cat > Repro/.claude/lint-rules/enabled.star <<'STAR'
RULE_ID = "DUMP003"
RULE_NAME = "dumpEnabledLanguages"
DESCRIPTION = "Try to read the enabled project languages"
CATEGORY = "pages"
SEVERITY = "info"
def check():
return [violation(message = "languages(): %s" % languages(),
location = location(module = "MyFirstModule", document_type = "module", document_name = "MyFirstModule"))]
STAR
echo "--- before: only en_US enabled"
mxcli -p $P -c "show settings" | grep -i language
mxcli lint -p $P -r DUMP002 2>/dev/null | grep 'ℹ'
mxcli -p $P exec step1.mdl
echo "--- after: nl_NL enabled"
mxcli -p $P -c "show settings" | grep -i language
mxcli lint -p $P -r DUMP002 2>/dev/null | grep 'ℹ'
mxcli lint -p $P -r DUMP003 2>&1 | grep -i 'languages\|error' || trueOutput (progress lines left out; the local path is replaced by <repro>):
--- before: only en_US enabled
| Language Settings | Default: en_US, enabled: en_US |
ℹ strings() languages: [("en_US", 152), ("nl_NL", 124)] [DUMP002]
Connected to: Repro/Repro.mpr (Mendix 11.12.5)
Enabled language: nl_NL (2 enabled)
--- after: nl_NL enabled
| Language Settings | Default: en_US, enabled: en_US, nl_NL |
ℹ strings() languages: [("en_US", 152), ("nl_NL", 124)] [DUMP002]
Warning: rule file skipped: <repro>\Repro\.claude\lint-rules\enabled.star: failed to execute Starlark file: <repro>\Repro\.claude\lint-rules\enabled.star:8:53: undefined: languages (a builtin this mxcli does not have — the rule may need a newer mxcli)
Error: unknown rule id(s): DUMP003
Starlark rules were loaded from <repro>\Repro\.claude\lint-rules.
4. Expected output
- A builtin
languages()(and a catalog tableLANGUAGES) with one row per enabled project language:code,is_default,check_completeness, the same datashow settingsprints. - Alternative: an
enabledfield on eachstrings()row.
5. Experienced output
show settings |
strings() languages |
|
|---|---|---|
Before: only en_US enabled |
enabled: en_US |
en_US (152), nl_NL (124) |
After alter settings LANGUAGE add or modify 'nl_NL' |
enabled: en_US, nl_NL |
en_US (152), nl_NL (124) |
The rule output is identical before and after. A rule that calls languages() is skipped: undefined: languages (a builtin this mxcli does not have — the rule may need a newer mxcli).
Other spellings tried
languages()→undefined: languages, see the output above.- Counting the languages in
strings()→ includesnl_NLwhile it is not enabled, see the table.
6. AI bug report
mxcli diag of the repro run:
Version: v0.25.0
Go: go1.26.6 windows/amd64
Sessions: 7 (last 7 days)
Errors: 0 (last 7 days)
Session log of lint -p Repro/Repro.mpr -r DUMP003 (from mxcli diag --bundle):
{"time":"2026-10-06T13:29:52.2864594+02:00","level":"INFO","msg":"session_start","version":"v0.25.0","go":"go1.26.6","os":"windows","arch":"amd64","mode":"mxcli lint","args":["mxcli","lint","-p","Repro/Repro.mpr","-r","DUMP003"],"pid":33336,"parent_pid":""}
{"time":"2026-10-06T13:29:52.3751829+02:00","level":"INFO","msg":"execute","stmt_type":"RefreshCatalogStmt","stmt_summary":"refresh catalog","duration_ms":11}
The lint session logs no error: the rule with languages() is skipped with a warning on stderr only.
Why it matters
Common page checks work per enabled language: "every page title is translated into each enabled language" and "page titles follow a capitalisation convention in each language". Without the list of enabled languages, a rule either checks only the default language (page.title) or reports stale translations of a language the project no longer uses, and a missing translation for an enabled language that has no row at all cannot be found. Workaround: check only the default language.
Activity
github-actions commentedon Oct 6, 2026
Issue Triage
Summary:
The user requests a Starlark lint API (e.g.,
languages()or anenabledflag onstrings()) to expose the list of enabled project languages so lint rules can perform per‑language checks.Checklist for feature request
languages()(and aLANGUAGEScatalog table) or anenabledfield on eachstrings()row, matching the data shown byshow settings.The issue contains all the required information for a feature request. Thank you for the detailed report!
Automated triage via OpenRouter — workflow source
Merge pull request #1031 from ako/claude/gracious-hopper-7vmzhf
Add languages() to the Starlark lint API (#1306)