gadicc / meteor-messageformat

MessageFormat i18n support for Meteor, with reactive templates
54 stars 22 forks source link

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

Open miri-am opened 8 years ago

miri-am commented 8 years ago

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 commented 8 years ago

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

gadicc commented 8 years ago

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 commented 8 years ago

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).

miri-am commented 8 years ago

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.

gadicc commented 8 years ago

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.

Maxhodges commented 6 years ago

. 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?

gadicc commented 6 years ago

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