Skip to content
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

docs: refactor languages list #1012

Merged
merged 8 commits into from
Nov 17, 2023

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Nov 1, 2023

What kind of changes does this PR include?

  • Changes or translations of Starlight docs site content

Description

This PR is a follow up to this comment and refactors the list of supported languages in the Translate Starlight’s UI section of the docs Internationalization (i18n) page by replacing it by a dynamically generated list of languages.

The goal is that PRs adding new languages would no longer require follow-up i18n PRs.

Here is the diff for example in English:

- English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Hebrew, Simplified Chinese, Korean, Indonesian, Russian, Swedish, Ukrainian, and Vietnamese translated UI strings are provided out of the box, and we welcome contributions to add more default languages.
+ Arabic, Chinese, Czech, Danish, Dutch, English, French, German, Hebrew, Indonesian, Italian, Japanese, Korean, Norwegian Bokmål, Persian, Portuguese, Russian, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese translated UI strings are provided out of the box, and we welcome contributions to add more default languages.

The main difference is that the list of languages is now sorted alphabetically but here are the individual changes in the list of languages:

  • NorwegianNorwegian Bokmål
  • FarsiPersian
  • Simplified ChineseChinese

For an easier global review, here are the diffs for each language of the docs site:

en
- English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Hebrew, Simplified Chinese, Korean, Indonesian, Russian, Swedish, Ukrainian, and Vietnamese
+ Arabic, Chinese, Czech, Danish, Dutch, English, French, German, Hebrew, Indonesian, Italian, Japanese, Korean, Norwegian Bokmål, Persian, Portuguese, Russian, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese
de
- Englisch, Tschechisch, Französisch, Deutsch, Italienisch, Japanisch, Portugiesisch, Niederländisch, Dänisch, Spanisch, Türkisch, Arabisch, Norwegisch, Farsi, Hebräisch, Chinesisch (vereinfacht), Koreanisch, Indonesisch, Russisch, Schwedisch, Ukrainisch und Vietnamesisch
+ Arabisch, Chinesisch, Dänisch, Deutsch, Englisch, Französisch, Hebräisch, Indonesisch, Italienisch, Japanisch, Koreanisch, Niederländisch, Norwegisch (Bokmål), Persisch, Portugiesisch, Russisch, Schwedisch, Spanisch, Tschechisch, Türkisch, Ukrainisch und Vietnamesisch
es
- inglés, checo, francés, alemán, italiano, japonés, holandés, portugués, danés, español, turco, árabe, noruego, farsi, hebreo, chino simplificado, coreano, indonesio, ruso, sueco, ucraniano y vietnamita
+ alemán, árabe, checo, chino, coreano, danés, español, francés, hebreo, indonesio, inglés, italiano, japonés, neerlandés, noruego bokmal, persa, portugués, ruso, sueco, turco, ucraniano y vietnamita
ja

Note: I included the entire existing sentence as I did not want to make mistakes while extracting the list of languages.

- 英語、チェコ語、フランス語、ドイツ語、イタリア語、日本語、ポルトガル語、オランダ語、デンマーク語、スペイン語、トルコ語、アラビア語、ノルウェー語、ペルシア語、ヘブライ語、簡体字中国語、韓国語、インドネシア語、ロシア語、スウェーデン語の翻訳済みUI文字列がすでに
+ アラビア語、イタリア語、インドネシア語、ウクライナ語、オランダ語、スウェーデン語、スペイン語、チェコ語、デンマーク語、ドイツ語、トルコ語、ノルウェー語(ブークモール)、フランス語、ベトナム語、ヘブライ語、ペルシア語、ポルトガル語、ロシア語、英語、韓国語、中国語、日本語
fr
- anglais, arabe, allemand, chinois simplifié, danois, espagnol, français, italien, japonais, néerlandais, norvégien, farsi, hébreu, portugais, tchèque, turc, coréen, indonésien, russe, suédois, ukrainien et vietnamien
+ allemand, anglais, arabe, chinois, coréen, danois, espagnol, français, hébreu, indonésien, italien, japonais, néerlandais, norvégien bokmål, persan, portugais, russe, suédois, tchèque, turc, ukrainien et vietnamien
it
- inglese, ceco, francese, tedesco, italiano, giapponese, portoghese, olandese, danese, spagnolo, turco, arabo, norvegese, farsi, ebraico, cinese semplificato, coreano, indonesiano, russo, svedese e vietnamese
+ arabo, ceco, cinese, coreano, danese, ebraico, francese, giapponese, indonesiano, inglese, italiano, norvegese bokmål, olandese, persiano, portoghese, russo, spagnolo, svedese, tedesco, turco, ucraino e vietnamita
id
- Inggris, Ceko, Prancis, Jerman, Italia, Jepang, Portugis, Belanda, Denmark, Spanyol, Turki, Arab, Norwegia, Farsi, Ibrani, Cina (yang disederhanakan), Korea, Indonesia, Rusia, Swedia, Ukraina, dan Vietnam
+ Arab, Belanda, Bokmål Norwegia, Cheska, Dansk, Ibrani, Indonesia, Inggris, Italia, Jepang, Jerman, Korea, Persia, Portugis, Prancis, Rusia, Spanyol, Swedia, Tionghoa, Turki, Ukraina, dan Vietnam
zh-CN

