0.1.1 • Published 3 years ago

@marnickvda/ngx-translate-spec v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Maintainers

MaintainerGitHub
Marnick van der ArendMarnickvdA

Maintenance Status: Actively Maintained

Prerequisites

Tested with Node v14.17.0

Installation

npm i --save-dev @marnickvda/ngx-translate-spec

Functions

initialize(translationsDirectory)

Initialize the specification for a new project

Kind: global function

ParamDescription
translationsDirectorydirectory in which your translation .json files are located

extractSpecificationFromImplementation(translationsDirectory, file)

This method can be used when you already have an existing implementation for your translations. You can extract the specification from this implementation. After you have created your specification, you can execute the copy translations function.

Kind: global function
See: copyTranslations

ParamDescription
translationsDirectorydirectory in which your translation .json files are located
filename of the file including its extension

copyTranslations(translationsDirectory, specPrefix)

This method adds missing fields from the translation specification to the implementation files. Additionally, a prefix can be added which helps with quickly fixing the implementations' translations.

Kind: global function

ParamDescription
translationsDirectorydirectory in which your translation .json files are located
specPrefixadds prefix to every specification field value that is missing in the implementation

Example

// adds 'TRANSLATE: ' to every field's value
copyTranslations('/i18n', 'TRANSLATE: ');

Authors

License

MIT

Contributors