By Nikolopoulos Angelos on Tuesday, 10 September 2019
Posted in General Issues
Replies 8
Likes 0
Views 548
Votes 0
Hello,

I understand why permalinks need to be unique - but when running a multilingual website it would made sense to allow the same permalinks between the associated posts of the languages.

So is there a work-around for this?
Unfortunately that is not possible to achieve this, but you can try consult with Falang extension developer and see whether they can able to achieve this regarding with your current requirement.

If I recall correctly how this Falang extension work is you do not need to manually create another article post for associate with your main post with different langauge.

What you need to do is manually translate those blog content under Falang extension under different language so it will automatically render those translated content when you view on different site language for that blog post.
·
Tuesday, 10 September 2019 16:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi - thanks for the prompt reply.
Unfortunately Falang is not an option - but I guess I would be able to live with the permalinks not being able to be the same between languages.

However, I just realized/noticed another issue.

While in Edit Post screen - when I click on the permalink to visit the post in the front-end, it disregards the language of the post. It always to default to the English language - and the worst of all is that I realized that EasyBlog allows any post of whatever language to be accessed through any language subdirectory.

So an english post can be accessed in both ways like this:
/en/blog/research
/gr/blog/research

And a greek post can be accessed in both ways like this:
/en/blog/research-1
/gr/blog/research-1

This seems really bad...

Any thoughts?
·
Tuesday, 10 September 2019 16:37
·
0 Likes
·
0 Votes
·
0 Comments
·
It seems like I can't replicate this issue in my locally, it would be best if you can update your site backend and FTP access at https://stackideas.com/dashboard/site so we can better have a check.

By the way, this is what I tested :

1. You have to create 2 Easyblog - frontpage menu item for English and German language.

2. Then associated these menu item together. https://take.ms/TNxSk

3. If you click the permalink from the composer page, it will open the blog post base on the blog language.

4. You unable to access those German blog post in English site page.
·
Tuesday, 10 September 2019 17:40
·
0 Likes
·
0 Votes
·
0 Comments
·
OK - thanks let me test.
·
Tuesday, 10 September 2019 17:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Well, creating the 2 easyblog frontpage menu items doesn't improve things. Actually I think you haven't understand what the issue is.

So the issue is that let's say I have a post with permalink "english-post-1" assigned in english language.
I have 2 languages in the site. So the site URLs are example.com/en and example.com/el
and I can access the blog section via:
example.com/en/blog for the english posts and example.com/el/blog for the gr posts.

Now for the above "english-post-1" post - I can access it via both languages URLs.
So both example.com/en/blog/english-post-1 and example.com/el/blog/english-post-1 work for the same article, although it is only in english.
This as you may realize is a HUGE problem.

By the way, I this is very easy to replicate.
I just did it on a fresh Joomla 3.9.11 multilingual installation and easy-blog.
·
Tuesday, 10 September 2019 20:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for took your time to explain more details how to reproduce this issue again, I can able to replicate this issue in my locally and I will log into issue tracker.
·
Wednesday, 11 September 2019 15:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi again...

For now I have implement a workaround as a temporary solution until you come out with a fix for this.
I will post my workaround here just in case it's at all useful to anyone.

In my case I only need entry's view.html so I modified the corresponding view file, the display method.
What I do is checking if the current post language is different than the current site's language.
If they are, then I redirect the site for the same post using the post's actual language.

So here is the piece of the code in the display method. This goes right after checking for the $id.


// Temporary Workaround to prevent posts of 1 language to be shown in other languages
// We check this after we have confirmed there is a post id, as if not we need to throw a 404.

// If multilingual is enabled
if ($this->input->app->getLanguageFilter())
{
// If current post's language has different language than the current site's language
if ( $post->language !== $this->input->get('language'))
{
// Get language URL code for the language the post is assigned
$languages = JLanguageHelper::getLanguages('lang_code');
$languageCode = $languages[ $post->language ]->sef;

// Check if there is an Itemid set
$itemid = $this->input->get('Itemid', '', INT) != '' ? '&Itemid='.$this->input->get('Itemid', '', INT) : '';

// Build the new URL to redirect to the correct language for the current post
$redirect = 'index.php?option=com_easyblog&view=entry&id=' . $id . $itemid . '&lang=' . $languageCode;

// Redirect
$this->input->app->redirect(JRoute::_($redirect, false));
}
}
·
Wednesday, 11 September 2019 18:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for getting back to us you found a workaround solution for this and shared to everyone here.
·
Thursday, 12 September 2019 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post