Translation Traccar 6.9.0 to Brazilian Portuguese

Mega Box Brasil 4 months ago

What is the correct language abbreviation I should set in the server attributes for Brazilian Portuguese in Traccar 6.9.0?
I tried the following options: pt-br, pt-BR, pt_br, pt_BR, pt-Br, pt_Br, ptbr and ptBr.

None of them worked, and all of them broke Traccar with the following error:

TypeError: Cannot destructure property 'data' of 'e.languages[e.language]' as it is undefined. at sn (http://domain/assets/index-BKUQrPv6.js:266:194585)......

When I set only pt (Portuguese from Portugal) or any other language, it works fine.

I’m facing issues with notifications, which are only coming in English. I created a translation folder inside the notifications folder with all the names I mentioned above, but none of them worked.

Anton Tananaev 4 months ago

Have you tried ptBR?

Mega Box Brasil 4 months ago

In the server attributes, ptBR worked!

But the notification translations didn’t work.

I created the folder traccar/templates/notifications/ptBR/ and translated, but it still comes in English.

I even translated something simple in the folder traccar/templates/notifications/en to test, but the change is not applied to the notifications. No matter what I set, they keep coming in English — even after restarting the service.

Anton Tananaev 4 months ago

Which notification channel are we talking about?

Anton Tananaev 4 months ago

And what type of notification?

Mega Box Brasil 4 months ago

All notifications and all delivery channels.

For example, I tested ignitionOn and ignitionOff, via web and Telegram.

I changed a single word in the file ignitionOn.vm, but the notification didn’t change.

I even deleted all folders in /home/mbbrasil/traccar/templates/notifications/ and left only the en folder to make sure it was reading from there, then modified something simple — just one word — only for testing. But no change is reflected in the received notification.

Anton Tananaev 4 months ago

Then you're definitely missing something. It must be taking those files from somewhere.

Junior_Man 4 months ago

Hello, I had the same problem here. When I created the translation folder, I had named it as /opt/traccar/templates/notifications/pt_BR and configured it in Traccar as ptBR, but it didn’t work. So, I changed the folder name to ptBR (/opt/traccar/templates/notifications/ptBR) and restarted the server, and then it started working perfectly.

Junior_Man 4 months ago

After renaming the translation folder to ptBR, I configured the system server option to use the ptBR language.

Captura de tela 2025-08-22 101549.jpg

Junior_Man 4 months ago

I managed to solve the problem by doing the following:

I changed the folder from

/opt/traccar/templates/translations/pt_BR.json → /opt/traccar/templates/translations/ptBR.json

And the folder /opt/traccar/templates/notifications/pt_BR → /opt/traccar/templates/notifications/ptBR

Then, in the global server configuration, I set the language to ptBR. The problem was solved this way.

However, on the other server it works without changing the pt_BR.json.

Anyway, that was the fix I found for now, and it’s working fine.

Junior_Man 4 months ago

I changed the folder to ptBR.json in translations because the alerts were coming in English. After this change, it worked, and now the alerts are coming in Portuguese correctly.

I also had to change the templates/notifications/pt_BR folder to ptBR, because if I didn’t, the other events would still come in English.

Anton Tananaev 4 months ago

This should fix the problem:

https://github.com/traccar/traccar-web/commit/88f3d855c8b46b7c6457081d82922101868eb5c8

Correct language code to use is pt_BR.

Junior_Man 4 months ago

When will this release be available?

Anton Tananaev 4 months ago

With the next release, but you can also install the preview:

https://www.traccar.org/preview/

Junior_Man 4 months ago

Thanks for it.