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 sidebar label translations examples to use tags with regional subtags #881

Merged

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Oct 12, 2023

What kind of changes does this PR include?

  • Changes or translations of Starlight docs site content

Description

This pull request is an attempt to improve the documentation regarding the translation of sidebar labels following this issue on Discord. The scenario is the following:

  • A user wants to translate some sidebar labels to some language, in this case, Brazilian Portuguese.
  • After checking the sidebar guide and the Configuration Reference, they use the following configuration:
{
  label: 'Getting Started',
  translations: { 'pt-br': 'Introdução' },
  link: '/getting-started',
}

Altho, this configuration does not translate the sidebar link label due to the fact that the key of the translations object should use a BCP-47 tag as key, which would be pt-BR in this case while the user thought it should be pt-br and match their file system structure.

To improve this, this PR proposes the following changes:

  • Sidebar guide
    • Explicitely mention that a BCP-47 language tag should be used as key with some examples
    • Update the example to translate to Brazilian Portuguese instead of Spanish
  • Configuration Reference
    • Update the example to translate to Brazilian Portuguese instead of French

@changeset-bot
Copy link

changeset-bot bot commented Oct 12, 2023

⚠️ No Changeset found

Latest commit: 3a64482

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

@netlify
Copy link

netlify bot commented Oct 12, 2023

👷 Deploy Preview for astro-starlight processing.

Name Link
🔨 Latest commit 3a64482
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/652ba0353c76770008bcfccd

@github-actions github-actions bot added the 📚 docs Documentation website changes label Oct 12, 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.

This is great — thank you @HiDeoo!

Let’s hold off before merging this — I’d love to get a few outstanding translation PRs in before.

HiDeoo and others added 2 commits October 12, 2023 23:25
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
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.

Lovely! Merge whenever you like @HiDeoo 🌟

@HiDeoo HiDeoo merged commit fd4aa63 into withastro:main Oct 15, 2023
9 checks passed
@HiDeoo HiDeoo deleted the hd-docs-sidebar-guide-translations-bcp-47 branch October 15, 2023 08:23
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Oct 15, 2023
* main: (42 commits)
  docs: refactor sidebar label translations examples to use tags with regional subtags (withastro#881)
  Add Nostalgist.js docs to showcase (withastro#900)
  i18n(id): Fix environmental-impact.md translation (withastro#899)
  i18n(es): Update `customization.mdx`, `i18n.mdx` & `configuration.md` (withastro#897)
  i18n(ko): update `configuration.md` (withastro#896)
  i18n(ko): update `i18n.mdx` (withastro#895)
  i18n(ko): update `customization.mdx` (withastro#894)
  [ci] format
  i18n(id): translate guides/components.mdx and guides/project-structure.mdx (withastro#898)
  [ci] format
  [ci] release (withastro#865)
  Add Patreon social link (withastro#892)
  [ci] format
  Add Ukrainian language support (withastro#891)
  i18n(id): Translate more pages and improve existing translations (withastro#859)
  [ci] format
  feat: add Reddit social icon (withastro#854)
  [ci] format
  i18n(ru): added translations for components, css-and-tailwind, environmental-impact, project-structure pages (withastro#888)
  i18n(id): translate `guides/authoring-content.md` (withastro#863)
  ...
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Oct 15, 2023
delucis added a commit that referenced this pull request Oct 15, 2023
* docs: refactor social links configuration reference

* docs: update supported link icons wording

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* chore: add changes from #881

* chore: fix eof newline

---------

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
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.

3 participants