aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 138 forks source link

Error: >reactiveTable.show< >reactiveTable.rowsPerPage< >reactiveTable.page< >reactiveTable.of< 1 #50

Open jasonxeno opened 10 years ago

jasonxeno commented 10 years ago

Any ideas on why I am getting this text surrounding the pagination?

reactiveTable.show< >reactiveTable.rowsPerPage< >reactiveTable.page< >reactiveTable.of< 1

I have 5 different tables in my app and this is happening to all of them

Also the filter now has >reactiveTable.filter< as the placeholder in the filter, but the filter works.

It still happens after I remove and add again and even after "mrt uninstall --system"

here is my smart.json { "meteor": {}, "packages": { "bootstrap-3": {}, "iron-router": {}, "autoform": {}, "moment": {}, "spin": {}, "stripe": {}, "collection2": {}, "collection-helpers": {}, "connection-banner": {}, "statemachine": {}, "pdfjs": {}, "accounts-entry": {}, "font-awesome": {}, "iron-router-progress": {}, "highcharts": {}, "roles": {}, "accounts-admin-ui-bootstrap-3": {}, "googlemaps": {}, "reactive-table": {} } }

jasonxeno commented 10 years ago

It seems to be a problem with the just-i18n dependency

aslagle commented 10 years ago

yes, that sounds like the problem. is just-i18n in your smart.lock?

ghost commented 10 years ago

I am also having this issue, 'just-i18n' is in my smart.lock, I tried v0.2.3 & the latest (0.2.4) it did not change, still having same issue.

  "just-i18n": {
    "git": "https://github.com/subhog/meteor-just-i18n.git",
    "tag": "v0.2.3",
    "commit": "494c5a1efb07ccb498e9a74283817fdddcd528c4"
  },
aslagle commented 10 years ago

I haven't been able to reproduce this, but I'll look into it if someone can point me to an example app with the same issue.

hellogerard commented 10 years ago

I got this error too. After some digging, I believe it's because I'm using another package (accounts-entry) that also depends on just-i18n. I'm thinking the problem is that you can only call i18n.map() once.

aslagle commented 10 years ago

Thanks, I can reproduce it using accounts-entry. The problem is actually that accounts-entry is using a different translation package called accounts-t9n, which overwrites the i18n helper and breaks just-i18n. They say this is for backwards-compatibility with just-i18n, but it doesn't actually work since it doesn't let you use i18n.map. I'll create an issue in that package.

softwarerero commented 10 years ago

I confirm the issue when both packages are used together and will try to avoid this in the future. For a quick fix you can try to exclude just-i18n in smart.json and translations should work as expected.

aslagle commented 10 years ago

I don't think excluding just-i18n would fix the problem in this case, since the translations are defined with i18n.map. Maybe accounts-t9n could set i18n.map to t9n.map, and export i18n though...

softwarerero commented 10 years ago

You are right, you would have to call the method 'map' on the T9n object.

Maybe accounts-t9n could set i18n.map to t9n.map, and export i18n though... There is no control over the load order of the packages so it would only work sometimes, also I would introduce more deprecated code.

aslagle commented 10 years ago

I don't want to add a dependency on accounts-t9n to reactive-table (unless someone can point out any advantages over just-i18n), but for anyone who wants to use both packages, a workaround is to add a translation to T9n from your app, e.g. for English:

T9n.map('en', {
  reactiveTable: {
      filter: 'Filter',
      show: 'Show',
      rowsPerPage: 'rows per page',
      page: 'Page',
      of: 'of'
  }
});
softwarerero commented 10 years ago

I just removed the i18n helpers from t9n so there shouldn't be any more collisions between the module. I guess you can close this issue.