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

Customize the url based on locale #87

Open
jphilung opened this issue Mar 8, 2023 · 6 comments
Open

Customize the url based on locale #87

jphilung opened this issue Mar 8, 2023 · 6 comments

Comments

@jphilung
Copy link

jphilung commented Mar 8, 2023

I need to localize my urls as some parts of my path are localized, e.g.

{
  published: {
    url: 'http://localhost:3000/{locale}/movie/{slug}',
    url: 'http://localhost:3000/{locale}/film/{slug}',
  },
}

How could I easily handle this case ?

@Shekhar-Zealous
Copy link

I am looking for a same solution here.
@mattmilburn Is there any solution to achieve this?

@mattmilburn
Copy link
Owner

Hi @jphilung @Shekhar-Zealous Have you tried extending the plugin as described in the Extending section of the docs? This let's you modify the URL at run time while having access to the current entity data, which would include the locale.

@Shekhar-Zealous
Copy link

@mattmilburn The extended solution hook isn't working from my side which I have already mentioned here #69 (comment).
Can you please help here.
Thanks

@ectuser
Copy link

ectuser commented Aug 3, 2023

Hi @mattmilburn . Thank you for developing this project.

I've also done all the steps mentioned in the docs to extend logic via the hook. Unfortunately, it also did not work for me. It seems like this hook has no effect on the url.

If you have, can you please provide some working example project where this hook works?

Thank you

@mattmilburn
Copy link
Owner

Hi @jphilung @Shekhar-Zealous @ectuser This plugin has now been upgraded to version 2.0.0 with breaking changes to the configuration and a lot of improvements behind the scenes.

I believe this upgrade should resolve the issues you are having with the plugin's custom hook. Please let me know how it goes for you and see the migration guide before upgrading.

Please note this upgrade does not yet include support for populating relations into the URL (eg. using {category.slug} but that feature will be implemented in another update in the future.

@Shekhar-Zealous
Copy link

@mattmilburn Thanks for the reply.
I'll be waiting for the future update which can include relations.

But as of now, I was in a bit hurry for the project development and my requirement was a bit dynamic so I have to create a plugin of my own just to fulfill the project requirement.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants