Page 1 of 1

Problems on file download on multi lingual site

Posted: 09 Feb 2017, 19:28
by phil2000
Hi. I use Phoca downlaod with Phoca Download Plugin to download files directly from link, something like {phocadownload view=file|id=10}.

Plugin works perfectly on english language, don't works on italian language (get message: Unable to reach the site, in few words bad link)

In other threads you wrote:
Hi, it is like by Joomla! you need to create e.g. two instances of one file - e.g. File A (german), File B(english). Both then can be assigned to one filename on the server.
Two considerations:
  1. If Phoca Download is like by Joomla... if I create a Category "programs" set for all languages and file items set for all languages... {phocadownload view=file|id=xx} should have to work in all languages... it does'nt work: works only for the english language.
  • Anyhow I have created two categories: "Programs" set in english lang and "Programmi" set in italian lang.
    Then I have created two file items for each file to download (obviously with different IDs): the one set in english lang that refers to "Programs" and the other set in italian lang that refers to "Programmi": the english download by {phocadownload view=file|id=1} works. The italian link {phocadownload view=file|id=2} doesn't work!
So what to do? Thank you.

Re: Problems on file download on multi lingual site

Posted: 10 Feb 2017, 14:10
by Jan
Hi, do the files have the same language as the category?

What you exactly mean with: {phocadownload view=file|id=2} does now work? Do you get any error message when downloading?

Jan

Re: Problems on file download on multi lingual site

Posted: 10 Feb 2017, 15:10
by phil2000
Jan wrote:Hi, do the files have the same language as the category?
Files are .exe installers of some .NET programs of mine. Language is not influential.
Jan wrote:What you exactly mean with: {phocadownload view=file|id=2} does now work? Do you get any error message when downloading
Already said... get message: Unable to reach the site (in few words not recognized link). The suffix "mysite.com/it/..." in the file link address is not recognized even if the category is a italian lang one and the file is set to italian lang.

Atm I have solved the problem modifying the phocadowlaod.php plugin file, adding two lines before the link code:

Code: Select all

	$full_link = JRoute::_($link);
	$full_link = str_replace("/it/", "/en/", $full_link);
	$output .= '<div class="phocadownloadfile'.(int)$iSize.'"><a href="'. $full_link.'................" 	
Replacing /it/ with /en/ the download link works with the categories and files languages set to "all" both in the english and in the italian pages, without having to create duplicates of categories and files for any language.

IN EFFECT if I have to download a TEXT file in the site selected lang, is evident that I have to create a file lang for any language of the site.

But if I have to download a installer... setting category and file languages to ALL... I would have to downlaod it with the same code: {phocadownload view=file|id=10} put in ALL the Joomla articles, whatever lang is set for the site.

Unfortunately the code DOES'NT WORK (if not corrected) except that in english pages (note that the original lang of OS and browser is the italian one).

Re: Problems on file download on multi lingual site

Posted: 10 Feb 2017, 23:19
by Jan
Hi, can I see it somewhere live? For now I don't have any experiences with error "Unable to reach the site"?

Jan