Note: I included the entire existing sentence as I did not want to make mistakes while extracting the list of languages.

- 默认提供了英语、捷克语、法语、德语、意大利语、日语、葡萄牙语、荷兰语、丹麦语、西班牙语、土耳其语、阿拉伯语、挪威语、波斯语、希伯来语、简体中文、韩语、印度尼西亚语、俄罗斯语、瑞典语、乌克兰语和越南语的翻译 UI 字符串
+ 阿拉伯语、波斯语、丹麦语、德语、俄语、法语、韩语、荷兰语、捷克语、葡萄牙语、日语、瑞典语、书面挪威语、土耳其语、乌克兰语、西班牙语、希伯来语、意大利语、印度尼西亚语、英语、越南语和中文
pt-BR
- Inglês, Tcheco, Francês, Alemão, Italiano, Japonês, Português, Holandês, Dinamarquês, Espanhol, Turco, Árabe, Norueguês, Persa, Hebraico, Chinês Simplificado, Coreano, Indonésio, Russo, Sueco, Ucraniano e Vietnamita
+ alemão, árabe, bokmål norueguês, chinês, coreano, dinamarquês, espanhol, francês, hebraico, holandês, indonésio, inglês, italiano, japonês, persa, português, russo, sueco, tcheco, turco, ucraniano e vietnamita
ko

Note: I included the entire existing sentence as I did not want to make mistakes while extracting the list of languages.

- 영어, 체코어, 프랑스어, 독일어, 이탈리아어, 일본어, 포르투갈어, 네덜란드어, 덴마크어, 스페인어, 터키어, 아랍어, 노르웨이어, 페르시아어, 히브리어, 중국어 간체, 한국어, 인도네시아어, 러시아어, 스웨덴어, 우크라이나어 및 베트남어로 번역된 UI 문자열이 기본적으로 제공됩니다.
+ 네덜란드어, 노르웨이어(보크말), 덴마크어, 독일어, 러시아어, 베트남어, 스웨덴어, 스페인어, 아랍어, 영어, 우크라이나어, 이탈리아어, 인도네시아어, 일본어, 중국어, 체코어, 터키어, 페르시아어, 포르투갈어, 프랑스어, 한국어 및 히브리어
tr

Note: This page is using fallback content but I included what it would be if it was translated.

+ Almanca, Arapça, Çekçe, Çince, Danca, Endonezce, Farsça, Felemenkçe, Fransızca, İbranice, İngilizce, İspanyolca, İsveççe, İtalyanca, Japonca, Korece, Norveççe Bokmål, Portekizce, Rusça, Türkçe, Ukraynaca ve Vietnamca
ru

Note: I included the entire existing sentence as I did not want to make mistakes while extracting the list of languages.

- Переводы строк пользовательского интерфейса на английский, чешский, французский, немецкий, итальянский, японский, португальский, голландский, датский, испанский, турецкий, арабский, норвежский, фарси, иврит, упрощенный китайский, корейский, индонезийский, русский, шведский, украинский и вьетнамский языки предоставляются "из коробки"
+ английский, арабский, вьетнамский, датский, иврит, индонезийский, испанский, итальянский, китайский, корейский, немецкий, нидерландский, норвежский букмол, персидский, португальский, русский, турецкий, украинский, французский, чешский, шведский и японский

Copy link

changeset-bot bot commented Nov 1, 2023

⚠️ No Changeset found

Latest commit: 7b163f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Nov 1, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit d546667
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/654d6353e458960008b701e7
😎 Deploy Preview https://deploy-preview-1012--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the 📚 docs Documentation website changes label Nov 1, 2023
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo, this looks great! Was hoping you would find the time to do this.

One thought: should <I18nList /> take a prop to make the first letter uppercase? Something like <I18nList startsSentence />?

In some languages, language names are not uppercased, but we should make it possible to start with a capital letter in e.g. Spanish if the list starts the sentence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is <I18nList /> the clearest name here? Maybe <LanguagesList /> would be clearer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say LanguagesList is more explicit

@Alynva
Copy link
Contributor

Alynva commented Nov 2, 2023

Looks great, but the pt-BR isn't capitalized. But the translation is alright

@Palingenae
Copy link

fr list looks good to me!

@delucis
Copy link
Member

delucis commented Nov 2, 2023

Looks great, but the pt-BR isn't capitalized. But the translation is alright

Thanks @Alynva! Do you mean the start of the sentence or would you expect every word to be capitalized?

Copy link
Contributor

@Genteure Genteure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zh-CN looks great to me! 👍

@Pukimaa
Copy link
Contributor

Pukimaa commented Nov 2, 2023

de lgtm 👍

@Alynva
Copy link
Contributor

Alynva commented Nov 2, 2023

Looks great, but the pt-BR isn't capitalized. But the translation is alright

Thanks @Alynva! Do you mean the start of the sentence or would you expect every word to be capitalized?

Every word, like it's in the original en. Idk if Yan might have a better observation if it should remain without capitalization

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

es LGTM ✅

@kevinzunigacuellar
Copy link
Member

Very creative component ✨ ."es" LGTM!

@ryuapp
Copy link

ryuapp commented Nov 2, 2023

ja LGTM🎈

* main: (22 commits)
  fix(docs-i18n-tracker): update `translations` import (withastro#1025)
  [ci] format
  i18n(zh-cn): Update css-and-tailwind.mdx (withastro#1018)
  [ci] format
  i18n(zh-cn): Update authoring-content.md (withastro#1016)
  i18n(ko-KR): update `configuration.mdx` (withastro#1015)
  i18n(ko-KR): update `sidebar.mdx` (withastro#1014)
  i18n(ko-KR): update `i18n.mdx` (withastro#1013)
  [ci] format
  i18n(ko-KR): update `frontmatter.md` (withastro#1017)
  [ci] format
  i18n(pt-BR): Update `css-and-tailwind.mdx`, `authoring-content.md` and `overrides.md` (withastro#1009)
  [ci] format
  [ci] release (withastro#996)
  Fix Prettier-compatibility of i18n test fixture
  Refactor translation system to be reusable in non-Astro code (withastro#1003)
  Add social icons to mobile menu footer (withastro#988)
  [ci] format
  Add Galician language support (withastro#1004)
  feat: add support for light / dark hero images (withastro#280)
  ...
@yanthomasdev
Copy link
Member

Every word, like it's in the original en. Idk if Yan might have a better observation if it should remain without capitalization

That's a tricky question! TL;DR it shouldn't be capitalized, here's why:

According to the Portuguese Language Orthographic Agreement of 1990 (translated for your convenience):

In names that designate domains of knowledge, courses, and subjects (optionally, also capitalized): portuguese (or Portuguese), mathematics (ou Mathematics); languages and modern literature (or Languages and Modern Literature).

This rule says that the language name can be optionally capitalized when it's in a context related to the study of the language, like school, college, etc. I had originally thought (and that's why the current translation is capitalized) that this could also apply when specifying the available languages (as in, a language you know IS a "domain of knowledge"), but it does not after some research on language forums and official documents. Therefore, it falls back into the base rules of the language, meaning it should be written without capitalization, the same way as most other romance languages.

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pt-BR LGTM

@HiDeoo
Copy link
Member Author

HiDeoo commented Nov 2, 2023

Thanks everyone who jumped in, really appreciated 🙌

I just pushed an update including the following changes:

  • Rename <I18nList/> to <LanguagesList/>
  • Add the startsSentence prop (note that the approach for this does not handle the case where the first character is a surrogate pair, but this should never happen in this specific context)

Note: I think we should maybe merge this when #1028 and #1019 are merged (and any other i18n.mdx translations that may be created until then).

Co-authored-by: Chris Swithinbank <[email protected]>
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I’m satisfied with this code and looks like we’ve got some good feedback to confirm how this will render for other languages.

I merged #1019 but looks like there are a few comments on #1028 we’ll need to wait on.

This PR is probably a fun one to use https://coauthor.kevinzunigacuellar.com/ on.

@HiDeoo
Copy link
Member Author

HiDeoo commented Nov 2, 2023

This PR is probably a fun one to use coauthor.kevinzunigacuellar.com on.

Oh definitely, it's gonna be a fun one 🎉

@liruifengv
Copy link
Member

Amazing work!!!

I've run it locally and it behaves well in Chinese.

@kevinzunigacuellar
Copy link
Member

#1028 merged!

Copy link

vercel bot commented Nov 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Nov 17, 2023 2:41pm

@delucis
Copy link
Member

delucis commented Nov 9, 2023

Heh, inevitably we now have a new PR touching a translation of the i18n guide — #1052.

Let's merge this anyway though and then update that PR. Otherwise we could be waiting a while.

@delucis
Copy link
Member

delucis commented Nov 17, 2023

Merging this! Will leave a comment in #1052 so we remember to update that there.

@delucis delucis merged commit 122b11a into withastro:main Nov 17, 2023
6 checks passed
@HiDeoo HiDeoo mentioned this pull request May 8, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 docs Documentation website changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.