Create and upload translation glossaries using the Crowdin API
With Glossary, you can create, store, and manage all the project terminology in one place. The main aim of terminology is to explain some specific terms or the ones often used in the project, so they can be translated properly and consistently.
See support.crowdin.com/glossary and support.crowdin.com/api/upload-glossary for details.
npm install crowdin-glossary --save
const glossary = require('crowdin-glossary')({
project: 'your-crowdin-project',
crowdinKey: process.env.CROWDIN_KEY
})
glossary.add('IME', 'Input Method Editor. A program that...')
glossary.add('IPC', 'Inter-Process Communication. Electron uses IPC to send...')
glossary.add('MAS', 'Acronym for Apple Mac App Store.')
glossary.upload()
Returns a new empty glossary instance.
opts
Objectproject
String (required) - The name of your project on CrowdincrowdinKey
String (required) - If not supplied as an option, thenprocess.env.CROWDIN_KEY
will be the fallback.
openAfterUpload
Boolean (optional) - Open the project glossary in web browser after upload is complete. Defaults totrue
. This feature is disabled on CI environments by detectingprocess.env.CI
.
Adds an entry to the glossary instance. Entries only exist in memory until you
call glossary.upload()
term
String (required)description
String (required)
Async function that uploads all the added terms to Crowdin. On success, it returns the result of the POST request. On failure, it logs an error.
A getter that returns the existing added entries as a key-value object.
A getter that returns the web URL of your project's glossary on crowdin.com
A getter that converts your entries into a valid CSV string for upload to Crowdin. Used for internal purposes.
MIT