Skip to content

Latest commit

 

History

History
104 lines (63 loc) · 1.85 KB

api.md

File metadata and controls

104 lines (63 loc) · 1.85 KB

@intlify/cli API References

Table Of Contents

Function

compile

Compile i18n resources

Signature:

export declare function compile(source: string, output: string, options?: CompileOptions): Promise<boolean>;

Parameters

Parameter Type Description
source string the i18n resource source path, you can use glob pattern
output string the compiled i18n resource output path
options CompileOptions CompileOptions

Returns

true when all i18n resource successfuly compile, not false

Remarks

This functoin is asyncronous function. If you want to get about error details, use the handler of CompileOptions and CompileErrorCodes

Enum

CompileErrorCodes

Compile Error Codes

Signature:

export declare const enum CompileErrorCodes 

Members

Member Value Description
INTERNAL_COMPILE_ERROR 3 Internal compile error
INTERNAL_COMPILE_WARNING 2 Internal compile warning
NOT_SUPPORTED_FORMAT 1 Not supported format

Remarks

The error codes of compile function

Interface

CompileOptions

Compile Options

Signature:

export interface CompileOptions 

Remarks

This optioins is used at compile function

Methods

Properties

onCompile

Compile handler

Signature:

onCompile?: (source: string, output: string) => void;
onError

Compile Error handler

Signature:

onError?: (code: number, source: string, output: string, msg?: string) => void;