mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 20:28:43 +08:00
## Backend
- Extend extraction script (`scripts/gp/extract_backend_strings.py`) to
auto-discover all `initial_setup/starter_projects/*.json` files and emit
`starter_flows.{safe_key}.name` / `starter_flows.{safe_key}.description`
keys — no manual work needed when new starter flows are added.
- Add `translate_starter_flows()` to `utils/i18n.py`, mirroring the
existing `translate_component_dict()` pattern. Derives a stable
`name_key` (slug) from the English name and attaches it to each
`FlowRead` so the frontend can match flows by identity regardless of
locale.
- Update `FlowRead` model to expose `name_key: str | None`.
- Refactor `read_basic_examples()` endpoint (`api/v1/flows.py`):
- Accept `Request` parameter to read `request.state.locale` (set by
existing `set_locale` middleware).
- Cache the raw `flow_reads` list instead of the compressed response so
the same DB result can be translated per-request (cheap: ~33 dict
lookups, no additional DB hit).
- Call `translate_starter_flows()` on every request so `name_key` is
always populated.
- Update all 7 backend locale files (en, fr, de, es, ja, pt, zh-Hans)
with new `starter_flows.*` keys from GP.
## Frontend
- Templates modal (`modals/templatesModal/`):
- Translate sidebar title, category group labels ("Use Cases",
"Methodology"), and all nav item labels.
- Translate "Get started" header and description.
- Translate card category badges (PROMPTING, RAG, AGENTS).
- Translate search placeholder and "No templates found" empty state.
- Translate "Start from scratch" footer and "Blank Flow" button.
- Use `flow.name_key` (stable slug) for example lookup in
`GetStartedComponent` so matching is locale-independent.
- Refetch examples on language change: add `i18n.language` to the
`useGetBasicExamplesQuery` cache key so React Query re-fetches
translated flow data whenever the UI language switches.
- Add `name_key?: string | null` to `FlowType`.
- Empty state pages (`emptyPage`, `emptyFolder`): translate "Empty
project", "Start building", description, and "New Flow" button.
- Update all 7 frontend locale files with new `templatesModal.*` and
`emptyPage.*` keys from GP.