@brightspace-ui/intl
Version:
Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.
21 lines (16 loc) • 516 B
JavaScript
import { getDocumentLocaleSettings } from './common.js';
export const TerminologyKey = Object.freeze({
LearningOutcomes: 'outcomes',
Educator: 'educator',
ModuleHierarchy: 'moduleHierarchy'
});
export function getTerminology(key) {
if (!key) {
throw new TypeError('Terminology key is required.');
}
if (!Object.values(TerminologyKey).includes(key)) {
throw new TypeError(`Invalid terminology key "${key}".`);
}
const terminology = getDocumentLocaleSettings().terminology;
return terminology[key];
}