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

/translate not working.

Open cryptoboy opened this issue 9 years ago • 6 comments

Added lib/common.js with the only line:

msgfmt.init('en');

Using the new version - fresh project with just 1 sample message in the HTML.

$ meteor list | grep msg
msgfmt:core              2.0.0-preview.21  MessageFormat i18n support, the Me...
msgfmt:extract           2.0.1  Extracts native / translatable strings from y...
msgfmt:ui-dev-only       2.0.4  msgfmt-ui that is never deployed

I also had to do meteor remove autopublish due to some warning messages when running locally.

Finally - app is running, but when I go to http://localhost:3000/translate I just seem to get the main page. (Is this a routing issue? i.e. the default meteor app is catching all routes and not letting msgfmt do its magic?)

UPDATE:

I should also mention that 2 files were generated under server:

extracts.msgfmt
extracts.msgfmt~

However I don't see mfAll.js - is that generated after successfully hitting the /translate?

UPDATE 2:

In case it is version specific:

$ meteor --version
Meteor 1.3.2.4

cryptoboy avatar Apr 30 '16 03:04 cryptoboy

Solved. Obviously without installing iron:router it doesn't work.

I would add this in the instructions somewhere for people just starting out:

meteor add iron:router

cryptoboy avatar Apr 30 '16 04:04 cryptoboy

Sorry for the pain, hopefully writing the v2 docs next week. Leaving this open so I don't forget. Should work fine with flow-router too... were you using any router?

gadicc avatar Apr 30 '16 06:04 gadicc

(will answer properly next week, i'm away for the weekend)

gadicc avatar Apr 30 '16 06:04 gadicc

@cryptoboy what router are you using, btw?

gadicc avatar May 03 '16 13:05 gadicc

Sorry for the delay - I am actually pretty much new to Meteor, so I was trying both the translation system and Meteor at the same time. So yeah, I didn't have a router, just some default basic app. :)

cryptoboy avatar May 06 '16 08:05 cryptoboy

Are you considering React-Router any time soon?

pisacode avatar Jul 24 '17 10:07 pisacode