i18n(zh-cn): Update i18n.mdx & Update customization.mdx#933
Conversation
|
👷 Deploy Preview for astro-starlight processing.
|
|
Maybe build-in support languages in Because we support more and more languages. |
This is an interesting idea. I guess we could maybe use // Available at build time
const currentPageLang = "fr";
// Generated based on the list of supported languages
const supportedLangs = ["ar", "en", "fr", "zh-CN"];
const langNames = new Intl.DisplayNames([currentPageLang], {
type: "language",
});
const langList = new Intl.ListFormat(currentPageLang, {
style: "long",
type: "conjunction",
}).format(supportedLangs.map((supportedLang) => langNames.of(supportedLang)));This would give for example:
|
delucis
left a comment
There was a problem hiding this comment.
LGTM — thanks @liruifengv!
@HiDeoo Would definitely be interested to see that in a PR! I’d actually considered if it was possible before but dismissed it as not possible because of the need to translate the language names — didn’t know about that part of Intl. (Not for the first time you surprise me with Intl magic — I should probably brush up on it.)
What kind of changes does this PR include?
Description