Language support for Notifications and xml exports

DoMiNiK3 months 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 Tananaev3 months 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.

DoMiNiK3 months 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 Tananaev3 months ago

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

DoMiNiK3 months ago

Thx works :)

br03 months ago

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

DoMiNiK3 months 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 boumimimak3 months ago

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