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

[v2] mf not working in HTML header

Open isAlmogK opened this issue 10 years ago • 11 comments

I have the following in my HTML it works fine in English but I'm not seeing it on the translation page and it's not translating

<header class="panel-heading">
  <h2 class="panel-title">
    {{mf 'postHarvestFungicideApplication' 'Post Harvest Fungicide Application'}}
  </h2>
</header>

isAlmogK avatar May 18 '15 10:05 isAlmogK

That's strange. Is it definitely only in header or is it possible that it's not picking up anything new anymore? This is all on dev, right? If you do msgfmt.forceExtract() from meteor shell again, does it pick it up?

gadicc avatar May 19 '15 10:05 gadicc

Just test I get 'Forcing (re)-extract of all files and keys. See results in main console log, according to your default debug level'

I20150519-13:21:19.502(3)? 2015-05-19 13:21:19.478 info: [msgfmt:extracts] 1 string(s) added, 0 changed, and 5 marked as removed.

I'm seeing the translate at http://localhost:3000/#!translate/es

screen shot 2015-05-19 at 1 23 52 pm

But as you can see not on the page screen shot 2015-05-19 at 1 24 56 pm

isAlmogK avatar May 19 '15 10:05 isAlmogK

Oh, umm, the real time updates aren't completely finished yet. If you reload the page, any difference?

gadicc avatar May 19 '15 10:05 gadicc

Noting with page reload, tried refreshing a couple times. I can hardcode in the meantime. We are moving towards a form builder and loading the html dynamically from the database which would already have the translation

isAlmogK avatar May 19 '15 10:05 isAlmogK

That's strange. For debugging purposes, does msgfmt.resetStorage(); in the client console make any difference? Otherwise does other reactive stuff work (say, showing/changing a session variable) work in that section of your site?

gadicc avatar May 19 '15 10:05 gadicc

msgfmt.resetStorage(); undefined

Reactive does work (not everything is reactive)

isAlmogK avatar May 19 '15 10:05 isAlmogK

That last command reloaded the page too, right?

What is the value of msgfmt.strings.es.postHarvestFungicideApplication in the console? undefined ?

Does that key appear in http://localhost:3000/msgfmt/locale/es/0?

I'm trying to figure out what's special about this particular string :( This isn't up on staging anywhere, right?

gadicc avatar May 19 '15 10:05 gadicc

msgfmt.strings.es.postHarvestFungicideApplication undefined

http://localhost:3000/msgfmt/locale/es/0 yes I get a json file staging - yes you should still have access, if not let me know will create username and password

isAlmogK avatar May 19 '15 11:05 isAlmogK

I still have access :) thanks. on staging it looks like it's working? can you confirm? i'm talking about that particular string.

back to http://localhost:3000/msgfmt/locale/es/0 on dev, do you see postHarvestFungicideApplication in there? when you did msgfmt.resetStorage() did the site reload? did you get a line in the logs like:

debug:  [msgfmt]  [Q] fetchLocale request for "all", url: /msgfmt/locale/all/0, sendCompiled: undefined

the important part is the /0, meaning that it's redownloading all the definitions and not updating a local cache.

we'll get to the bottom of this, just trying to get a full picture :)

gadicc avatar May 19 '15 11:05 gadicc

Yes working on production and staging not sure why it's not working in local host

isAlmogK avatar May 19 '15 12:05 isAlmogK

Hey, I'm happy it's working on production/staging but I'm concerned about it not working no dev. I'm going to leave this open to look at, and (non-urgently) let me know about some of the other stuff and particularly what happens the next time you add a new string.

gadicc avatar May 19 '15 13:05 gadicc