Skip to content

Issue with translating of "Copy to clipboard" text #1707

@dragomano

Description

@dragomano

What version of starlight are you using?

0.21.3

What version of astro are you using?

4.5.14

What package manager are you using?

pnpm

What operating system are you using?

Windows

What browser are you using?

Vivaldi, Firefox

Describe the Bug

I've created i18n\root.json with translations of Expressive Code labels in Russian.
Then, I've updated astro.config.mjs with this text:

export default defineConfig({
  integrations: [
    starlight({
      title: 'My Docs',
      defaultLocale: 'root',
      locales: {
        root: {
          label: 'Русский',
          lang: 'ru',
        },
      },
    }),
  ],
});

But it does not help - there is no translation for "Copy to clipboard" button.
Then I've added en locale to config:

locales: {
  root: {
    label: 'Русский',
    lang: 'ru',
  },
  en: {
    label: 'English',
    lang: 'en',
  },
},

And now I have a translation of "Copy to clipboard" text in Russian. But I do not want to have language switcher in the navbar. I want to have only Russian locale on my site. Is this a bug or a feature? :)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-tqaa8v?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions