I have the following blog slug for my listing page: `.../blog`.
When a user clicks on a blog from the listing page, the URL for the blog post will be: `.../blog_name_here`. Notice how "blog" is not in the URL anymore.
When a user changes the language to, lets say, French, I want the URL for the listing page to be: `.../fr/blog`.
I can achieve this by creating another blog, but I don't want to create another blog because; If a user creates a blog post on the global blog (`.../blog`), I do not want the user the clone the blog to the French blog (`.../fr/blog`) and change it's URL to add the `fr`. I want the process to be automated.
What I've tried:
I came across this article here which, I believe, is a possible solution to this issue. I have built the module in my post template:
But, I cannot make sense of how this works? From my understanding it looks at the url to see if there was another language other than the global one being used?
In which case, does this even solve my issue? If not, how can I approach this?