strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.

Home Page:https://market.strapi.io/plugins/strapi-plugin-slugify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Localized slug bug?

Neyunse opened this issue · comments

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": {} 
  }
}

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.

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?

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

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 👍🏻

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