Commit d0f8319
Emit BCP 47 hreflang tags for new locales
The hreflang attribute requires BCP 47 language tags, but the existing
template was emitting the raw locale key (e.g. 'zh_hans') as the
hreflang value. Underscores aren't valid in BCP 47, so the new locales
would have produced non-conformant alternate links that search engines
ignore.
Adds an optional 'hreflang' key to each locale's data file, with the
template falling back to the locale key when the key is absent. That
keeps every existing locale's output unchanged (single-subtag codes
like 'es', 'pt', 'de' are already valid BCP 47) and lets zh_hans and
zh_hant emit zh-Hans and zh-Hant.
Addresses Copilot review feedback on PR #1333.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4a6c6f2 commit d0f8319
3 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
0 commit comments