kubernetes / kubernetes/website

Heading shortcode doesn't generate anchor IDs for Japanese localization

Open
#54,206 6 comments 0 reactions 1 assignee Claimed by @kfess View on GitHub
area/localization area/web-development kind/bug triage/accepted
Dominant language
HTML
Stars
5.4k
Forks
15.7k
Avg merge
4d 18h
Merged PRs (30d)
204

Description

**This is a Bug Report**

**Problem:**
While translating the [Init containers page](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) into Japanese, I encountered an internal link that references the "What's next" section.

> This simple example should provide some inspiration for you to create your own init containers. [What's next](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#what-s-next) contains a link to a more detailed example.

However, the `heading` shortcode doesn't generate anchor IDs when used in Japanese documentation, breaking internal page links that reference those headings.

Currently, manually adding `{#what-s-next}` after the shortcode works as a workaround, but this was flagged as incorrect in [#53639](https://github.com/kubernetes/website/pull/53639#discussion_r2649674434).

**Proposed Solution:**
Include anchor IDs in the i18n translation strings in `i18n/ja/ja.toml`:

```toml
[whatsnext_heading]
other = "次の項目 {#what-s-next}"
```

I tested this locally and confirmed that anchor links work correctly with this approach. But is this the correct approach for handling anchor IDs in translations?

**Page to Update:**
- `i18n/ja/ja.toml` and any Japanese documentation pages using heading shortcodes with internal links

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.