Switching a blog post to French leads to a 404, because the language menu links to a post URL that is never built
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Lee apps/outreach/src/components/layout/LanguageToggle.astro y sigue cómo usa el blog el selector en la página apps/outreach/src/pages/[locale]/blog/[slug].astro. Actualiza el comportamiento de los enlaces de idioma para que una publicación sin traducir lleve al índice del blog en el otro idioma, en lugar de a una URL de una publicación inexistente. Compila apps/outreach y verifica que cada enlace en francés de dist/en/blog/*/index.html resuelva a un archivo dentro de dist/.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On every blog post, choosing "FR" in the header's language menu leads to a 404. LanguageToggle builds the other-language link by swapping the locale prefix of the current URL, so /en/blog/<slug>/ becomes /fr/blog/<slug>/. A blog post is only built under the locale in its own language frontmatter. Both languages share one flat directory, so a translation would need a different filename and therefore a different slug. The swapped URL can never exist. All six posts are English today, so the French option on each of them is a dead link. That includes https://opendatacapture.org/fr/blog/open-data-capture-v2/, which returns 404 on the live site.
Where
apps/outreach/src/components/layout/LanguageToggle.astro:33-44:
<a ... href={new URL(Astro.url.href.replace(`/${resolvedLanguage}`, `/en`))}>en</a>
<a ... href={new URL(Astro.url.href.replace(`/${resolvedLanguage}`, `/fr`))}>fr</a>
apps/outreach/src/pages/[locale]/blog/[slug].astro:14-20 builds each post under one locale only:
const paths = posts.map((post) => ({
params: {
locale: post.data.language,
slug: post.slug
},
Reproduce
- Open https://opendatacapture.org/en/blog/open-data-capture-v2/.
- Open the language menu in the header and choose "FR".
Actual: the browser goes to /fr/blog/open-data-capture-v2/, which is the 404 page.
Expected: the French option leads to a page that exists, such as the French blog index /fr/blog/, which already tells readers that the content is available in English.
Tests
apps/outreach has no unit or Playwright suite, by decision (apps/outreach/AGENTS.md). Verify through the build: in dist/en/blog/*/index.html, the language menu's fr link resolves to a file under dist/.
Suggested fix
Let the page give the toggle its alternate URLs instead of deriving them from the path. Page already receives bilingual, so pass it on to Header and LanguageToggle. When a page is not bilingual, link the other language to that language's blog index (or disable that option, as the toggle already does on the 404 page). If translated posts are planned, add an optional translation: reference('blog') field to the post schema and link to it when it is set.
- Lenguaje dominante
- TypeScript
- Estrellas
- 119
- Forks
- 19
- Merge medio
- 4 d 11 h
- PR fusionados (30 d)
- 35
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DouglasNeuroInformatics/OpenDataCapture
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
Los mantenedores suelen responder en 1 día
-
Interactive With JSPsych example submits a DataCollection its own schema rejectsPosiblemente ocupada @Sanilas-ai la tomó hace 2 días. AbiertoArea: Playground Bug Difficulty: Low Good First Issue Priority: Medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
DouglasNeuroInformatics/OpenDataCapture#1833 ·
Los mantenedores suelen responder en 1 día
-
Area: Instruments Bug Difficulty: Low Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Area: Shared Bug Difficulty: Low Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Multiple instructions show as one comma-joined paragraph ("questions., Conditional")Posiblemente ocupada @Sanilas-ai la tomó hace 2 días. AbiertoArea: Shared Bug Difficulty: Low Good First Issue Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DouglasNeuroInformatics/OpenDataCapture#1812 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de DouglasNeuroInformatics/OpenDataCapture
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
oxidecomputer/skepsis#102 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
voidzero-dev/void#677 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kunchenguid/gh-axi#247 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
lidge-jun/opencodex#8101 · 2 comentarios ·
Los mantenedores suelen responder en 1 día