Jump to content

Can't 'Find Files to Translate' (returns 'Object of class DirectoryIterator could not be converted to boolean' error) [SOLVED]


Jest
 Share

Recommended Posts

Hi all,

the site is in non-English language and uses some modules which needs to be translated. Since the content is not multilingual I've installed only the LanguageSupport. I added another language, but can't translate any string since the Admin > Setup > Languages > [en/xx] > Find Files to Translate always returns an error "Object of class DirectoryIterator could not be converted to boolean" and a standard "The process returned no content." text.

I've checked the /site/assets/files/[lang id] folder permissions, even chmoded folder and its contents to 777, to no avail. If I manually create the json translation file and then upload it via the admin everything works as expected (I can see the file in the 'Site/Core Translation files' list, I can edit it, and the translation shows up).

Can somebody point me in the right direction? Am I missing something?

The PW version is 3.0.123. I've setup a few PW multilingual sites with ease, that's why this issue confuses me even more.

Thanks,

Jan

Link to comment
Share on other sites

  • 2 weeks later...

Hah, traced the error to the /wire/modules/LanguageSupport/ProcessLanguageTranslator.module where line 671 contains:

if(!$dirIterator) return array();

Played around a little and noticed when I change the statement to this:

if($dirIterator != false) return array();

The error doesn't show up, but the list of translatable files is still empty.

I googled this strange behavior and found out it's a bug in PHP. Which was fixed in version 5.6.17. Which reminded me I am not really sure which PHP version I am using atm. It was 5.4 ? (but PW requirements state required PHP version is 5.4 or newer...?)

Tested on 7.2, works ?

Lesson learned (again): when something is fishy, first check the basics ?

  • Like 2
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

×
×
  • Create New...