gpt-po
Version:
command tool for translate po files by gpt
33 lines (32 loc) • 1.36 kB
TypeScript
import { GetTextTranslations } from "gettext-parser";
/**
* copy source file to destination file if destination file does not exist
* @param file destination file path
* @param copyFile source file path
* @param force force copy file
*/
export declare function copyFileIfNotExists(file: string, copyFile: string, force?: boolean): void;
export declare function openFileByDefault(filePath: string): void;
export declare function parsePo(poFile: string, defaultCharset?: string): Promise<GetTextTranslations>;
export type CompileOptions = {
foldLength?: number;
sort?: boolean | ((a: never, b: never) => number);
escapeCharacters?: boolean;
};
export declare function compilePo(data: GetTextTranslations, poFile: string, options?: CompileOptions): Promise<void>;
export declare function printProgress(progress: number, total: number, extra?: string): void;
export declare function gitRootDir(dir?: string): string | null;
/**
* find config file in the following order:
* 1. current working directory of the Node.js process
* 2. git root directory
* 3. home directory
* @param fileName
* @returns full path of the config file
*/
export declare function findConfig(fileName: string): string;
/**
* open file explorer by platform
* @param location folder or file path
*/
export declare function openFileExplorer(location: string): void;