Computed attribute translation

greendays2 years ago

Is it possible to have translations of a computed attribute name? If yes, what would the key in the language file look like?

Anton Tananaev2 years ago

You mean position attributes? The known ones already have translations. If you mean custom attributes, then you can add it the same way we have it now for existing ones.

greendays2 years ago

I created a computed attribute "signal" and assigned an expression to it. It shows up fine on the device status card. Then, I added an entry in the en.json file following the same naming convention as existing attributes (e.g. battery -> "positionBattery"):

"positionSignal": "Dev Signal",

but it's still showing "signal" on the Status Card.

Anton Tananaev2 years ago

Just adding the translation is not enough. Search the source code to see where you need to add the attribute.

greendays2 years ago

Got it... It worked. Thanks!