Reviving Praderas (Day 8) — Phase 5: bilingual without rewriting history
After Phase 4 (SEO), the next agreed bucket was Phase 5: multilingual. The hard constraint was to avoid mass-changing existing Spanish URLs under /blog/.... The approach keeps Spanish posts where they are and adds English along predictable paths.
What we shipped
-
Content layout
- Spanish posts:
content/blog/*.md→/blog/slug(unchanged). - English posts:
content/blog/en/*.md→/blog/en/slug. - English top-level pages:
content/en/*.md→/en/slug(for now: Home and/en/bloglisting).
- Spanish posts:
-
Pairing translations
- Optional
Lang: es | en(language can also be inferred from the path). Translation_Key: same string on both files so the site can wire alternates.
Spanish and English home pages sharepraderas-homeso the header switcher appears on both.
- Optional
-
plugins/65-Multilingual.php- Registers metadata, indexes pairs, exposes Twig variables for language, alternates, home URL, and
hreflanglinks (includingx-defaultto Spanish when both exist).
- Registers metadata, indexes pairs, exposes Twig variables for language, alternates, home URL, and
-
Theme + social metadata
- Dynamic
og:locale/og:locale:alternate,hreflangloop inpage-meta.twig,html lang, navbar brand to the correct home, and a smalllang-switcher.twigwhen a paired page exists.
- Dynamic
-
Plugins aligned with language
- Pagination for
/blogexcludesblog/en/*; English listing usesblog-en.twig. - Prev/next and related posts stay in the same language as the current post; category counts on the Spanish categories page use Spanish posts only.
- Series maps are per language;
/seriesremains Spanish-first. /archivolists Spanish posts only.- Search stopwords:
low_value_words_eninconfig/config.ymlwhen the current page is English.
- Pagination for
-
Sidebar
- English labels and “Recent posts” limited to
blog/en/*whencontent_lang == 'en'.
- English labels and “Recent posts” limited to
Honest scope limits
- We are not translating the full archive yet—only this paired Day 8 post plus the English home/blog stubs.
- Sitemap split and Phase 6 JSON remain future work.
- The EN nav still links About to the existing Spanish
acerca-de-picocmspage until a dedicated English page is added.
Closing
Phase 5 gives a maintainable skeleton: URLs, metadata, hreflang, and minimal UI. The remaining work is mostly editorial—adding Translation_Key pairs as translations exist.