# Babel in Khan Academy's i18n Toolchain

DevFeed: [Babel in Khan Academy's i18n Toolchain](<https://devfeed.tech/articles/babel-in-khan-academy-s-i18n-toolchain-27381.md>)

Original publisher: [Read original article](<http://engineering.khanacademy.org/posts/i18n-babel-plugin.htm>)

Author: Khan Academy

Published: 2015-06-22T22:00:00Z

Content type: article

Language: en

Sources: [Khan Academy](<https://devfeed.tech/sources/khan-academy.md>)

Topics: [Babel](<https://devfeed.tech/topics/babel.md>), [Internationalization (i18n)](<https://devfeed.tech/topics/i18n.md>), [ECMAScript](<https://devfeed.tech/topics/ecmascript.md>), [React](<https://devfeed.tech/topics/react.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [argument](<https://devfeed.tech/tags/argument.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [ast](<https://devfeed.tech/tags/ast.md>), [babel](<https://devfeed.tech/tags/babel.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [callback](<https://devfeed.tech/tags/callback.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [destructuring](<https://devfeed.tech/tags/destructuring.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [es6](<https://devfeed.tech/tags/es6.md>), [eslint](<https://devfeed.tech/tags/eslint.md>), [exports](<https://devfeed.tech/tags/exports.md>), [foreach](<https://devfeed.tech/tags/foreach.md>), [frontend](<https://devfeed.tech/tags/frontend.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [i18n](<https://devfeed.tech/tags/i18n.md>), [jsx](<https://devfeed.tech/tags/jsx.md>), [news](<https://devfeed.tech/tags/news.md>), [web-frontend](<https://devfeed.tech/tags/web-frontend.md>)

## AI overview

Khan Academy's Babel migration preserved its custom i18n workflow by adding a Babel plugin that turns `<$_>` and `<$i18nDoNotTranslate>` JSX tags into function calls. Matching jstransform required retaining generated line numbers and exact whitespace in translation strings; the team compared Gettext `.pot` files from both build paths and used fixtures to isolate whitespace differences. Migration testing also caught two transformer issues: class output still contained `let` until `es6.blockScoping` was added to the whitelist, and Babel's function-name transformation could make a `setInterval` method call itself by shadowing the global. The article reports that Babel maintainers fixed the issues and describes the plugin as a relatively straightforward way to preserve the existing build workflow.

## Source excerpt

By Kevin Barabash We've been using ES6 (along with JSX) for sometime at Khan Academy. Right now, we're ... Read more