meteor-messageformat icon indicating copy to clipboard operation
meteor-messageformat copied to clipboard

How-To Question: How do I update production system with new mfAll.js contents?

Open miri-am opened this issue 8 years ago • 7 comments

I have a running system in production, intially populated by the mfAll.js file. When I do changes to translations on my development server: what is the best strategy to update my translations in production with these changes?

Thanks for any hint on that.

miri-am avatar May 20 '16 09:05 miri-am

Well. Seems like removing the collections from the database and restarting nginx works. But this is probably not really sensible.

miri-am avatar May 20 '16 09:05 miri-am

Hey miri-am. As long as you're only doing translations on your dev server, just save the mfAll.js again and redeploy. It will be picked up and update the database when the "new" version of your app first loads on the production server.

gadicc avatar May 20 '16 09:05 gadicc

If that didn't work let me know... we recently optimized this code to avoid superfluous updates, there could be an edge case that's missing the update, but no one has reported anything since we released this about 2 months ago. You could maybe check that both your dev and production servers have the right time (in GMT).

gadicc avatar May 20 '16 09:05 gadicc

okay, was under the impression that this did not work (ie. it did not update strings in the database to new translations based on the new mgAll.js) - but will try again. Thanks.

miri-am avatar May 20 '16 09:05 miri-am

Ok great. Please let us know either way. And if possible, a dump of your mf* collections in production and the new mfAll.js would be helpful :) But more important to know if it's not working.

gadicc avatar May 20 '16 09:05 gadicc

. As long as you're only doing translations on your dev server, just save the mfAll.js again and redeploy.

Save it where?

I'm having a similar project. I added strings to my codebase, and they show up in /translate on dev. But after I deploy to production, the new strings are missing.

image

image

What's the process to do this? I've spent hours reading the docs but as far as I can tell it should be automatic right?

Maxhodges avatar Mar 02 '18 10:03 Maxhodges

Hi, yes, but these are two different issues.

If you are doing your translations on your dev copy and want to sync translations to production

Download /translate/mfAll.js and save as /server/mfAll.js (in your project root on the filesystem). When you meteor deploy, your translations will be sent across.

If you are doing your translations on the production server

Nothing to do.

But if you don't deploy directly from your dev working copy (e.g. you deploy from a CI or have some other kind of structure where you deploy from a "clean build"), your newly extracted strings might not make it to production. See https://github.com/gadicc/meteor-messageformat/pull/265.

You can test to see if the proposed changes help your situation, or for a quick fix, you could try this:

  1. download the production/translate/mfAll and save to (overwrite) dev's server/mfAll.js (and keep somewhere safe too)
  2. run meteor dev, confirm everything looks good (new extract strings, old translations), and then
  3. download the dev/translate/mfAll.js and save to / overwrite dev's server/mfAll.js (again)
  4. deploy again

gadicc avatar Mar 02 '18 11:03 gadicc