asa
11 Mayo, 2026 12:43
5
He enviado un Pull Request para solucionar esto en el repositorio de Discourse:
main ← asa0w0:main
offen 12:40PM - 11 May 26 UTC
## Problem
The AI localization feature currently generates `hreflang` tags usin… g underscores (e.g., `pt_BR`). According to ISO 639-1 and SEO standards, search engines like Google expect hyphens (e.g., `pt-BR`). This causes validation errors in tools like PageSpeed Insights and Google Search Console ("Unexpected language code").
## Solution
This PR applies `.tr('_', '-')` to the `locale` string within the `hreflang` attribute. This ensures that:
1. The `href` URL remains functional (still using the internal underscore format for the parameter).
2. The `hreflang` metadata becomes SEO-compliant by using the hyphen format.
## Validation
Confirmed that this change transforms codes like `pt_BR` into `pt-BR` in the rendered HTML header, resolving the "Unexpected language code" error.
Este cambio garantiza que el atributo hreflang cumpla con los estándares de SEO, al tiempo que mantiene funcionales los parámetros de localización internos.
1 me gusta