How do I get Reports in other language than English?

How do I get Reports in other language in this case swedish? The user language is swedish and most of the reports settings is in swedish but none of the output pdf is.

I cant find any way to change the “locale” setting. Im running on docker compose. I cant find anything on locale in the documentation except this system information

Gramps 5.2.2
Gramps Web API 2.4.2
Gramps Web Frontend 24.8.0
Gramps QL 0.3.0
locale: en
multi-tree: false
task queue: true

Hi, the reports should actually have a drop-down to select the language. Unfortunately, the UI for reports would need some :heart:, there are some unresolved bugs like Graph Reports Broken · Issue #326 · gramps-project/gramps-web · GitHub, so it could be that the dropdown is not working correctly for you?

1 Like

Yes I have that same bug. But most dropdowns do work, but not id=“trans”.

But the default language should be swedish no nead to change or translate the report if the user dont need it in another language then swedish. There is no change needed on desktop. That way i figuerd I need too set som global variable for locale.

On client localStorage saves this,
grampsjs_settings:“{“lang”:“sv”,“serverLang”:“en”}”

serverLang should be sv as well. No need for en in my case.

You can set the environment variable LANGUAGE=sv, that should be enough.

However, that might stop working at some point in the future - supporting server languages other than English is problematic because the Gramps library, original written for a desktop app, translates many strings already at import time, and if they are not English, we cannot translate them to other languages. Moreover, there are issues with type names that might not be stored properly (Gramps represents types internally as numbers but represents them in JSON as strings, so it’s easy to inadvertently create a custom type instead of using a core type).

So, consider it a workaround for now. It would be a cleaner solution to let the dropdown default to the UI language.

That did solve it, and reports generate in the sv. Thank you.

I do understand that there is a larger problem with language support and that its not tested running it like this. Was looking for missing translation in the gramps-web code when I first saw this with some part translated and others not. But the en.json and sv.json have the same properties.

Example
Some missing translations with {“lang”:“sv”,“serverLang”:“en”}”

All is translated {“lang”:“sv”,“serverLang”:“sv”}

I will test running it like this and see if I encounter some odd behaviour or bug.

1 Like

Could you write up this process in English and swedish?

It seems as though it would be a common need to output in other than the server’s language. And to how report if the translation is partial.

Gramps documentation on forcing the language in use to be other than English.

Gramps Web is probably better since the developer’s native language is not English and he is well conditioned to change language settings. But it is easy to overlook documenting something when you are very familiar.

The International section in this forum does not have a Swedish subsection. Would you be open to helping add one?