Alarm type l10z in notifications

gustavofariasa year ago

I noticed the type of the alarm in notification messages come as raw strings like 'powerCut' instead of 'Power Cut'. Is this expected?
Does the server has a main language that could be used to translate the alert types using the localization resources already used for the GUI?

Anton Tananaeva year ago

Which type on notification are we talking about?

gustavofariasa year ago

Alarm type notification. Every alarm notification has a subtype, and this subtype string is like I posted before.

#set($subject = "$device.name: alarm!")
$device.name alarm: $position.getString("alarm") at $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.eventTime, $locale, $timezone)

$position.getString("alarm") prints 'powerCut' in both short and full versions.

Anton Tananaeva year ago

Currently we don't localize it, but you can update the template to localize the value.

gustavofariasa year ago

Do you mean with ifs and elses?

Anton Tananaeva year ago

Yes.

Cristiana year ago
#set($subject = "$device.name: alarm!")
#if( $position.getString("alarm") == "general" )
#set($alarma = "General")
#elseif( $position.getString("alarm") == "sos" )
#set($alarma = "SOS")
#elseif( $position.getString("alarm") == "vibration" )
#set($alarma = "Vibracion")
.
.
.
#else
#set($alarma = "No Definida")
#end
$device.name alarma: $alarma a las $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.eventTime, $locale, $timezone)

I edited alarm.vm that way and it works fine.

Regards