UNPKG

golden-layout

Version:
71 lines 2.85 kB
import { AssertError } from '../errors/internal-error'; /** @public */ export var I18nStrings; (function (I18nStrings) { /** @internal */ let initialised = false; /** @internal */ const infosObject = { PopoutCannotBeCreatedWithGroundItemConfig: { id: 0 /* PopoutCannotBeCreatedWithGroundItemConfig */, default: 'Popout cannot be created with ground ItemConfig' }, PleaseRegisterAConstructorFunction: { id: 1 /* PleaseRegisterAConstructorFunction */, default: 'Please register a constructor function' }, ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned: { id: 2 /* ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned */, default: 'Component type not registered and BindComponentEvent handler not assigned', }, ComponentIsAlreadyRegistered: { id: 3 /* ComponentIsAlreadyRegistered */, default: 'Component is already registered', }, ComponentIsNotVirtuable: { id: 4 /* ComponentIsNotVirtuable */, default: 'Component is not virtuable. Requires rootHtmlElement field/getter', }, VirtualComponentDoesNotHaveRootHtmlElement: { id: 5 /* VirtualComponentDoesNotHaveRootHtmlElement */, default: 'Virtual component does not have getter "rootHtmlElement"', }, ItemConfigIsNotTypeComponent: { id: 6 /* ItemConfigIsNotTypeComponent */, default: 'ItemConfig is not of type component', }, InvalidNumberPartInSizeString: { id: 7 /* InvalidNumberPartInSizeString */, default: 'Invalid number part in size string', }, UnknownUnitInSizeString: { id: 8 /* UnknownUnitInSizeString */, default: 'Unknown unit in size string', }, UnsupportedUnitInSizeString: { id: 9 /* UnsupportedUnitInSizeString */, default: 'Unsupported unit in size string', }, }; I18nStrings.idCount = Object.keys(infosObject).length; /** @internal */ const infos = Object.values(infosObject); function checkInitialise() { if (!initialised) { for (let i = 0; i < I18nStrings.idCount; i++) { const info = infos[i]; if (info.id !== i) { throw new AssertError('INSI00110', `${i}: ${info.id}`); } else { i18nStrings[i] = info.default; } } } initialised = true; } I18nStrings.checkInitialise = checkInitialise; })(I18nStrings || (I18nStrings = {})); /** @public */ export const i18nStrings = new Array(I18nStrings.idCount); //# sourceMappingURL=i18n-strings.js.map