You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 beotel.io/some-path
foren
pages andotel.io/xx/some-path
for non-en pages with language codexx
.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 undercontent/en
. If an English page wants to refer to say, aja
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 toen
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 isen
or not. If a non-en
localization wants to explicitly refer to anen
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
The text was updated successfully, but these errors were encountered: