Reference·JavaScript · @bimworks/viewercommonJavaScript

Translator

Class in @bimworks/viewercommon.

API catalogue · @bimworks/viewercommon · Class

TypeScript#
class Translator

Display 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#

TypeScript#
constructor()

getDescription#

TypeScript#
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#

TypeScript#
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#

TypeScript#
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#

TypeScript#
static plural(key: string): string

The plural display name

Parameters#

Name Type Description
key string

pluralFirstUpper#

TypeScript#
static pluralFirstUpper(key: string): string

The plural display name, capitalised

Parameters#

Name Type Description
key string

translate#

TypeScript#
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