---
title: Translator
summary: Class in @bimworks/viewercommon.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/viewercommon
---

# Translator

[[page:reference/javascript/api|API catalogue]] · `@bimworks/viewercommon` · Class

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
class Translator
````

Display names and help texts of BIM terms and feature paths

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-constructor-6b2005029062|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-getdescription-f74e70a59b36|getDescription]] | Method | A description of the key, "" when there is none; context refines it (for example the quantity strategy) |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-getmeasurementhelp-62b8f3c8afc0|getMeasurementHelp]] | Method | The help text of a calculated quantity for a measurement |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-ismeasurementestimated-e85c0ae93422|isMeasurementEstimated]] | Method | Whether a measurement is an estimate (shown as "≈"): a calculated quantity is when its record names an `approximation` of the represented IFC geometry (curve… |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-plural-5a355ab1c0b9|plural]] | Method | The plural display name |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-pluralfirstupper-f56d2e645964|pluralFirstUpper]] | Method | The plural display name, capitalised |
| [[page:reference/javascript/bimworks-viewercommon/translator-380b3fa2#member-translate-6362d0ff8e43|translate]] | Method | The display name of a key (a feature path such as "calculated.quantities.netVolume"); the key itself when unknown. context refines it as in getDescription (f… |

## `constructor` {#member-constructor-6b2005029062}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
constructor()
````



## `getDescription` {#member-getdescription-f74e70a59b36}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static getDescription(key: string, context?: object): string
````

A description of the key, "" when there is none; context refines it (for example the quantity strategy)

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |
| `context` | `object` |  |

## `getMeasurementHelp` {#member-getmeasurementhelp-62b8f3c8afc0}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static getMeasurementHelp(key: string, context?: object, measurement?: unknown): string
````

The help text of a calculated quantity for a measurement

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |
| `context` | `object` |  |
| `measurement` | `unknown` |  |

## `isMeasurementEstimated` {#member-ismeasurementestimated-e85c0ae93422}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static isMeasurementEstimated(key: string, measurement?: unknown): boolean
````

Whether a measurement is an estimate (shown as "≈"): a calculated quantity is when its record names an
`approximation` of the represented IFC geometry (curved surfaces, an inferred axis, a sample) or a proven error
over the accepted limits. A record without the `approximation` field (written before calculator 6) is,
unless its accuracy is proven within the accepted limits

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |
| `measurement` | `unknown` |  |

## `plural` {#member-plural-5a355ab1c0b9}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static plural(key: string): string
````

The plural display name

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |

## `pluralFirstUpper` {#member-pluralfirstupper-f56d2e645964}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static pluralFirstUpper(key: string): string
````

The plural display name, capitalised

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |

## `translate` {#member-translate-6362d0ff8e43}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
static translate(key: string, context?: object): string
````

The display name of a key (a feature path such as "calculated.quantities.netVolume"); the key itself when
unknown. context refines it as in `getDescription` (for example a quantity of the enclosing box)

### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `string` |  |
| `context` | `object` |  |
