Skip to content

[i18n][design] Interpret absolute paths as locale specific #4688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #4467
chalin opened this issue Jun 14, 2024 · 0 comments · Fixed by #4689
Closed
Tracked by #4467

[i18n][design] Interpret absolute paths as locale specific #4688

chalin opened this issue Jun 14, 2024 · 0 comments · Fixed by #4689
Labels
enhancement New feature or request i18n Internationalization and localization

Comments

@chalin
Copy link
Contributor

chalin commented Jun 14, 2024

Design l10n proposal

In summary, I’d like to propose that “absolute” link paths like /some-path be interpreted relative to the current localization site root, whether it is the default localization or not. So, it will be otel.io/some-path for en pages and otel.io/xx/some-path for non-en pages with language code xx.

Here’s why…

With fallback pages in place, each localization is like its own (sub) site — and in fact, Hugo treats each localization as a full Site object.

For the default localization (which is en), link paths like /some-path implicitly refer to pages under content/en. If an English page wants to refer to say, a ja page, then the link path would be written as /ja/some-path.

Currently, localization authors for language xx who translate an English page, need to remember to change all paths of the form /some-path to /xx/some-path, otherwise they’ll be linking out to en pages. That is a burden on writers and maintainers.
I’d like to put a link render hook in place so that /some-path refers to the localization-specific version of the page, whether it is en or not. If a non-en localization wants to explicitly refer to an en page, they’d use /en/some-path as a path.

How does that sound?

This was originally posted on Slack at https://cloud-native.slack.com/archives/C06EDFPQ5EH/p1718358356363719.

@theletterf and @svrnm gave a thumbs up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18n Internationalization and localization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant