Menu

What a tiny Django ticket taught me about open source
πŸ“°

What a tiny Django ticket taught me about open source

DEV Community: opensourceΒ·kihuniΒ·12 days ago
#u7pf7W4L
#devtoopensource#devto#dev#locale#hans
Reading 0:00
15s threshold

Hi, I'm Stephen, a Djangonaut contributing to Django core. This was my second ticket, and it looked tiny: a one-line capitalization bug in makemessages . It turned into a lesson in code review, minimal diffs, and a lot of git πŸ˜‚.

Here is the story.

The bug: a helpful message that gives wrong advice

Django's makemessages command extracts translatable strings into .po files, one folder per locale. If you pass a locale that doesn't exist, it tries to help by suggesting a valid one.

Here is what happened when you typed a script-based locale like Simplified Chinese:

$ python manage.py makemessages --locale zh-hans invalid locale zh-hans, did you mean zh_HAns?

Enter fullscreen mode

Exit fullscreen mode

zh-hans is invalid because Django expects an underscore. But the suggestion, zh_HAns , is also invalid.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.