You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the moment, in order to be SEO compliant, we need to use prefix strategies, making the URLs a bit long (https://mydomain.com/en/meowmeow). Even if there are strategies that can avoid /en/ if it's the default language, it will still be displayed for others locales.
That's why I suggest the implementation of the query strategy. Using it, my previous URL would looks like https://mydomain.com/meowmeow?i18n=en, making it shorter. It could even write the language into the i18n cookie, and therefore avoid needing it after.
For the moment, I tried to add a middleware and the no_prefix strategy, but even if it can correctly detect the query parameter and save it for later, it's unfortunately not SEO compliant because useLocaleHead is not handling it as I would like (which is normal ofc).
I wonder how much work it could take. Because I make this suggestion, I may handle it, but I guess adding strategies is a big stuff, so maybe I would need help. But in summary, it's an extension of the no_prefix strategy to have something SEO compliant.
Regarding the specs, I imagined:
When no query is passed: work as the no_prefix (depending of the config module), in order to detect user language, then store it in a cookie
Else, translate the page as requested, and save/override the language using the cookie (if set).
In useLocaleHead, we'll need to remove all the query + add this one.
The query parameter must be configurable (to be locale, i18n, lang, etc)
The query parameter would always be present when using NuxtLinkLocale and useLocalePath. Dev can remove it by avoid using both of them.
Because this strategy doesn't use any prefix, it'll need several changes to handle it correctly, but I think I could take care of that.
Thanks for reading me!
Additional information
Would you be willing to help implement this feature?
Could this feature be implemented as a module?
Final checks
Read the contribution guide (The contribution guideline of nuxt-modules/i18n is compliant with Nuxt too).
Describe the feature
For the moment, in order to be SEO compliant, we need to use prefix strategies, making the URLs a bit long (https://mydomain.com/en/meowmeow). Even if there are strategies that can avoid
/en/
if it's the default language, it will still be displayed for others locales.That's why I suggest the implementation of the
query
strategy. Using it, my previous URL would looks like https://mydomain.com/meowmeow?i18n=en, making it shorter. It could even write the language into the i18n cookie, and therefore avoid needing it after.For the moment, I tried to add a middleware and the no_prefix strategy, but even if it can correctly detect the query parameter and save it for later, it's unfortunately not SEO compliant because useLocaleHead is not handling it as I would like (which is normal ofc).
I wonder how much work it could take. Because I make this suggestion, I may handle it, but I guess adding strategies is a big stuff, so maybe I would need help. But in summary, it's an extension of the
no_prefix
strategy to have something SEO compliant.Regarding the specs, I imagined:
no_prefix
(depending of the config module), in order to detect user language, then store it in a cookieuseLocaleHead
, we'll need to remove all the query + add this one.locale
,i18n
,lang
, etc)NuxtLinkLocale
anduseLocalePath
. Dev can remove it by avoid using both of them.Because this strategy doesn't use any prefix, it'll need several changes to handle it correctly, but I think I could take care of that.
Thanks for reading me!
Additional information
Final checks
The text was updated successfully, but these errors were encountered: