Localisation
This content is intended for advanced Studio users.
Form renderer uses a set of built-in English strings for UI elements such as button labels, validation messages, boolean presentation values, and date picker text. Override any of these strings using the setTranslation method.
Using setTranslation
Call setTranslation(lang, keyVals, isDefault) after the onFormRendered event fires. The method takes three arguments:
lang— an ISO 639-1 language code (for example,'fr'for French,'no'for Norwegian).keyVals— an object containing the translation keys to override and their replacement strings.isDefault— optional, defaults tofalse. Whentrue, the supplied strings are also used as the fallback for keys that the active language does not cover.
Keys not included in keyVals retain their default values.
For framework-specific examples of where and how to call this method, see the framework guides.
Placeholders
Strings can contain named placeholders that the renderer fills in at runtime — for example {max} in validation.decimalPlaces.max.
The built-in defaults listed below use single-brace ICU MessageFormat placeholders ({max}). Overrides passed to setTranslation may use either form: single-brace {max} or the legacy double-brace {{max}}, which is converted automatically. Use the same placeholder names as the default string — a placeholder the renderer does not supply is rendered empty.
The translateService option of EhrFormComponentsModule.forRoot() has been removed. Form renderer no longer uses ngx-translate internally, so a host TranslateService can no longer be injected into it. Override strings through setTranslation (or the translations option of forRoot()) instead.
Translation keys reference
The following list covers all available keys and their default English values.
{
'GENERAL_ERROR_NOTICE': 'Something went wrong',
'GENERIC_CANVAS.CANCEL': 'Cancel',
'GENERIC_CANVAS.CHANGE': 'Change image',
'GENERIC_CANVAS.CLEAR': 'Clear all',
'GENERIC_CANVAS.IMAGE_MISSING': 'Image missing',
'GENERIC_CANVAS.MARKUP': 'Markup',
'GENERIC_CANVAS.SAVE': 'Save',
'GENERIC_COLUMN_LIST.DATASOURCE_MISCONFIGURED': 'Datasource for this list is missing or it is not configured properly!',
'GENERIC_COLUMN_LIST.DATASOURCE_ERROR': 'Error loading data from API call.',
'MRD_IMAGE.BROKEN_IMAGE': 'Failed to load image',
'MRD_PROVENANCE.EMPTY': 'Empty',
'MRD_DATE.TODAY': 'Today',
'MRD_DATE.NOW': 'Now',
'MRD_PROVENANCE.FIELD_SET_UP_FOR_TRACKING': 'Field set up for tracking composition changes',
'MRD_PROVENANCE.NO_PROVENANCE_FOR_FIELD': 'Field has no previous values',
'MRD_PROVENANCE.PREVIOUS_VALUE': 'Field value provenance',
'boolean.no': '✗',
'boolean.presentation.false': 'False',
'boolean.presentation.no': 'No',
'boolean.presentation.null': '-',
'boolean.presentation.true': 'True',
'boolean.presentation.yes': 'Yes',
'boolean.unknown': '-',
'boolean.yes': '✓',
'browseFiles': 'browse',
'clearValue': 'Clear',
'date.month.april': 'April',
'date.month.august': 'August',
'date.month.december': 'December',
'date.month.february': 'February',
'date.month.january': 'January',
'date.month.july': 'July',
'date.month.june': 'June',
'date.month.march': 'March',
'date.month.may': 'May',
'date.month.november': 'November',
'date.month.october': 'October',
'date.month.september': 'September',
'date.short.day.friday': 'Fr',
'date.short.day.monday': 'Mo',
'date.short.day.saturday': 'Sa',
'date.short.day.sunday': 'Su',
'date.short.day.thursday': 'Th',
'date.short.day.tuesday': 'Tu',
'date.short.day.wednesday': 'We',
'date.short.month.april': 'Apr',
'date.short.month.august': 'Aug',
'date.short.month.december': 'Dec',
'date.short.month.february': 'Feb',
'date.short.month.january': 'Jan',
'date.short.month.july': 'Jul',
'date.short.month.june': 'Jun',
'date.short.month.march': 'Mar',
'date.short.month.may': 'May',
'date.short.month.november': 'Nov',
'date.short.month.october': 'Oct',
'date.short.month.september': 'Sep',
'dropFiles': 'Drop here or',
'duration.day': 'day/s',
'duration.day.ph': 'day',
'duration.hour': 'hour/s',
'duration.hour.ph': 'hr',
'duration.minute': 'minute/s',
'duration.minute.ph': 'min',
'duration.month': 'month/s',
'duration.month.ph': 'mo',
'duration.second': 'second/s',
'duration.second.ph': 'sec',
'duration.week': 'week/s',
'duration.week.ph': 'w',
'duration.year': 'year/s',
'duration.year.ph': 'yr',
'loading': 'Loading',
'model.notFound.byPath': "Model not found by ''{queryStr}' path.",
'model.notFound.byTag': "Model not found by ''{queryStr}' tag.",
'multimedia.upload': 'Upload',
'multimedia.attachmentPreview': 'Preview an attachment in a browser',
'multimedia.attachmentPreviewNotAvailable': 'Preview for this type of an attachment is not supported',
'multimedia.attachmentDownload': 'Download an attachment',
'multimedia.attachmentRemove': 'Remove attachment',
'multimedia.viewDocument': 'View Document',
'multimedia.downloadDocument': 'Download Document',
'multimedia.removeUpload': 'Remove upload',
'ngSelect.addItem': 'Add item',
'ngSelect.noItemsFound': 'No items found',
'notFound': 'Not found',
'other': 'Other',
'other.inputLabel': 'Other',
'other.selectOptionLabel': 'Other value',
'other.selectedLabel': 'Other: ',
'placeholder.numericRange': 'Insert value from {min} to {max}',
'placeholder.terminology': 'Type and select.',
'select.day': 'Day',
'select.month': 'Month',
'select.year': 'Year',
'unit.kg': 'kg',
'validation.dateInvalidPattern': 'Date pattern not valid: {datePattern}',
'validation.dateNotAfter': 'First valid date is {date}',
'validation.dateNotBefore': 'Last valid date is {date}',
'validation.dateOptional.closeSelection': 'skip optional selection',
'validation.dateOptional.requiredSelection': 'required selection',
'validation.decimalPlaces.max': 'Max. {max} decimal places. Remove excess decimal places.',
'validation.decimalPlaces.max.denominator': 'Max. {max} decimal places in denominator. Remove excess decimal places.',
'validation.decimalPlaces.max.numerator': 'Max. {max} decimal places in numerator. Remove excess decimal places.',
'validation.fileDownloadError.500': 'Failed to download file - Server error! Error code: {statusCode}',
'validation.fileUploadError': 'Failed to upload file - Please try again or contact support! Error code: {statusCode}',
'validation.fileUploadError.401': 'Failed to upload file - Authorization failed! Error code: {statusCode}',
'validation.fileUploadError.403': 'Failed to upload file - Insufficient user rights! Error code: {statusCode}',
'validation.fileUploadError.413': 'Failed to upload file - File too large{message}! Error code: {statusCode}',
'validation.fileUploadError.415': 'Failed to upload file - Unsupported file type! Error code: {statusCode}',
'validation.fileUploadError.500': 'Failed to upload file - Server error! Error code: {statusCode}',
'validation.greaterThanEqual': 'Min. value {gteValue}',
'validation.isNumeric': 'Entered value is not a number',
'validation.lessThanEqual': 'Max. value {lteValue}',
'validation.max.denominator': 'Den. najv. vred {operator} {value}',
'validation.max.duration': '{field} max val. {maxOp} {max}',
'validation.max.listOpen': 'Max. values reached.',
'validation.max.lt': 'Max. value {operator} {value}',
'validation.max.lt.denominator': 'Den. Max. value {operator} {value}',
'validation.max.lt.numerator': 'Numer. Max. value {operator} {value}',
'validation.max.lte': 'Max. value {operator} {value}',
'validation.max.lte.denominator': 'Den. Max. value {operator} {value}',
'validation.max.lte.numerator': 'Numer. Max. value {operator} {value}',
'validation.max.multi': 'Max. {max} remove {delta}',
'validation.max.numerator': 'Numer. Min. value {operator} {value}',
'validation.maxSelectedItems': 'Too many values selected',
'validation.min.denominator': 'Den. Min. value {operator} {value}',
'validation.min.duration': '{field} {minOp} {min}',
'validation.min.gt': 'Min. value {operator} {value}',
'validation.min.gt.denominator': 'Den. Min. value {operator} {value}',
'validation.min.gt.numerator': 'Numer. Min. value {operator} {value}',
'validation.min.gte': 'Min. value {operator} {value}',
'validation.min.gte.denominator': 'Den. Min. value {operator} {value}',
'validation.min.gte.numerator': 'Numer. Min. value {operator} {value}',
'validation.min.listOpen': 'Min. values not reached.',
'validation.min.multi': 'Min. {min} add {delta} more',
'validation.min.numerator': 'Numer. najm. vred. {operator} {value}',
'validation.minSelectedItems': 'Not enough values selected',
'validation.staleValuesSelected': 'Values with warnings are outdated. Please unselect them or choose other suitable options.',
'validation.staleValueSelected': 'This value is considered outdated and potentially no longer valid. Please unselect it or choose other suitable options.',
'validation.ngbDate': 'Date Invalid',
'validation.invalidDateFormat': 'Date Invalid',
'validation.ngbTime': 'Time Invalid',
'validation.numberOfSelectionsInvalid': 'Number of options between {numberOfSelectionsMin} and {numberOfSelectionsMax}',
'validation.pattern': 'Example: {patternValidExample}',
'validation.required': 'Required field',
'validation.required.anyGroupValue': 'Any input required.',
'validation.required.denominator': 'Den. required',
'validation.required.numerator': 'Numer. required',
'validation.required.unit': 'Unit is required.',
'validation.required.other': 'Other value should not be empty.',
'validation.terminologyCodeNotFound': 'Terminology code {codeValue} is not valid.',
'validation.isText.patternNoMatch': 'Value does not match expected pattern.',
'validation.customErrorMessage': '{customMessage}',
'validation.maxlength': 'Character limit exceeded',
'access.add_container': 'Add container',
'access.remove_container': 'Remove container',
'access.numerator': 'numerator',
'access.denominator': 'denominator',
'characters_left': 'You have {characters} characters remaining',
'MRD_TIMEPICKER.INCREMENT_HOURS': 'Increment hours',
'MRD_TIMEPICKER.INCREMENT_MINUTES': 'Increment minutes',
'MRD_TIMEPICKER.INCREMENT_SECONDS': 'Increment seconds',
'MRD_TIMEPICKER.DECREMENT_HOURS': 'Decrement hours',
'MRD_TIMEPICKER.DECREMENT_MINUTES': 'Decrement minutes',
'MRD_TIMEPICKER.DECREMENT_SECONDS': 'Decrement seconds',
'MRD_TIMEPICKER.HOURS': 'Hours',
'MRD_TIMEPICKER.MINUTES': 'Minutes',
'MRD_TIMEPICKER.SECONDS': 'Seconds',
}
Frequently asked questions (FAQs)
What does setTranslation do?
setTranslation overrides the default English strings used in the Form renderer UI — such as button labels, validation messages, boolean presentation values, and date picker text — for a given language code.
When should I call setTranslation?
Call setTranslation after the onFormRendered event fires. Calling it before the form has rendered will have no effect.
Can I use setTranslation for languages other than the form default language?
Yes. Pass any ISO 639-1 language code as the first argument. The override applies whenever the renderer is operating in that language, as set via the language attribute in EhrFormContext.