Contribution to Open Source Project: 📅 date-fns
date-fns is a modern JavaScript date utility library that provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
In layman's terms, it is a library that provides a large number of functions that allows us to easily manipulate dates in web-based projects.
I started working on this project last week when I noticed that there was an open issue requesting Malay language support. The issue was considered claimed but seemed abandoned and thus I decided to claim it.
Firstly, I have to mention that the work done is not purely translation per se but I decided that the Translation tag is the nearest match. I'd happy to hear suggestions on this in the comments section. Thank you!
💻 What I actually did
When I first started, I decided to follow the project maintainer's idea of cloning the Indonesian locale and translating the strings across around 8 files to the Malay language. But while modifying them, I noticed that dates in Indonesia does not exactly follow the same format as Malaysia: e.g. First Day of the Week. Therefore, in order to make sure I did not miss any other slights, I cross-referenced each date format with LocalePlanet.
Once that was done, I compiled and executed the tests absent-mindedly but to my surprise, the tests returned no errors! I opened the tests.js file to notice that calls to the locale specific tests were skipped. I checked the tests file for a few other locales and noticed that quite a few others also skipped tests.
describe.skip('id locale', function () { ...
I had some time in hand and thus decided to rewrite the tests specific to Malaysian locale and was glad that I did. I learned that certain notations of dates such as: 4th April 1986 have no valid translation to Malay. I skipped that particular test since the module that provides that particular call was not opened for localisation and the notation itself is hardly ever used in Malaysia.
All in all, it was not a particularly tough work but I'm sure I can impart the knowledge I gained when localising any other projects that interest me.
✎ Tracking work done at Github
For more details, here is a link to my Pull Request at the project's repository: https://github.com/date-fns/date-fns/pull/605
@Zyten can sometimes be found at : Utopian | Steemit | Website | Github
Thank you for your attention 😊
Posted on Utopian.io - Rewarding Open Source Contributors