0.1.1 • Published 3 years ago
@marnickvda/ngx-translate-spec v0.1.1
Maintainers
Maintainer | GitHub |
---|---|
Marnick van der Arend | MarnickvdA |
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
Param | Description |
---|---|
translationsDirectory | directory 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
Param | Description |
---|---|
translationsDirectory | directory in which your translation .json files are located |
file | name 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
Param | Description |
---|---|
translationsDirectory | directory in which your translation .json files are located |
specPrefix | adds prefix to every specification field value that is missing in the implementation |
Example
// adds 'TRANSLATE: ' to every field's value
copyTranslations('/i18n', 'TRANSLATE: ');
Authors
- Marnick van der Arend (MarnickvdA)
License
MIT