Language support for Notifications and xml exports

DoMiNiK 2 years ago

Would it not be possible to implement the option of language support for notifications and xml exports? For example, according to the language of the account, which will be stored in the database as the default language "en_US", "pl_PL, sk_SK,... and so on, and with the help of .vm from the templates folder, a notification will be sent in the specified language? I am currently solving it using the geozone because it can be the only localization to write in the traccar-server

I'm currently using this :D

#if($timezone.ID=="Europe/Bratislava")
Anton Tananaev 2 years ago

You can already do this. You can access account details in the template. Note that the language is not stored there, but you can add a custom attribute.

DoMiNiK 2 years ago

Can I find in some file which data is sent by java code to the Velocity Template? Or how do I write the attribute? $attribute.ID ?

Anton Tananaev 2 years ago

I believe it should something like $user.attributes.someAttribute.

DoMiNiK 2 years ago

Thx works :)

br0 a year ago

Could you please share the code? I would also like to change the notifications. thanks

DoMiNiK a year ago

Here is an example .vm file in templates

#if($user.attributes.language=="sk_SK")
EXAMPLE sk_SK
#else
NO LANG IN LIST maybe en_US ?
#end
nabil boumimimak a year ago

this will work except for the readOnly and deviceReadOnly users , these types of users doesnt have acces to write in the attributes