Search
Other Articles Anywhere questions
Forum

Multi language challenge

Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Hey Peter,

Is there an option or creative workaround to make an article tag automatically display the article in the correct, active site language based on the multi language associations?
Peter van Westen's Avatar Peter van Westen ADMIN
I can't think of one, if only the multi-language association is connecting them.
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Well, in fact that's what you need. And an article id obviously. But that could be the id of an article in any of the available languages. Based on the association, you can retrieve the article whose id is specified, or an associated article in the proper language. I am quite confident you can pull that off 😁
Peter van Westen's Avatar Peter van Westen ADMIN
I am struggling to see how you would use this with Articles Anywhere.

Can you give an example?

So do you mean that if you place something like:
{article alias="bicycle" multilingual="true"}[title]{/article}
That it would output "Fiets"? (The title of the Dutch article associated with the English article "Bicycle".)
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Yes, that is exactly what I mean. Looking at three associated articles with ids X, Y and Z and the aliases "bicycle," "bike" and "bicicleta" respectivey, each of the following Articles Anywhere constructs would display the article whose language is set to the same language as the the active site language:
{article id="X" multilingual="true"}[title]{/article}
{article id="bicicleta" multilingual="true"}[title]{/article}

{article id="Y" multilingual="true"}[title]{/article}
{article alias="fiets" multilingual="true"}[title]{/article}

{article alias="Z" multilingual="true"}[title]{/article}
{article alias="bicycle" multilingual="true"}[title]{/article}
Peter van Westen's Avatar Peter van Westen ADMIN
This seems simple, but it is pretty impossible to implement in a workable way.
If you take into account all other possible filters and how this all influences each other...

This is mostly because the isn't a one-to-one connection here.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
Just to show you a bit of the complexity:

Articles Anywhere will check for the publish state and dates via the database queries.
So any unpublished articles won't show (unless you specifically tell it to ignore the state).

Now what if the English "Bicycle" article is published, but the Dutch "Fiets" is not. Or the other way round?

Articles Anywhere will check the language via the queries.
So only article that use the current language or all (*) will show.

So that will by default already ignore the articles not using the current language. Meaning that now you want some filters to be applied on the article specified in the id/alias/title filter. And other filters applied on the associated article.

Then there are articles that don't use associations, or have no associated article for the article you are filtering on.
Articles Anywhere will therefore not know in a simple way when to apply what filters to what.
Also it doesn't know what the original language of the associated article is.

Imagine using wildcard filters, like title="A*".

So this one 'little' request would pretty much mean making the code 3 times more complex and layered. And it would probably mean a complete rewrite.
Not something I want to do.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
PS: I didn't even touch on things like figuring out the database joins (to get data from categories, custom fields, etc), and the multiple {articles} tag, where you could potentially do things like title="Car,Fiets,Autobús".
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Maybe naive, but I always assume someone who builds websites and uses your tools, knows what he/she/whatever is doing. So if one tries to display an associated article that does not "exist" as a result of any of the reasons you describe, it is not your concern as the tool developer.

As for figuring out joins and such, once again I'm quite confident you can pull that off 😁

But other than that I can imagine it's complex and you don't want to burn your hands on that (is that even a proper translation of a Dutch proverb?).
Peter van Westen's Avatar Peter van Westen ADMIN
As said, not something I will be implementing.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription