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

Getting language tokens instead of translations #189

Open
imp-dance opened this issue Aug 1, 2023 · 1 comment
Open

Getting language tokens instead of translations #189

imp-dance opened this issue Aug 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@imp-dance
Copy link

Please describe the bug you are seeing

After configuring the plugin like such:

    [
      require.resolve("@cmfcmf/docusaurus-search-local"),
      {
        language: "no",
      },
    ],

With my i18n set to

  i18n: {
    defaultLocale: "nb",
    locales: ["nb"],
  },

I'm not getting the "no" translations, but instead I'm getting the raw translation keys output in the DOM (ex: cmfcmf/d-s-l.searchBar.placeholder)

How can we best reproduce the bug?

By using the following configuration:

   plugins: [
    [
      require.resolve("@cmfcmf/docusaurus-search-local"),
      {
        language: "no",
      },
    ],
  ],
  i18n: {
    defaultLocale: "nb",
    locales: ["nb"],
  },

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

[email protected] /Users/abc/Documents/Projects/xyz
├─┬ @cmfcmf/[email protected]
│ └── @docusaurus/[email protected] deduped
├── @docusaurus/[email protected]
├─┬ @docusaurus/[email protected]
│ └── @docusaurus/[email protected] deduped
├─┬ @docusaurus/[email protected]
│ ├── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ ├─┬ @docusaurus/[email protected]
│ │ └── @docusaurus/[email protected] deduped
│ └─┬ @docusaurus/[email protected]
│   └── @docusaurus/[email protected] deduped
├─┬ @docusaurus/[email protected]
│ └── @docusaurus/[email protected] deduped
└─┬ [email protected]
  └── @docusaurus/[email protected] deduped

Which Node.js version are you using?

v18.1.0

Which theme are you using?

No, I am using a custom theme

How does your plugin config look like?

{
  language: "no",
}

Additional context

I actually also tried changing language to "en", and then doing another build+serve, but that gave me the same results. So I'm guessing my i18n is overriding the plugin config somehow?

@imp-dance imp-dance added the bug Something isn't working label Aug 1, 2023
@FredrikMeyer
Copy link

I get the same error today with the same config. My deps are these:

yarn list v1.22.22
‚îú‚îÄ @cmfcmf/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îú‚îÄ @docusaurus/[email protected]
‚îî‚îÄ @docusaurus/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants