UNPKG

babel-plugin-i18next-extract

Version:

Statically extract translation keys from i18next application.

17 lines (16 loc) 754 B
import * as BabelCore from "@babel/core"; import * as BabelTypes from "@babel/types"; import { CommentHint } from "../comments"; import { Config } from "../config"; import { ExtractedKey } from "../keys"; /** * Parse a call expression (likely a call to a `t` function) to find its * translation keys and i18next options. * * @param path: node path of the t function call. * @param config: plugin configuration * @param commentHints: parsed comment hints * @param skipCheck: set to true if you know that the call expression arguments * already is a `t` function. */ export default function extractTFunction(path: BabelCore.NodePath<BabelTypes.CallExpression>, config: Config, commentHints?: CommentHint[], skipCheck?: boolean): ExtractedKey[];