cibernox / babel-plugin-precompile-intl

Compile translations in ICU message format to invocable functions at build time
8 stars 4 forks source link

Add date time skeletons availability (like for number skeletons) #20

Open mashiachy opened 1 year ago

mashiachy commented 1 year ago

Added date time skeletons availability (like for number skeletons). Added boolean literals for number skeleton (was broken this syntax: {year, number, ::group-off})

cibernox commented 1 year ago

Can you add tests for this? It should be simple, we just need example fixtures with inputs and outputs added in in https://github.com/cibernox/babel-plugin-precompile-intl/blob/master/test/fixtures/default

You can either create a new file or add them to one of the existing files. There's already several examples of number skeletons implemented and tested in https://github.com/cibernox/babel-plugin-precompile-intl/blob/master/test/fixtures/default/format-numbers/input.js , but the features of number skeletons are so varied that I implemented first the ones I needed and I thought most people would need too.

cibernox commented 1 year ago

Also, when writing tests, try to be mean and look for edge cases, combining number skeletons where possible, put them at the beginning of a sentence, at the end, in the middle...