Closed J2TEAM closed 8 years ago
@EvanHahn I added test file!
Looks like your tests have a failure when humanizing 0 milliseconds.
1) localized humanization for vi humanizes with arguments:
AssertionError: '0 mili giâys' == '0 mili giây'
+ expected - actual
-0 mili giâys
+0 mili giây
Could you fix this?
@EvanHahn I tried to edit the test file, but the results still failed. Because "giâys" is an invalid word, I don't know where it come from? (Not in humanize-duration.js or vi.csv)
I think it's because you have functions like this:
s: function (c) { return 'giây' + (c !== 1 ? 's' : '') },
These will return "giây" if you run humanizeDuration(1, { language: 'vi' })
and "giâys" if you run humanizeDuration(2, { language: 'vi' })
.
Should it look more like this?
vi: {
y: 'năm',
mo: 'tháng',
w: 'tuần',
d: 'ngày',
h: 'giờ',
m: 'phút',
s: 'giây',
ms: 'mili giây',
decimal: ','
},
@EvanHahn Oh, yeah. It seems I have focused to strings and forgot about the condition statements. I have updated humanize-duration.js
Cảm ơn bạn! Merged manually in 6470e6fa15c03a71d7e0d905fbb78f0f41f0e9f3 (so that it is just one commit).
This will be released soon.
This has been published in humanize-duration@3.7.0
.
Could you add tests? It will be a matter of making a
vi.csv
file in test/definitions.