FileMappingRule

zanata/fileMapping~ FileMappingRule

The class to handle the mapping from the project type to the file name rule.

Constructor

new FileMappingRule(args)

Source:
Parameters:
Name Type Description
args Array.<object> | object

the Translation files mapping rules object represented by xml2json rules tags in zanata.xml

Properties
Name Type Description
rule object
Properties
Name Type Description
$t string
pattern string

Methods

getPath(type, params)

Source:

Obtain the file path

Parameters:
Name Type Description
type string

the project type

params object
Properties
Name Type Attributes Description
source string

the source document filename

locale string <optional>

the locale name

path string <optional>
filename string <optional>
extension string <optional>
Throws:

Unknown mapping type

Type
Error

getRealPath(type, params)

Source:

Obtain the absolute file path

Parameters:
Name Type Description
type string

the project type

params object
Properties
Name Type Attributes Description
source string

the source document filename

locale string <optional>

the locale name

path string <optional>
filename string <optional>
extension string <optional>
Throws:

Unknown mapping type

Type
Error

setMapping(type, pattern)

Source:

Set the mapping rule

Parameters:
Name Type Description
type string

the project type

pattern string

the file name pattern