Translator
Class in @bimworks/viewercommon.
API catalogue · @bimworks/viewercommon · Class
class TranslatorDisplay names and help texts of BIM terms and feature paths
Members#
| Member | Kind | Description |
|---|---|---|
| constructor | Method | |
| getDescription | Method | A description of the key, "" when there is none; context refines it (for example the quantity strategy) |
| getMeasurementHelp | Method | The help text of a calculated quantity for a measurement |
| 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… |
| plural | Method | The plural display name |
| pluralFirstUpper | Method | The plural display name, capitalised |
| 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#
constructor()getDescription#
static getDescription(key: string, context?: object): stringA 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#
static getMeasurementHelp(key: string, context?: object, measurement?: unknown): stringThe help text of a calculated quantity for a measurement
Parameters#
| Name | Type | Description |
|---|---|---|
key |
string |
|
context |
object |
|
measurement |
unknown |
isMeasurementEstimated#
static isMeasurementEstimated(key: string, measurement?: unknown): booleanWhether 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#
static plural(key: string): stringThe plural display name
Parameters#
| Name | Type | Description |
|---|---|---|
key |
string |
pluralFirstUpper#
static pluralFirstUpper(key: string): stringThe plural display name, capitalised
Parameters#
| Name | Type | Description |
|---|---|---|
key |
string |
translate#
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 |