To not confuse anyone, the method we have selected for multilingual content is what I call instanced.
This means that we do a new id for each language rather than an array for a multitude of languages with a multitude of either fields or an extra database that stores the content. The more I think of it, the more I still want it to stay like this. The method is set for this version anyway.
I have put a lot of focus to solve this from just working occationally to fully stable.
Until a few patches ago we used to have a lot of random crashes when switching language between language content and in general when dealing with languages in subfolder levels, many issets etc etc..
This problem have had many layers to it.
My first and most important issue was to solve direct linking to a non system default language content instance.
News item 11 are in Swedish, someone links this, the system Language is English, when you visited the link, our system would fall back to News index since it could not find News item 11 under English.
Sure, we can say that an array would solve it, but in fact it would only solve it partially. It would solve the ID of the news item but I would still need to manually change the language unless I link the ?lang=XXX switch.
Unless we use a permalinks with like news/LANG/xxxxxx however that are, to me not so pretty either when the new perma link system can root everything like /MY-fancy-news-item ( regardless of Language ). Not to mention that it looks really silly for people with no permalink options.
Naturally, if a webmaster would like to keep any section non instanced they can simply turn the MLT Tables off in the Administration for each section.
Admin Dashboard > Settings > Language Settings > Tables with multilanguage content.
The solution I have is the hub that I have integrated.
The hub will detect and redirects directly to the correct language if a match is found.
We can also optimise this to a integrated version that acts directly with in the requested content´s query's further on.
// This part still need some tinkering, seems to only be an issue with subdirs Involved..
When it came to the linking issues depending on directory, issets etc it was depending on
FUSION_QUERY, we need that to repeat position when initiating a language switch.
Even if it is instanced we need to remain in the correct area, such as forum, articles etc.
When we do it like that we also often echoed the basepath twice, crashing the whole function with double base paths.
I simply patched that with a replacement of nothing from the system´s site path, it seems to have taken care of these issues as well.
$link_prefix = str_replace($settings['site_path'], "", $link_prefix);