Generation: derive language-prefix detection from project blogLanguages, not a hardcoded set #84
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 2.15 (first half).
Current behaviour (RuDS):
crates/bds-core/src/engine/generation.rsfnhas_language_prefix(~line 808) recognizes only"de" | "en" | "es" | "fr" | "it"as language path prefixes. A project with any other blogLanguage (pt, ja, nl…) gets its{lang}/...output paths misclassified byclassify_generated_path, which feedspath_matches_sections→ validation apply and stale-page cleanup (expected_paths_for_sections,remove_extra_section_paths).Spec/bDS2: neither limits languages to that set;
specs/generation.alliumMultiLanguageRoutes is generic overgeneration.blog_languages. bDS2 derives prefixes from project metadata.Task: Thread the project's actual language list (metadata mainLanguage + blogLanguages, normalized via
crate::i18n::normalize_language) intoclassify_generated_path/has_language_prefixinstead of the hardcoded matches. Audit other callers of the hardcoded list (grep"de" | "en"in bds-core). Add a test with a non-Western language code (e.g. "pt") exercising classification and validation apply.Acceptance: Paths under any configured language classify identically to main-language paths; test with pt/ja passes.
Implemented in
ba6a297. Generation path classification now receives project metadata throughout the core engine, renderer, desktop, CLI, and TUI paths and recognizes mainLanguage plus every configured blogLanguage instead of a fixed locale set. Added pt/ja classification coverage and an end-to-end validation-apply test proving stale pt outputs are removed. Updated README. Verified against bDS2 metadata-driven language planning and specs/generation.allium; cargo build --workspace and cargo test --workspace pass.