What format should my translation key be in to have @translateData find it?

#1

I’m looking at the documentation for the “label” field on CompoundMetric, but can’t tell based on that + the documentation for @translateData what my translation key should look like in order to have it translated by keyField=‘name’.

0 Likes

`translate` keyword
`name` field set to the value of `id` when creating AssetQuestion
#2

From the “Translation” documentation

2 Likes

#3

Can I do a similar thing outlined here, but instead of providing the format in the documentation:

data.Type name.object id.field name

Can I implement something that is similar, but instead translates an enumerated value of a given field in one of several ways? This would require the logic to work on all objects of a type. Example:

TypeA.field1 is enumerated to equal either ‘value1’ or ‘value2’

I want to translate ‘value1’ as ‘statement1’ and ‘value2’ as ‘statement2’ for all instances of the type.

0 Likes

#4

Thats case is exactly what is outlined

Example:

entity type Foo {
field: string enum (‘val1’, ‘val2’)
translated: string translate by ‘field’
}

Then Translation objects like:
"en.data.Foo.val1.translated, en, data.Foo.val1.translated, statement1"
“en.data.Foo.val2.translated, end, data.Foo.val2.translated, statement2”

Summary

This text will be hidden

0 Likes