How We Refactored 10,000+ i18n Call Sites Without Breaking Production
Posted by patreon-eng@reddit | programming | View on Reddit | 20 comments
Patreon’s frontend platform team recently overhauled our internationalization system—migrating every translation call, switching vendors, and removing flaky build dependencies. With this migration, we cut bundle size on key pages by nearly 50% and dropped our build time by a full minute.
Here's how we did it, and what we learned about global-scale refactors along the way:
_jnpn@reddit
Interesting method. Why didn't you use i18next or similar ? just curious.
Also, what did you write your codemods in ? babel/traverse or something else.
I wonder how many people do ~metaprogramming in the frontend world.
rminsk@reddit
i18n (internationalization) "i" followed by 18 letters followed by "n". a11y (accessibility) is "a" followed by 11 letters followed by "y". accessibility
agumonkey@reddit
a11y makes me laugh everytime
ConejoSarten@reddit
It’s amazing how I’ve been in this business for 14 years and I still don’t know what 80% of the words in this subreddit mean
patreon-eng@reddit (OP)
Is there anything we can help clarify? Would you liked to have seen definitions for any terms used in the post?
LuckyHedgehog@reddit
Probably "i18n", it is not clear that it means "internationalization". First time I've ever seen it at least
zomgsauce@reddit
Then you've probably never heard of l10n, which means "localization." Fun fact, the 18 and 10 in those are the number of letters between the "L" and "N" of each word. If you think that's stupid and needlessly obfuscative you're absolutely right but it was the 80's and nothing made sense, or had to.
adjudicator@reddit
It’s incredibly common and well-known shorthand
paul_h@reddit
Many commits over many releases? All in trunk? You've a monorepo? Branching model is?
FullPoet@reddit
paul_h@reddit
Do you bake in a toggle, so you could hot rollback without a deploy?
CNCF has a feature-flags section, but I think "Coordination & Service Discovery" can be used for that too ... Consul used to figure in that section, but is not there anymore.
FullPoet@reddit
Oh no, we had the janitor stand by with a memory stick with an older build.
MuonManLaserJab@reddit
What was his name? Was he an illegal immigrant? What brand of memory stick, and what color plastic?
MuonManLaserJab@reddit
It's pretty funny that you could type two entire sentences about this without realizing that it was obviously "i18n", the single abbreviation you used.
MuonManLaserJab@reddit
"i18n" is old IRC slang for, "I'm 18 and non-binary". It's an answer to ASL, like "18f".
Maxion@reddit
"a11y" as in "I'm eleven and Y do you need to know my gender?"
stumblinbear@reddit
No, it's leet speek for ally
MuonManLaserJab@reddit
I'm pretty sure a11y was a top CS player
GreatApeGrape@reddit
What was the open source library you moved to?
e_Lap@reddit
Enjoyed the write up :). Thanks