papandreou / inter

A JavaScript locale library based on information extracted from the Unicode CLDR database
BSD 3-Clause "New" or "Revised" License
21 stars 5 forks source link

ReferenceError: umalqura is not defined #5

Closed ragulka closed 10 years ago

ragulka commented 10 years ago

I was trying to give inter a go but stumbled upon this:

ReferenceError: umalqura is not defined
    at /Library/WebServer/Documents/node_projects/test_inter/node_modules/inter/build/et.js:1669:41
    at /Library/WebServer/Documents/node_projects/test_inter/node_modules/inter/build/et.js:3:26

It looks like it's caused by these 2 lines:

monthNames: P.calendars.islamic-umalqura,
eraNames: P.calendars.islamic-umalqura,

Accessing a property name with a dash in using dot-notation, is, of course, invalid. You should be using literal notation instead.

monthNames: P.calendars['islamic-umalqura'],
eraNames: P.calendars['islamic-umalqura'],

I think it would be best if you would check if the property name has any dashes and use literal notation only then, because literal notation can have a small impact on file size (which matters, if used in browser).

papandreou commented 10 years ago

This was fixed in 83b53db3 and will be part of the next release.

iaincollins commented 10 years ago

I'd like to see this fixed too. This module would be super-useful to leverage, but currently reluctant to depend on it due to this bug which prevents it from loading without end users applying a workaround.

papandreou commented 10 years ago

I just released 1.2.2 with the fix plus a few others. I hope that does the job :)

I was reluctant to release because there are still other known bugs, but since I didn't have the time to fix those, it's better to get something out.

iaincollins commented 10 years ago

Awesome, thank you so much! :)