babel-plugin-i18next-extract
Version:
Statically extract translation keys from i18next application.
17 lines (16 loc) • 726 B
TypeScript
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 `i18next.t`) 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 extractI18nextInstance(path: BabelCore.NodePath<BabelTypes.CallExpression>, config: Config, commentHints?: CommentHint[]): ExtractedKey[];