PWaddict Posted July 16, 2017 Share Posted July 16, 2017 I transferred a site from localhost (XAMPP Windows) to a live server (Linux) and it's impossible to edit the translations files. When I try to edit for example the LanguageSupport.module I'm getting this error: Session: File does not exist: /wire\modules\LanguageSupport\LanguageSupport.module (translation file not needed? textdomain: wire--modules--languagesupport--languagesupport-module) I'm guessing the issue is caused because of the slashes: On localhost the paths for translation files are using backslashes:\wire\modules\LanguageSupport\LanguageSupport.module while on a live server the paths are using forward slashes:/wire/modules/LanguageSupport/LanguageSupport.module Link to comment Share on other sites More sharing options...
Sergio Posted July 16, 2017 Share Posted July 16, 2017 Strange, I didn't have this problem after migrating from Mac to Windows (the other way around). But try uninstalling and installing the module again. Link to comment Share on other sites More sharing options...
PWaddict Posted July 16, 2017 Author Share Posted July 16, 2017 But if I uninstall the Language Support module all the language related values will be gone from everywhere. A temporary solution is to delete all the translations files and find them again. Link to comment Share on other sites More sharing options...
Sergio Posted July 16, 2017 Share Posted July 16, 2017 As far as I know, all translations are kept as json files on assets/files folder. I don't think they will be deleted if you uninstall the module. Give it a try but backup the json files first. Link to comment Share on other sites More sharing options...
PWaddict Posted July 16, 2017 Author Share Posted July 16, 2017 In order to uninstall LanguageSupport.module I have to first uninstall LanguageSupportFields.module, LanguageSupportPageNames.module and LanguageTabs.module and PW won't let me uninstall the LanguageSupportFields.module because there are fields with multi-language values. Link to comment Share on other sites More sharing options...
PWaddict Posted July 16, 2017 Author Share Posted July 16, 2017 I found the solution. I have to replace the slashes on each file value from the json files for each language. This is from localhost: "file": "wire\\modules\\LanguageSupport\\LanguageSupport.module", Must be changed to this in order to work on the server: "file": "wire\/modules\/LanguageSupport\/LanguageSupport.module", The funny thing is that I changed them on localhost too and they working fine. So the question is why on localhost have been used the 2 backslashes instead of the 1 backslash and 1 forward slash? Link to comment Share on other sites More sharing options...
BitPoet Posted July 17, 2017 Share Posted July 17, 2017 9 hours ago, PWaddict said: The funny thing is that I changed them on localhost too and they working fine. So the question is why on localhost have been used the 2 backslashes instead of the 1 backslash and 1 forward slash? PHP's path-related functions return the native directory separator between directories. Since the backslash is also the escape character, it has to be escaped itself to be recognized as a backslash, hence the double backslashes. The backslash in front of the forward slash, while it does no harm, isn't necessary. Link to comment Share on other sites More sharing options...
matjazp Posted July 17, 2017 Share Posted July 17, 2017 Is this commit https://github.com/processwire/processwire/commit/faf1efc0495704c21b373dd424ce57df45605970 related to this? 1 Link to comment Share on other sites More sharing options...
PWaddict Posted July 17, 2017 Author Share Posted July 17, 2017 4 hours ago, matjazp said: Is this commit https://github.com/processwire/processwire/commit/faf1efc0495704c21b373dd424ce57df45605970 related to this? I think so! I will wait for the next dev release to test it. Link to comment Share on other sites More sharing options...
PWaddict Posted July 21, 2017 Author Share Posted July 21, 2017 On 7/17/2017 at 11:13 AM, matjazp said: Is this commit https://github.com/processwire/processwire/commit/faf1efc0495704c21b373dd424ce57df45605970 related to this? I've tested the new 3.0.68 version and the problem still exists. I have to manually replace the slashes. Link to comment Share on other sites More sharing options...
matjazp Posted July 25, 2017 Share Posted July 25, 2017 Try adding this: if(DIRECTORY_SEPARATOR != '/') $data['file'] = str_replace(DIRECTORY_SEPARATOR, '/', $data['file']); To /wire/modules/LanguageSupport/LanguageTranslator.php to public function saveTextdomain(), right after $data = $this->textdomains[$textdomain]; Link to comment Share on other sites More sharing options...
PWaddict Posted July 25, 2017 Author Share Posted July 25, 2017 9 hours ago, matjazp said: Try adding this: if(DIRECTORY_SEPARATOR != '/') $data['file'] = str_replace(DIRECTORY_SEPARATOR, '/', $data['file']); To /wire/modules/LanguageSupport/LanguageTranslator.php to public function saveTextdomain(), right after $data = $this->textdomains[$textdomain]; Same problem. Link to comment Share on other sites More sharing options...
matjazp Posted July 25, 2017 Share Posted July 25, 2017 You should resave your translations first. Or try with new translation. Link to comment Share on other sites More sharing options...
PWaddict Posted July 25, 2017 Author Share Posted July 25, 2017 7 minutes ago, matjazp said: You should resave your translations first. Or try with new translation. I did that and it auto replace the slashes properly but at the same time it erased my translations strings. But that was already happening before editing the public function saveTextdomain(). 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