Not a bug

Symptoms

Some hosting providers, like Pantheon, have very strict security and follow the best recommended practices for deploying a WordPress sites.
These hosting providers secure their instances and allow write permissions by the web server to only the uploads folder.
If you are using such hosting provider, then the new method of translating with String Translation, will create issues for you – because the server itself and WPML String Translation will not be allowed to write in the folder /wp-content/languages/ and the folders in the folder tree beneath that.

Workaround

To fix the issue and have everything working, you should re-define the folder for languages of WordPress (normally located in /wp-content/languages/ )

For Pantheon hosting, you can do that by adding this code to wp-config.php

define( 'WP_LANG_DIR', $_SERVER['HOME'] .'/files/languages' );

We suggest to add this code after:

    /** Define appropriate location for default tmp directory on Pantheon */
    define('WP_TEMP_DIR', $_SERVER['HOME'] .'/tmp');

You can try then to go to Dashboard > Updates and run the WordPress logic to get all language packs by pressing the button “Update Translations”

It was reported to us that it is possible that you also might need to create the /languages/ folder and /languages/wpml/ folders manually before everything works properly (if they were not created).

6 Responses to “Hosting with read-only folder /wp-content/languages/ issues with WPML String Translation”

  1. I have tested this on Pantheon and it does not work. I followed the steps and still receive the same error as before. I also am noticing that the troubleshooting button doesn’t launch the dialog.

  2. I think a key step is missing here in your documentation. You need to manually create these directories in the uploads folder on each environment in order for this to work.

    • Hello!
      Did you manage to resolve the problem by creating the folders manually?
      We can add that step if you confirm.

      As far as I know, WPML latest versions should be able to create the folders automatically once you run the logic from WPML > Theme and Plugin Localizations page.

      • Hello George,

        I am having the same problem and talked with Laura from support. And the solution did not work.. Laura told me to back u the site and then clear WPML cacher again. And now I am backing up my whole site and will clear the cache of WPML But until now the solutions does not seem to work.

  3. Hello again,

    I was able to solve the issue with the hosting company.
    It was a simple path problem in wp-config.php

    define( ‘WP_LANG_DIR’, $_SERVER[‘HOME’] .’/files/languages/wpml’ );

    I changed the path ‘/files/languages/wpml’ to FULL home directory path and WPML was able to generate .MO files

Leave a Reply

Please leave here comments about this page only.
For technical support and feature suggestions, head to our forum. We are waiting there!

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>