This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 11 replies, has 2 voices.

Last updated by Bobby 1 month, 1 week ago.

Assigned support staff: Bobby.

Author Posts
February 21, 2020 at 10:24 pm #5544099

alisonB-2

We would like to upgrade our production environment from WPML 4.2 to 4.3.7 to take advantage of the performance improvements from the MO files instead of using the DB for string translations. We have a few questions/concerns:

1. When generating the MO files on our Staging or local environment WP Admin shows the warning "WPML is updating the .mo files with the translation for strings. This will take a few more moments. During this process, translation for strings is not displaying on the front-end. You can refresh this page in a minute to see if it's done.". Does this mean that during the entire time WPML is generating no translated strings will be rendered on the frontend?

2. Can we generate the MO files in our staging environment and copy them over to production? Is that enough or does the database need to be migrated as well?

2. We also regularly get the error message "There was a problem creating the MO files" and can never complete the process (screenshot attached). We have a large multi-site install with thousands of pieces of content. Is there a way to script this out or use the CLI? Relying on the frontend interface for large sites does not seem like a reliable approach.

Thanks

February 22, 2020 at 12:00 am #5544363

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

#1 Yes, that is correct and usually, this process should not take too long.

#2 I would not recommend just moving the .mo files, from migration to production I would recommend a full migration to avoid any issues.

# 3 Please review the following documentation first and let me know if these steps resolve the issue.

https://wpml.org/faq/cannot-write-mo-files/

If they do not follow the steps below and let me know your results.

1) WPML -> Languages -> Language URL format -> Language name added as a parameter -> Save
2) Settings -> Permalinks -> Plain -> Save Changes
3) Reload some page and *.mo files are finally generated.
4) Revert 1) and 2), site is now working normally.

As far as creating a CLI command, we currently do not have any documentation on this.

February 24, 2020 at 2:41 pm #5555385

alisonB-2

Hi Bobby -

Generating the MO files on our Stage site takes hours. Are you saying if we upgrade to this version of WPML our production site will not show translations for hours!? How is that acceptable?

February 24, 2020 at 5:55 pm #5556885

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

Does the scan eventually finish? The error you mentioned "There was a problem creating the MO files" will cause the .mo files to never actually finish scanning.

This is why I provided the test steps above to ensure that the files can be written as expected.

I believe technically you should be able to copy your files from the staging site to live site, you can find them under wp-content/languages.

Let me know your results, please.

February 24, 2020 at 6:35 pm #5556973

alisonB-2

When the error "There was a problem creating the MO files" happens I click the "Try Again" button and sometimes it restarts from where it left off but sometimes the process resets itself.

For example, if it was on site "6 out of 63" it will sometimes resume on site 6. But if don't catch the error right away and click "Try Again" the process starts over and goes back to "0 out of 63". I've never been able to get the past about the 10th site out of 63.

MO files are being written so we don't have any write permissions issues like your link suggests.

It would be very helpful to get a definitive 'YES' from WPML that we can move MO files from staging to production without issue. I would hate to spend all of this time fighting the creation of these MO files on staging and then not be able to move them to production.

Thanks.

February 24, 2020 at 7:00 pm #5557085

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I have had previous issues with the creation of .MO files that were resolved by the following steps.

1) WPML -> Languages -> Language URL format -> Language name added as a parameter -> Save
2) Settings -> Permalinks -> Plain -> Save Changes
3) Reload some page and *.mo files are finally generated.
4) Revert 1) and 2), site is now working normally.

Please try them and update me with your results, in the meantime i will consult with our developers about moving from staging to live just the .mo files.

February 25, 2020 at 3:32 pm #5564271

alisonB-2

Hi Bobby -

Unfortunately, those changes didn't seem to make a difference.

Also, a new development. I was finally able to force the generator to finish 15 out of the 63 sites. I CURL'd the WPML Rest API with my WP session cookie every few seconds to keep it alive. That seemed to fix the issue of the process resetting itself.

The MO file process generated 73,000+ MO files and completely brought our staging site down. Not a single piece of translated content could be loaded on the frontend. The sheer number of files seems to have brought Apache/PHP to its knees.

February 25, 2020 at 7:12 pm #5565557

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Regarding the transfer of your .mo files, you can technically transfer them to your live site but also you might have to fill the Database table wp_icl_mo_files_domains with the icl_mo_files

so that you can avoid scanning and fixing paths.

There is a .mo file generated per language per plugin and theme therefore how many get created is contingent on the number of languages activated on your site and plugins/themes.

February 25, 2020 at 10:17 pm #5566027

alisonB-2

Thanks for the info on the wp_icl_mo_files_domains table.

Yes, we have a large network of sites with 8 languages and multiple plugins and themes so we are going to have a lot of MO files. How many MO files have the WMPL team tested performance against? Like I said above, the 73,000+ MO files generated completely brought our site to a grinding halt. Is there any benefit to us continuing down this path?

February 26, 2020 at 1:24 am #5566629

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

The goal is to improve performance and minimize the calls to the database which I am guessing your network of sites was already doing if you are loading 73,000+ MO files.

You can find our detailed explanation of the new String Translation here:
https://wpml.org/changelog/2019/10/wpml-4-3-with-revamped-string-translation/

February 26, 2020 at 3:15 pm #5572485

alisonB-2

Bobby - Yes, I am quite aware of the goal.

While I appreciate your time and help is there someone more technical that this issue can be assigned to? I believe this issue needs more technical guidance.

Thanks.

February 26, 2020 at 6:40 pm #5573777

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If possible please let me know what you would like an answer with and if I cant provide it I will make sure that the ticket is escalated to our developers but at the moment scanning the .mo files is what is required for our plugin to work.

I have also provided the steps required to manually transfer your .mo files from staging to live along with the database table that needs to be updated, which was confirmed by our developer's team as well (not recommend but confirmed )

The topic ‘[Closed] Generate MO files Warning Message’ is closed to new replies.