gadicc / meteor-messageformat

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

msgfmt:react installation on Meteor 1.2; in msgfmt:extract #212

Closed DiesIrae closed 8 years ago

DiesIrae commented 8 years ago

Hi,

I am having this message when installing msgfmt:react:

=> Errors prevented startup:

   While computing assigned variables:
   /packages/msgfmt_react/react.js: 'import' and 'export' may only appear at
   the top level (1:20)

I have the last stable version of Meteor, 1.2.1.

Thanks !

gadicc commented 8 years ago

Wow, you guys are fast :)

I'll admit I wrote this for Meteor 1.3.

I don't mind doing a special release for 1.2 in the meantime. You're using the meteor-react package, right? This package is causing a lot of pain for people upgrading :>

gadicc commented 8 years ago

Try msgfmt:react@2.0.0-meteor12 :)

DiesIrae commented 8 years ago

Mmmh... I'm a beginner with Meteor so I wont dare to update to a beta version. :-)

Thank you for the special "lagger" version! It doesn't seems to work though... here is my error:

ReferenceError: msgfmt is not defined

I'm using React 0.14.3.

gadicc commented 8 years ago

Haha, sure :)

That's strange, msgfmt:react does require msgfmt:core and I did test in a Meteor 1.2 install before publishing. Can you paste the full stack trace for that error so I can see where it's coming from?

Just heading out now but will bbiab... Did this land up in your .meteor/package file?

msgfmt:core@2.0.0-preview.19
msgfmt:react@2.0.0-meteor12
DiesIrae commented 8 years ago

Sorry for the delay!

I managed to do it! I had to uninstall all msgfmt-related packages and install msgfmt:core, then msgfmt:react@2.0.0-meteor12. If I did it in another order I had this error (and the content of .meteor/package you wrote). The relevant part of my .meteor/package file is now:

react
msgfmt:core
msgfmt:react@=2.0.0-meteor12

Oh, and by the way if others want this version, the correct code to add it is meteor add msgfmt:react@=2.0.0-meteor12, the equal sign seems important.

But it's a pity, I am now stuck with mf_extract. It says Error: Messageformat not installed in this project.. Does this work at all with this version?

DiesIrae commented 8 years ago

I overlooked mf_extract.js and I think I spotted the problem: is it compatible with *.jsx? :-P

gadicc commented 8 years ago

Sorry, didn't get to this yesterday. Still a bit confused why it didn't work before but happy it's working now.

You should ignore all the online docs, they're all still for v1. For the v2 pre-release, just rely on the REDAMEs. Relevant to this, mf_extract is gone. There's now a msgfmt:extract package that automatically extracts whenever you change a file. It doesn't support the new <MF> tag yet but it will in the next few days...

If you want to test in the meantime, just add (for now) something like:

var unused = mf('key', 'text...');

in the same file, to get the extract to work.

DiesIrae commented 8 years ago

Neat! That's far better!

I looked up for a readme indeed, but couldn't find it anywhere: On github and atmosphere the two readme are pretty minimalistic. :-)

I installed it but could not find my translations. There is a server/extract.msgfmt but it has no translation in it. There is some stuff in server/extract.msgfmt~ though. Is there a documentation on this ?

gadicc commented 8 years ago

Yeah unfortunately all the docs are a bit minimalistic until a final release. On github there's the main README and then a README for each sub package.

Yeah, the ~ file is the magic file that gets automatically updated.

DiesIrae commented 8 years ago

Then I could suggest you add the subpackage links to your principal readme, as I still havent find them. It seems all the atmosphere packages redirect here.

Thank you Gadi for all your patient answers !

gadicc commented 8 years ago

Uh yes actually I've been meaning to do that ;) I'll actually leave this open until:

DiesIrae commented 8 years ago

Great! :-)

gadicc commented 8 years ago
meteor add msgfmt:extract@2.0.0-preview.14      # 2016-03-19

:)