Created
December 2, 2019 02:39
-
-
Save whs/69be4fe8628afb53932b30e933211bce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import template from 'babel-template' | |
const I18n$tCall = template('I18n.$t({th: TH, en: EN})') | |
export default function({types: t}){ | |
return { | |
visitor: { | |
CallExpression(path) { | |
// ... | |
path.replaceWith(I18n$tCall({ | |
TH: import มา, | |
EN: import มา, | |
})) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment