formatjs / dust-intl

Dust helpers for internationalization.
http://formatjs.io/dust/
Other
48 stars 11 forks source link

search keys path in global context if no match found #29

Closed herry closed 10 years ago

herry commented 10 years ago

Details of the changes:

  1. Try to get from globals if can not find the ordered keys path in the context stacks. Similar to built-in version of context.get() https://github.com/linkedin/dustjs/blob/master/lib/dust.js#L339
  2. Add more unit tests.
  3. To ensure all existing and new unit tests are passing, add temp fix (i.e. change 'medium' to 'long' format for date) for the existing broken test. The existing broken test is due to the changes in locale-data's date in https://github.com/andyearnshaw/Intl.js/blob/master/locale-data/json which does not define 'short' month in its list of combinations. The best match algo will return "month": "long", "day": "numeric", "year": "numeric" instead.
yahoocla commented 10 years ago

CLA is valid!

caridy commented 10 years ago

@herry thanks for the PR, we will definitely look into this.

@drewfish can you do a second pass on this? it looks good to me.

drewfish commented 10 years ago

Yeah looks good. I love all the tests :)

caridy commented 10 years ago

@clarle, @juandopazo can you guys take care of this merge?

clarle commented 10 years ago

Merged #29.

juandopazo commented 10 years ago

That was FAST.

clarle commented 10 years ago

This will be part of the 0.0.4 release that I haven't published yet, hopefully with the BC breaking change in #30.

drewfish commented 10 years ago

Should we bump the version to 0.1.0 then?

caridy commented 10 years ago

yes please, 0.1.0

clarle commented 10 years ago

Bumped and published to npm at 0.1.0.