strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.
https://market.strapi.io/plugins/strapi-plugin-slugify
MIT License
45 stars 21 forks source link

Localized slug bug? #25

Closed Neyunse closed 2 years ago

Neyunse commented 2 years ago

I note that if I enter the translated slug it does not find it, I think it would be a good idea to include this.

Example: /api/slugify/slugs/article/dogs

{
  "data": {
    "id": 1,
    "attributes":{
      "title": "LIttle dogs",
      "slug": "dogs",
      //....
    }
  }
}

Localized Example /api/slugify/slugs/article/perros

{
  "data": null,
  "error": { 
    "status": 404, 
    "name": "NotFoundError", 
    "message": "Not Found", 
    "details": {} 
  }
}
ComfortablyCoding commented 2 years ago

Hello @Neyunse ,

Thank you for the suggestion but I dont see valid use case for this. Strapi CMS already supports localized entries, is their a reason you cannot create a localized entry for this record?

Checking every possible language permutation on the fly could be quite memory intensive.

Neyunse commented 2 years ago

Hello @Neyunse ,

Thank you for the suggestion but I dont see valid use case for this. Strapi CMS already supports localized entries, is their a reason you cannot create a localized entry for this record?

Checking every possible language permutation on the fly could be quite memory intensive.

I have localized entries with strapi, but the plugin doesn't detect the localized slug. Maybe this is a bug?

ComfortablyCoding commented 2 years ago

For localized content if the locale parameter is not provided it will use the default one.

If you add the locale parameter to the end of the request it should work.

i.e. /api/slugify/slugs/article/perros?locale=es

Neyunse commented 2 years ago

For localized content if the locale parameter is not provided it will use the default one.

If you add the locale parameter to the end of the request it should work.

i.e. /api/slugify/slugs/article/perros?llocale=es

Work thanks 👍🏻

alexcho267 commented 2 years ago

Is there a way to use this pattern to pass the locale in GraphQL or is it only for the REST api?