Jump to content

$file->description always returns default language


Hurme
 Share

Recommended Posts

Hi,

I was making a multi language site with download section that would automatically list files based on language. I was going to check if $file->description had any content on current language, but this does not work as it always returns the default language even when different language is selected.

Example:

Site has three languages, english (default), french and german.

document_en.pdf | en desc "lorem ipsum" | fr desc "" | de desc ""

document_fr.pdf | en desc "" | fr desc "lorem ipsum" | de desc ""

document_de.pdf | en desc "" | fr desc "" | de desc "lorem ipsum"

It would iterate through all of these and only return the documents that had description in current language.

Problem is it will always return document_en.pdf no matter which language is selected. For french and german it correctly only shows them according to the language.

Currently using PW version 3.0.95.

 

Link to comment
Share on other sites

Hi,

I solved the issue by making using the tags option in the files field and by disabling the multi language description altogether. I had read about the language-alternate fields, but had forgotten about them by the time I was doing this site. So cheers for the reminder. ?

I still think the file fields description is behaving in a not so logical way. Luckily it's a problem you can easily get around in multiple ways.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...