What is OSS?
OSS stands for "open source software". That's it! And now that you know that, I can probably stop writing...
Just kidding! This post is intended to show you just how easy contributing to widely-used OSS projects can be, and why it's such an important thing to do. (Hint: it's good for humanity.)
Why Discourse?
Here in our Quito office, Stack Builders hosts a monthly Bitcoin meetup - not just because we think BTC is an awesome new technology, but also because interest in BTC is driving innovation and, more importantly, collaboration amongst software developers locally. Recently our group outgrew the relatively meager discussion toolset available to us through Meetup, and so we decided to implement a dedicated forum for better maintenance of ongoing conversations & debates.
As a software development company, we felt it important that we use a platform that's:
- transparent, meaning we can dive into the source code and comprehend what's going on behind the scenes
- open-source, meaning... well, OSS
- well-maintained, with a vibrant and active community of users & developers alike
Discourse checks all those boxes.
Just take a look at the source code for yourself. app/models/global_setting.rb
is one of my favorite examples of clean, smart code within Discourse, because it demonstrates a very idiomatic way of loading & maintaining the most important Rails configuration settings.
The maintainers are constantly receiving & merging in pull requests from the OSS community. As of this writing, the Discourse GitHub repo has a whopping 2,407 forks with 580 watchers and 14 open pull requests. To put that in perspective a bit, the Rack DSL Sinatra has 963 forks. I, too, was surprised to learn this, young padawan.
And everything is TDD'ed. I mean everything. The aforementioned global_setting.rb
file, the one that basically just reads and parses the discourse.config
file? There are tests for that. In total, the platform boasts +3,300 tests - and that doesn't even include the extensive test suite for its front-end Ember.js MVC framework.
Our Contribution to Discourse
"But... it's such a huge platform, how could I possibly make it better than what it is now?!"
<small>Some lazy developer somewhere in the world</small>
In our case - and probably most cases in the world of OSS - the motivation to spend our time in order to contribute to the code was practical. Our new BTC Ecuador forum is serving a community of primarily "hispanohablantes" (i.e. native Spanish speakers, for you gringos out there). Discourse utilizes Rails Internationalization API, also known as I18n, to provide multi-language support across the entire platform, including - yay! - español. But when we switched our config.i18n.default_locale
to :es
and fired the app back up, we noticed that much of the needed YAML from client.en.yml
& server.en.yml
hadn't yet been ported to their *.es.yml
equivalents. It's hard NOT to notice when your admin page is riddled with translation_missing
warnings...
At this point, we hunkered down and set to work comparing the English and Spanish language data. We knew the application was expecting data in the matching client.es.yml
and server.es.yml
files, but wasn't able to find it. So, for hours we went through the website and added the missing translations, one-by-one. Not so glamorous, huh? (Side note: Not all programmers can be rockstars, after all. But a rockstar team? That's tenable.)
Our basic workflow was as follows:
- Identify missing YAML key-value data by scouring our new-but-broken (Spanish-language default) website.
- Locate the corresponding values in one of the
config/locales/*.en.yml
files to ensure consistency with the Discourse's English descriptions. - Translate (accurately!) that missing language data into
config/locales/*.es.yml
.
Sticking to this simple recipe, we now have a much more professional looking website. Well, great... but so what? What's the big deal? I still don't see why this whole OSS concept matters?!?!
Why This Work Matters
Here's the mediocre-to-good news: by spending more hours than I'd care to admit translating English to Spanish, we ended up with a much nicer-looking Discourse forum. Oh, and I learned a heap of español along the way!
Here's the better news: once we were done, we submitted a GitHub pull request to the maintainers of the Discourse platform - you know, the one with thousands and thousands of users worldwide. And within one business day, our PR was merged into the master branch. ¡Qué maravilloso, caballeros! Just by doing what turned out to be fairly routine translation work, we greatly improved the overall user experience for Spanish-language Discourse platforms everywhere around the world - platforms that help groups of all sizes to share their ideas, define what matters to them, and push one another to be better. In retrospect, that's certainly something to feel good about.