A TypeScript/JavaScript package for accessing Monta's terminology glossary with translations. Data is automatically updated daily from Monta's API and bundled statically for instant, offline-ready access to EV charging terminology across multiple languages.
- 🌍 Multi-language support - Access translations in multiple languages
- 🔍 Search functionality - Find terms by keyword or description
- 🏷️ Tag-based filtering - Get terms by category (industry, product, etc.)
- 📝 Text normalization - Replace alternative terms with canonical versions
- ⚡ Zero runtime dependencies - No API calls, all data bundled statically
- 🔄 Auto-updated - GitHub Action updates data daily from API
- 🔐 Type-safe - Full TypeScript support with comprehensive types
- 🚀 Instant access - No async/await needed, synchronous API
npm install @monta-app/glossaryOr with yarn:
yarn add @monta-app/glossaryNote: This package is published to GitHub Packages. If this is your first time installing from GitHub Packages, you'll need to authenticate first.
import { Glossary } from '@monta-app/glossary';
const glossary = new Glossary();
// Get a specific term (synchronous - no await needed!)
const term = glossary.getTerm('charging cable');
if (term) {
console.log(term.description);
console.log(term.translations['da']); // Danish: ladekabel
}
// Search for terms
const results = glossary.search('charge');
console.log(`Found ${results.length} results`);
// Get terms by tag
const productTerms = glossary.getByTag('product');
// Normalize text (replace alternatives with canonical terms)
const text = 'The e-car needs a charging wire';
const normalized = glossary.normalizeText(text);
// Output: "The EV needs a charging cable"const glossary = new Glossary();No configuration needed - the glossary loads from bundled static data.
All methods are synchronous and return data immediately.
Get a specific term by name.
const term = glossary.getTerm('charging cable');Search for terms matching a query in term names or descriptions.
const results = glossary.search('charge');Get all terms in the glossary.
const allTerms = glossary.getAll();Get all terms with a specific tag.
const industryTerms = glossary.getByTag('industry');Quick translation lookup for a term.
const translation = glossary.translate('charge key', 'da');
// Returns: "ladebrik"Get the total number of terms in the glossary.
const total = glossary.count();Get all available language codes.
const languages = glossary.getLanguages();
// Returns: ['da', 'de', 'en', 'es', ...]Replace alternative terms with their canonical versions.
const text = 'The e-car needs a charging wire';
const normalized = glossary.normalizeText(text);
// Returns: "The EV needs a charging cable"This method:
- Replaces alternative terms with canonical versions
- Respects word boundaries (won't replace partial matches)
- Honors case sensitivity settings per term
- Handles multiple occurrences
interface Term {
id: number;
term: string; // Canonical term name
description: string; // Full description with usage rules
caseSensitive: boolean; // Whether the term is case-sensitive
translatable: boolean; // Whether the term can be translated
forbidden: boolean; // Whether the term should be avoided
tags: string | null; // Comma-separated tags
translations: Record<string, string>; // Language code to translation mapping
alternativeWords: string[]; // Alternative words/phrases for this term
}Utility functions for working with terms.
import { TermHelpers } from '@monta-app/glossary';
// Check if term has a specific tag
if (TermHelpers.hasTag(term, 'industry')) {
console.log('This is an industry term');
}
// Get list of all tags for a term
const tags = TermHelpers.getTags(term);import { Glossary } from '@monta-app/glossary';
const glossary = new Glossary();
const term = glossary.getTerm('EV');
if (term) {
console.log(`${term.term}: ${term.description}`);
// Get all translations
for (const [lang, translation] of Object.entries(term.translations)) {
console.log(` ${lang}: ${translation}`);
}
}// Search for terms
const chargeTerms = glossary.search('charge');
// Filter by tag
const productTerms = glossary.getByTag('product');
const industryTerms = glossary.getByTag('industry');
// Get all terms
const allTerms = glossary.getAll();
console.log(`Total terms: ${glossary.count()}`);// Replace alternative terms with canonical ones
const userInput = 'My e-car is connected to the charging station';
const normalized = glossary.normalizeText(userInput);
// Result: "My EV is connected to the charge point"
// Useful for:
// - Standardizing user input
// - Normalizing content before indexing
// - Ensuring consistent terminology in documentation// Quick translation
const danishTerm = glossary.translate('charging cable', 'da');
console.log(danishTerm); // "ladekabel"
// Get all available languages
const languages = glossary.getLanguages();
console.log(`Available in ${languages.length} languages`);
// Translate multiple terms
const terms = ['EV', 'charge point', 'charging cable'];
for (const termName of terms) {
const term = glossary.getTerm(termName);
if (term) {
console.log(`${termName}:`);
console.log(` Danish: ${term.translations['da']}`);
console.log(` German: ${term.translations['de']}`);
}
}import { Glossary, TermHelpers } from '@monta-app/glossary';
const glossary = new Glossary();
const term = glossary.getTerm('charge point');
if (term) {
// Check for specific tag
if (TermHelpers.hasTag(term, 'industry')) {
console.log('This is an industry-standard term');
}
// Get all tags
const tags = TermHelpers.getTags(term);
console.log(`Tags: ${tags.join(', ')}`);
}const glossary = new Glossary();
// User submits a support ticket with inconsistent terminology
const userMessage = 'My e-car won\'t connect to the charging station';
// Normalize to use canonical terms
const normalized = glossary.normalizeText(userMessage);
// "My EV won't connect to the charge point"const glossary = new Glossary();
const currentLang = 'da'; // User's language
// Get all product terms in user's language
const productTerms = glossary.getByTag('product');
const localizedTerms = productTerms.map(term => ({
english: term.term,
localized: term.translations[currentLang] || term.term,
description: term.description
}));const glossary = new Glossary();
// Check if content uses forbidden terms
const content = 'Check out our new charging pole!';
const forbiddenTerms = (glossary.getAll())
.filter(t => t.forbidden);
for (const term of forbiddenTerms) {
if (content.toLowerCase().includes(term.term.toLowerCase())) {
console.warn(`Content uses forbidden term: ${term.term}`);
console.log(`Suggestion: Use alternatives like ${term.alternativeWords.join(', ')}`);
}
}