gadicc / meteor-messageformat

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

[v2] Multiple language packs not inserted in Mongo #123

Open PEM-- opened 9 years ago

PEM-- commented 9 years ago

For Orion, I've created multiple language packs.

The default one is english and looks like this:

msgfmt.init('en');
mfPkg.syncAll({
  en: {
    accounts: {
      text: 'Accounts'
    },
...
}, {
  'exportedAt': 1431194223035,
  'updatedAt': 1431194216656
});

The second pack is for french (the cocorico guys). This time there is only one file:

mfPkg.syncAll({
  fr: {
    accounts: {
      text: 'Comptes'
    },
...
}, {
  'exportedAt': 1431194223035,
  'updatedAt': 1431194216656
});

The third pack is for russian (the vodka guys). Like for french, there is only on file:

mfPkg.syncAll({
  ru: {
    accounts: {
      text: 'Аккуанты'
    },
...
}, {
  'exportedAt': 1431194223035,
  'updatedAt': 1431194216656
});

When I look into Mongo, I can see the french translations in the mfStrings collection. capture d ecran 2015-05-10 a 11 21 19

The mfMeta collection shows me that french and russian have been analysed: capture d ecran 2015-05-10 a 11 23 14

The problem: I can't see neither english nor russian in Mongo. Only french is persisted in Mongo. As english is the default, it is send to the browser. Therefore, I'm able to switch between english and french but russian cannot be used.

I'm using mfPkg.syncAll which uses mfPkg.langUpdate on each language pack. But something prevents the insertion in Mongo making russian unavailable.

gadicc commented 9 years ago

@PEM--, sorry, for some reason I only saw this now. But I think I might have already fixed this. Can you try the latest core release?

Also, where are you showing the mfStrings collection from? If you can see all that on the client without msgfmt:ui loaded, it's a bug :)