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

[v2] Multiple language packs not inserted in Mongo

Open PEM-- opened this issue 10 years ago • 1 comments

For Orion, I've created multiple language packs.

The default one is english and looks like this:

  • An init file init.js for client and server:
msgfmt.init('en');
  • A pack for the english language lang-en.js solely dedicated for the server:
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:

  • A pack for the french language lang-fr.js solely dedicated for the server:
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:

  • A pack for the russian language lang-ru.js solely dedicated for the server:
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.

PEM-- avatar May 10 '15 09:05 PEM--

@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 :)

gadicc avatar May 13 '15 09:05 gadicc