My first ever open source contribution (added sindhi locale support for momentjs)

Narain Sagar
Jun 14, 2017 · 2 min read

About Moment:

Parse, validate, manipulate, and display dates in javascript. http://momentjs.com — via moment.js

Momentjs is one of the best javascript date(s) parsing open source library.

It has over 30k+ github stars and 40k+ github forks.

I (and we — the javascript developers) definitely love moment and use whenever we want to play with date objects and formation.

Nice thing about the moment is that it supports multiple locales, multiple timezones and developers have contributed into it to make it better for everyone around the world.

Few months back, our Team Lead at Recurship (i.e., place at I work) made compulsory for every developer to do one contribution in any open source library each month.

So, I was looking into different libraries on github (their issues, PR’s by others, etc) and got into moment repo and saw their was no locale for Urdu & Sindhi language there. I then found in open PRs that someone already opened Urdu PR so decided to go with Sindhi. Sindhi is one of the language used by many peoples lives in Sindh (Pakistan) and I have heard that it’s been used in India as well.

So, I went through with moment docs, contribution guidelines, etc and setup the moment on my local machine. Writing a moment locale isn’t very difficult though but the most of difficult thing (newbies) developers face is to write unit tests for code they have written. For creating locale we just need to copy any other locale code and have to do the translations and same thing with the unit tests as well. Everything is written there different locales codes along with unit tests.

I just created my PR and here’s now it’s been merged in official moment repository under release v2.18.0

Github PR Link: https://github.com/moment/moment/pull/3659

It’s just a first attempt, have it a try and let me know your feedback on this and open issues over github moment repo if you find any bug or wrong translation.

Thanks.

Cheers,

Narain Sagar

Full Stack JavaScript Developer, Currently focusing on Node.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store