A good way to represent URL hash in a locale. #332
Unanswered
hochan222
asked this question in
Localization
Replies: 1 comment 2 replies
-
I l10n-zh, we just use the translated hash, we could get the hash by clicking the heading and copying it from the address bar (or get it from dev tools, for h4, h5, etc.) But with localized hash, we could not go to the corresponding section, when we switch the locale. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue
Recently, I realized that most locale pages, including the ko locale, do not represent hash well.
parameters
is being translated as매개변수
in the ko locale. However, link to매개변수
is[`TypedArray`](/ko/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters)
. On the TypedArray page, it is translated h2 tag title as## 매개변수
, but the hash of the link is#parameters
.With this problem, when you go to a page through a link, you go to the top of the page, not to the corresponding hash. This is because
parameters
has been translated from the page and no longer exists.Other locale status
In localization pages, most hashes use
en-us
as it is and is not properly linked.For better understanding, some examples are given below.
[Valeur retournée](/fr/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Return_value)
[TypedArray objects](/es/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects)
[typed array](/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects)
[TypedArray](/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Syntax)
[typed array](/ru/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects)
[typed array](/zh-cn/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects)
[typed array](/zh-tw/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects)
Worrying point
I wonder if it would be good to specify hash based on the word translated to the locale rather than based on
en-us
. Even if we write a glossary guide for consistent titles, there are also titles that are sentences rather than words. Do we have to specify all sentence or phrase titles? Maintaining the correct hash value is a big cost in the current state.There is also the problem of encoding.
In common, is there any way to manage it with a consistent syntax across all locales? or another good solution.
Beta Was this translation helpful? Give feedback.
All reactions