alec Posted September 3, 2016 Share Posted September 3, 2016 Hello everyone. I have strange things happening when I want to edit Site translation files. When I try to edit files I got error: " Session: File does not exist: /site\templates\include\footer.inc (translation file not needed? textdomain: site--templates--include--footer-inc) " Here I noticed strange division on left. Somehow it is change direction. Can anyone explain to me why this is happening, and can cause this error? Link to comment Share on other sites More sharing options...
bombemedia Posted March 29, 2017 Share Posted March 29, 2017 I had the same problem. Open your translation file in /site/assets/files/**ID of the language** My file link was { "file": "site\\templates\\home.php", "textdomain": "site--templates--home-php", ... and I deleted the entry in database, changed file name so it created a new one and it corrected to : { "file": "site\/templates\/home.php", "textdomain": "site--templates--home-php", ... You can edit your translation files manually. Now I can edit the translations :) Link to comment Share on other sites More sharing options...
OLSA Posted May 18, 2018 Share Posted May 18, 2018 On 3/29/2017 at 12:16 AM, bombemedia said: My file link was { "file": "site\\templates\\home.php", "textdomain": "site--templates--home-php", Expand Hello, also the same problem (ProcessWire 3.0.98 ), and solved it with this script. Maybe it looks dangerous (overwriting translation files) but it's solve my problem. /* This script iterate over json translation files and replace 'file' path separator to "\/". If you want to try it - place it in some template and reload page with that template. After fix, delete this script. */ foreach($languages as $language){ $path = $config->paths->files . $language->id; $files = preg_grep('~\.(json)$~', scandir($path)); if( count($files) ){ foreach($files as $file){ // file path $file_path = $path . DIRECTORY_SEPARATOR . $file; // load file $contents = file_get_contents($file_path); // decode JSON data into a PHP array $contentsDecoded = json_decode($contents, true); if (strpos($contentsDecoded['file'], '\\') !== false) { $contentsDecoded['file'] = str_replace('\\', '/', $contentsDecoded['file']); // encode array back into a JSON string and prettify $json = json_encode($contentsDecoded, JSON_PRETTY_PRINT); // save file file_put_contents($file_path, $json); } } } } Regards. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now