string | booleanRecord.<string, string>Parses the language map.
module:transifex-config~ParsedConfigParse a transifex client configuration file. Looks at the file line by line.
module:transifex-config~ParsedConfigstring | booleanCheck if a file matches the file_filter rule.
objectRecord.<string, string>Has a property for each key in the section, with trimmed name and value.
Record.<string, module:transifex-config~ConfigSection>Has a property for each section in the config. Each section has a property named after the key with its value assigned.
Author: Martin Giger
License: MIT
Kind: static class of transifex-config/lib/errors
Implements: Error
| Param | Type | Description |
|---|---|---|
| resource | string |
Path to the resource that has no matching config entry. |
Kind: static class of transifex-config/lib/errors
Implements: Error
| Param | Type | Description |
|---|---|---|
| resource | string |
Path to the resource that is the source file. |
Author: Martin Giger
License: MIT
stringstringmodule:transifex-config~ParsedConfigmodule:transifex-config~ParsedConfigstringmodule:transifex-config~ParsedConfigstringFile name of the config file from the base path.
Kind: static constant of transifex-config/lib/load-config
Read only: true
stringFile name of the rc file from the base path.
Kind: static constant of transifex-config/lib/load-config
Read only: true
module:transifex-config~ParsedConfigLoads and parses the transifex client config.
Kind: static method of transifex-config/lib/load-config
Returns: module:transifex-config~ParsedConfig - Parsed contents of the config.
Throws:
| Param | Type | Description |
|---|---|---|
| basePath | string |
Path the config is in. |
module:transifex-config~ParsedConfigLoads and parses the transifex login info.
Kind: static method of transifex-config/lib/load-config
Returns: module:transifex-config~ParsedConfig - Parsed contents of the rc.
Throws:
| Param | Type | Description |
|---|---|---|
| basePath | string |
Path the rc is in. |
| [service] | string |
Service host the RC should contain. |
stringLoads a file from the given path and returns its contents.
Kind: inner method of transifex-config/lib/load-config
Returns: string - Contents of the file.
Throws:
| Param | Type | Description |
|---|---|---|
| configPath | string |
Path to the file to load. |
module:transifex-config~ParsedConfigFixes the header names of the RC by re-assembling the host names instead of each domain part being a subsection.
Kind: inner method of transifex-config/lib/load-config
Returns: module:transifex-config~ParsedConfig - Normalized RC.
| Param | Type | Description |
|---|---|---|
| rc | object |
RC to normalize. |
string | booleanReturns: string | boolean - Returns the language if the file matches the
resource, else returns false.
| Param | Type | Description |
|---|---|---|
| basePath | string |
Base path to the transifex config. |
| localPath | string |
Full path to the resource file to match. |
| resource | string |
Resource to check if the local file matches. |
Record.<string, string>Parses the language map.
Returns: Record.<string, string> - A map of the language, with the local
language code as key and the remote language code as value.
| Param | Type | Default | Description |
|---|---|---|---|
| [langMapString] | string |
"''" |
Language map specification. |
| [langMap] | object |
{} |
Language map to inherit from. |
module:transifex-config~ParsedConfigParse a transifex client configuration file. Looks at the file line by line.
Returns: module:transifex-config~ParsedConfig - Configuration file
represented as an object.
| Param | Type | Description |
|---|---|---|
| content | string |
Configuration file contents. |
Kind: global class
stringmodule:transifex-config~\_getRCmodule:transifex-config~ParsedConfigArray.<module:transifex-config~ConfigSection>module:transifex-config~ConfigSectionbooleanstringThrows:
| Param | Type | Default | Description |
|---|---|---|---|
| [basePath] | string |
"require(\"app-root-path\")" |
Path the transifex configuration is in. Defaults to the best guess of the package root. |
stringBase path the config is read from.
Kind: instance property of transifex-config
module:transifex-config~\_getRCMemoized version of module:transifex-config~_getRC.
Kind: instance property of transifex-config
Extends: module:transifex-config~\_getRC
module:transifex-config~ParsedConfigKind: instance method of transifex-config
Returns: module:transifex-config~ParsedConfig - Parsed .tx/config as an
object. Will be cached.
Throws:
Array.<module:transifex-config~ConfigSection>Kind: instance method of transifex-config
Returns: Array.<module:transifex-config~ConfigSection> - Array of resources.
Throws:
module:transifex-config~ConfigSectionKind: instance method of transifex-config
Returns: module:transifex-config~ConfigSection - Config section for the
resource.
Throws:
NoMatchingResourceError There
is no matching resource.| Param | Type | Description |
|---|---|---|
| localPath | string |
Absolute local path of the resource to return the config entry of. |
| [matchSourceLang] | boolean |
If the resource should be returned when the path is for the source language of the resource. |
booleanCheck if a resource is the source resource.
Kind: instance method of transifex-config
Returns: boolean - If the resource is the source.
Throws:
| Param | Type | Description |
|---|---|---|
| resourcePath | string |
Path to check. |
stringKind: instance method of transifex-config
Returns: string - Mapped language code.
Throws:
| Param | Type | Description |
|---|---|---|
| lang | string |
Language code to map from local to external. |
| resource | module:transifex-config~ConfigSection |
Resource to get map the language for. |
Kind: global constant
Author: Martin Giger
License: MIT
module:transifex-config~ParsedConfigKind: global function
Returns: module:transifex-config~ParsedConfig - Parsed .transifexrc as an
object. Will be cached.
Throws:
this: {TransifexConfig}
| Param | Type | Description |
|---|---|---|
| [service] | string |
The config should contain this service URL. |
string | booleanCheck if a file matches the file_filter rule.
Kind: global function
Returns: string | boolean - REturns the language the file matches or false.
| Param | Type | Description |
|---|---|---|
| basePath | string |
Base path to the transifex config. |
| localPath | string |
Full path to the resource file to match. |
| fileFilter | string |
File filter the resource should match. |
objectKind: global function
Returns: object - Reference to the object with the requested keys.
| Param | Type | Description |
|---|---|---|
| keyPath | Array.<string> |
Path of keys that should be present in the nested object. |
| object | object |
Object to ensure the keys exist on. |
Record.<string, string>Has a property for each key in the section, with trimmed name and value.
Record.<string, module:transifex-config~ConfigSection>Has a property for each section in the config. Each section has a property named after the key with its value assigned.
Kind: global typedef