-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Fix Internationalization heading link to english #754
Comments
@x86chi it's possible to permalink: https://preactjs.com/?lang=kr |
From the next page, the Navagate to "Differences to React" steps: I think it is difficult to manually paste and share the query string. |
@x86chi That's a fair point, yep! I had originally gone with the disappearing querystring because we didn't want to assume shared links should point to the same language - that way someone can share a link to documentation and it will detect. Out of curiosity - did the docs automatically show in Korean for you when you first visited the site? We try to detect your language based on I just re-read your original description and you're totally right about the heading identifiers - we're using a regular expression to convert non-alphanumeric characters to |
It works fine in modern browsers.
From a permerlink perspective, it seemed more semantic to always use a query string. |
```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text .toLowerCase() .replace(/[\s-]+/g, '-') .replace(/[^a-z0-9\u00C0-\u024F-]/g, ''); // korean .replace(/[^가-힣]/g, ''); // Japanese hiragana, katakana, kanji .replace(/[^\u3041-\u3096\u30A0-\u30FF\u2E80-\u2FD5]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. Reference issue comment: preactjs#754 (comment)
```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean .replace(/[^가-힣]/g, ''); // Japanese hiragana, katakana, kanji .replace(/[^\u3041-\u3096\u30A0-\u30FF\u2E80-\u2FD5]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. Reference issue comment: preactjs#754 (comment)
```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean .replace(/[^가-힣]/g, ''); // Japanese hiragana, katakana, kanji .replace(/[^\u3041-\u3096\u30A0-\u30FF\u2E80-\u2FD5]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. But i haven't opinion yet, so I remove the one line that erased non-alphanumeric characters. Reference issue comment: preactjs#754 (comment)
```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean, Japanese (hiragana) .replace(/[^가-힣\u3041-\u3096]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. But i haven't opinion yet, so I remove the one line that erased non-alphanumeric characters. Reference issue comment: preactjs#754 (comment)
* Support non-alphanumeric characters in ToC ```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean, Japanese (hiragana) .replace(/[^가-힣\u3041-\u3096]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. But i haven't opinion yet, so I remove the one line that erased non-alphanumeric characters. Reference issue comment: #754 (comment) * Filter out programming/markdown characters only Co-authored-by: Jason Miller <developit@users.noreply.github.com>
* Support non-alphanumeric characters in ToC ```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean, Japanese (hiragana) .replace(/[^가-힣\u3041-\u3096]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. But i haven't opinion yet, so I remove the one line that erased non-alphanumeric characters. Reference issue comment: preactjs/preact-www#754 (comment) * Filter out programming/markdown characters only Co-authored-by: Jason Miller <developit@users.noreply.github.com>
* Support non-alphanumeric characters in ToC ```js // Note: character range in regex is roughly "word characters including accented" (eg: bublé) const id = text // korean, Japanese (hiragana) .replace(/[^가-힣\u3041-\u3096]/g, ''); ``` If want to keep existing intent, the above code might be more suitable. But i haven't opinion yet, so I remove the one line that erased non-alphanumeric characters. Reference issue comment: preactjs/preact-www#754 (comment) * Filter out programming/markdown characters only Co-authored-by: Jason Miller <developit@users.noreply.github.com>
In Internationalization document, The Table of Content Link is muted to
-
.This issue was reported from Japanese document (#646). You can reproduce from any language.
In React doucment, Internationalization heading is wrapped to english
The document in the link above is maintain with english:
## React Element의 타입 지정하기 {#specifying-the-react-element-type}
It seems good to unify the links in English. Because there is no permerlink for each language like
ko.preactjs.org
.The text was updated successfully, but these errors were encountered: