Skip to content

fix(template): scope babel.cfg python extraction to src/#1722

Merged
davidpoblador merged 1 commit into
mainfrom
fix/template-babel-cfg-scope-1717
Apr 28, 2026
Merged

fix(template): scope babel.cfg python extraction to src/#1722
davidpoblador merged 1 commit into
mainfrom
fix/template-babel-cfg-scope-1717

Conversation

@davidpoblador

Copy link
Copy Markdown
Member

Summary

vibetuner-template/babel.cfg previously read:

[python: **.py]
input_paths = src

input_paths = src is not a real pybabel directive inside an extractor section — it's silently ignored as an unknown method keyword. The effective pattern **.py matches every Python file under the walk root passed to pybabel extract, so just extract-translations (which runs pybabel extract -F babel.cfg -o locales/messages.pot .) was pulling translatable strings from tests/, scripts/, and anything else outside src/.

Fix

Scope the python pattern to src/**.py and drop the bogus line:

[python: src/**.py]

[jinja2: templates/frontend/**.html.jinja]
input_encoding = utf-8

Verification

Ran pybabel extract against the template directory before and after:

  • Before: walks src/{{ project_slug | replace('-', '_') }}/__init__.py and tests/__init__.py.
  • After: walks only src/{{ project_slug | replace('-', '_') }}/__init__.py.

Note for existing scaffolded projects

This file lives in vibetuner-template/, so existing user projects won't auto-update. If you've scaffolded a project from a prior version of the template, manually update your babel.cfg to match (or run a Copier update / just deps-scaffolding if you have that wired up).

Closes #1717

Test plan

  • pybabel extract -F vibetuner-template/babel.cfg -o /tmp/test.pot vibetuner-template/ walks only src/-scoped files
  • Pre-commit hooks pass

The previous config used `[python: **.py]` with an unrecognized
`input_paths = src` directive (silently ignored by pybabel), so
`just extract-translations` walked every Python file under the
project root, pulling strings from `tests/` and other directories.

Scope the python pattern to `src/**.py` and drop the bogus
`input_paths` line.

Closes #1717
@davidpoblador davidpoblador merged commit b729964 into main Apr 28, 2026
2 checks passed
@davidpoblador davidpoblador deleted the fix/template-babel-cfg-scope-1717 branch April 28, 2026 09:16
davidpoblador pushed a commit that referenced this pull request Apr 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[10.8.0](v10.7.0...v10.8.0)
(2026-04-28)


### Features

* add BrandSettings env-var surface for favicon and email branding
([#1720](#1720))
([3d22717](3d22717))
* i18n primitives for per-tenant locale flows
([#1718](#1718))
([177fe5e](177fe5e))


### Bug Fixes

* restore gettext plural-form support in lint-po
([#1725](#1725))
([fe0dacb](fe0dacb))
* **template:** scope babel.cfg python extraction to src/
([#1722](#1722))
([b729964](b729964))
* theme default screens with DaisyUI semantic tokens
([#1714](#1714))
([4467168](4467168))


### Performance Improvements

* **testing:** share MongoDB across vibetuner_db tests
([#1726](#1726))
([c9064e4](c9064e4))


### Miscellaneous Chores

* **py:** use PEP 639 SPDX license expression
([#1727](#1727))
([855f9f4](855f9f4))


### Documentation Updates

* **i18n:** clarify locale_names vs language_picker overlap
([#1723](#1723))
([87733bd](87733bd))
* **template:** document i18n primitives in scaffolded agent rules
([#1724](#1724))
([27a3b98](27a3b98))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Scaffolding: babel.cfg extracts from tests/ — pattern is too loose

1 participant