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

<HeadHrefLangs /> doesn't respect the routes object and showDefaultLocale #65

Closed
itsmatteomanf opened this issue Nov 8, 2022 · 3 comments
Labels
bug Something isn't working released on @beta

Comments

@itsmatteomanf
Copy link

When you have setup the routes object, which works just fine for localised links and paths, the head i18n components don't respect it. It even ignores the showDefaultLocale setting, as setting it false as is the default still adds a suffix of the language on the default locale.

In this basic example, on /it/notizie and /news it should show /news and /it/notizie as alternates, but instead shows:

  • on /news, /en/news and /it/news, missing the current completely and setting the alternate wrong.
  • on /it/notizie, /en/notizie and /it/notizie, missing only the alternate.

If I were to set showDefaultLocale to true, of course the currents are both corrects, but the alternates would be wrong.

https://stackblitz.com/edit/yassinedoghri-astro-i18next-issue-65

@yassinedoghri
Copy link
Owner

Hey @itsmatteomanf, thanks for the issue. I'll try to fix this when I get time 👍

@riywo
Copy link

riywo commented Nov 25, 2022

Debugged a little and confirmed that getAstroI18nextConfig() here returns the default config in <HeadHrefLangs />.

@yassinedoghri yassinedoghri added the bug Something isn't working label Nov 26, 2022
yassinedoghri added a commit that referenced this issue Nov 27, 2022
…ro-i18next runtime config

expose AstroI18next global variable to access runtime config

fixes #65
yassinedoghri pushed a commit that referenced this issue Nov 27, 2022
# [1.0.0-beta.14](v1.0.0-beta.13...v1.0.0-beta.14) (2022-11-27)

### Bug Fixes

* expect locales folder to be in astro's publicDir config by default ([ec72ff3](ec72ff3)), closes [#64](#64)
* import localizeUrl in HeadHrefLangs from index for access to astro-i18next runtime config ([5e3b96c](5e3b96c)), closes [#65](#65)
* **trans component:** import utility functions from index ([eea0d5d](eea0d5d))

### Features

* **plugins:** set i18next plugins config for both server and client side setups ([5ddb1c7](5ddb1c7)), closes [#68](#68)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-beta.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

AliLee0923 pushed a commit to AliLee0923/astro-i18N that referenced this issue Dec 2, 2023
# [1.0.0-beta.14](yassinedoghri/astro-i18next@v1.0.0-beta.13...v1.0.0-beta.14) (2022-11-27)

### Bug Fixes

* expect locales folder to be in astro's publicDir config by default ([ec72ff3](yassinedoghri/astro-i18next@ec72ff3)), closes [#64](yassinedoghri/astro-i18next#64)
* import localizeUrl in HeadHrefLangs from index for access to astro-i18next runtime config ([5e3b96c](yassinedoghri/astro-i18next@5e3b96c)), closes [#65](yassinedoghri/astro-i18next#65)
* **trans component:** import utility functions from index ([eea0d5d](yassinedoghri/astro-i18next@eea0d5d))

### Features

* **plugins:** set i18next plugins config for both server and client side setups ([5ddb1c7](yassinedoghri/astro-i18next@5ddb1c7)), closes [#68](yassinedoghri/astro-i18next#68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @beta
Projects
None yet
Development

No branches or pull requests

3 participants