Skip to content

Add Expressive Code missing translations based on Astro Docs - #4160

Merged
delucis merged 4 commits into
mainfrom
armand/add-expressive-code-translations
Aug 28, 2026
Merged

Add Expressive Code missing translations based on Astro Docs#4160
delucis merged 4 commits into
mainfrom
armand/add-expressive-code-translations

Conversation

@ArmandPhilippot

@ArmandPhilippot ArmandPhilippot commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Follow-up on withastro/docs#14460 (comment)

Expressive Code only has English and German translations built-in. Astro Docs has more translations: we should take advantage of this to upstream the missing translations to Starlight.

I only included the missing ones: ar, de, hi, it, ja, ko, pt, zh-CN, and zh-TW.

The following are not included:

And, I haven't checked if the translation are correct... I trust Astro Docs translators. 😅

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f8c73fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@astrojs/starlight Patch
@e2e/basics Patch
@e2e/custom-src-dir Patch
@e2e/git Patch
@e2e/legacy-collections-backwards-compat Patch
@e2e/no-mdx-optimization Patch
@e2e/ssr Patch
starlight-docs Patch

Not sure what this means? Click here to learn what changesets are.

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

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit f8c73fc
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6a908b2324f14600081cc1f4
😎 Deploy Preview https://deploy-preview-4160--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: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

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

@github-actions github-actions Bot added the 🌟 core Changes to Starlight’s main package label Aug 27, 2026
@astrobot-houston

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
/index.html 6.1 KB (0%)
/guides/example/index.html 6.13 KB (0%)
/_astro/*.js 25.44 KB (0%)
/_astro/*.css 14.7 KB (0%)

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome! Thanks for following up on this and taking the time to figure out which ones it made sense to copy.

I only spotted one potential change, although, like you, I can’t judge the translation quality itself. But I also trust the Astro Docs process and these should definitely be better than no translation.

Comment thread packages/starlight/translations/de.json Outdated
@trueberryless

Copy link
Copy Markdown
Contributor

Thanks for the contribution and detailed PR description!

The PR overall looks really solid. However, one thing I noticed were differences between translations of the tooltip: Expressive Code itself uses "Copy to clipboard". According to Deepl, these languages also translate back to "Copy to clipboard": ar, de, es, hi, ja, ko, pl, pt-BR, zh-CN, and zh-TW.

However, these two languages seem to only translate the string "Copy": it, ru.

Russian could easily be fixed by taking over the translation string from Astro docs:

image

For Italian, we might want to get help from a native-speaker from Discord 🤔

ArmandPhilippot and others added 2 commits August 27, 2026 21:07
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@ArmandPhilippot

Copy link
Copy Markdown
Member Author

@trueberryless Yeah, I noticed the difference. However, I don't know what the common usage is in those languages: just because a machine translation tool suggests something doesn't mean it's the expression actually used. Perhaps the concept of a "clipboard" doesn't add any value for them?

But, if we think this is problematic vs falling back to English; I don't mind removing them.

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ArmandPhilippot 🙌

Re: @trueberryless’s last comment — I definitely trust the human translators over machine translation, so I’m happy to accept these and can always tweak based on native speaker feedback if we get some in the future.

@delucis
delucis merged commit 88442c3 into main Aug 28, 2026
16 checks passed
@delucis
delucis deleted the armand/add-expressive-code-translations branch August 28, 2026 10:20
@astrobot-houston astrobot-houston mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants