# Localization / translation

**URL:** <https://vaultwarden.discourse.group/t/localization-translation/2557>\
**Category:** Feature Requests\
**Created:** [April 4, 2023, 6:03pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557 "2023-04-04T18:03:03Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 4, 2023, 6:03pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/1 "2023-04-04T18:03:03Z")

</div>

Since all Bitwarden clients have been translated into many languages it would also be nice if Vaultwarden was not only available in English. Especially because there might be additional users who receive Vaultwarden mails and might not understand English as well as the admin of the server.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [April 4, 2023, 6:27pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/2 "2023-04-04T18:27:56Z")

</div>

If your users don’t understand English you can translate the [handlebar templates](https://github.com/dani-garcia/vaultwarden/tree/1.28.1/src/static/templates/email) into your preferred language.

You can use customized templates by

1. copying the respective files from `src/static/templates/email` to `data/templates/email` (where `data` refers to your `DATA_FOLDER` and I’m assuming you did not change the `TEMPLATES_FOLDER` to something else)
2. changing them (e.g. translate them - but be sure to keep the `{{variables}}` intact so the links still work) and
3. restarting vaultwarden to load them.

This can only be done server wide as there is currently no way to either provide the templates in multiple languages to the server or even then for the server to know which language a user wants or needs (i.e. the preferred/selected language is AFAIK only stored client-side / dependend on the client’s locale setting).

Note that the Bitwarden server also [has its mail templates in English](https://github.com/bitwarden/server/tree/master/src/Core/MailTemplates/Handlebars).

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 5, 2023, 8:47am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/3 "2023-04-05T08:47:58Z")

</div>

I’ve seen the template files too but I was thinking more of a variant that would benefit all users.  
The language could be set as a new option in the admin panel. The web vault also has a fixed language. Possibly this could be taken from there.  
Interesting that the Bitwarden server also has only English mail templates. Is that also the case with the cloud version? That could then become a unique feature of Vaultwarden.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [April 5, 2023, 9:31am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/4 "2023-04-05T09:31:57Z")

</div>

> [@kennymc.c](#):
>
> The web vault also has a fixed language. Possibly this could be taken from there.

The Bitwarden client supports over 50 languages but as I said the server does not even know about the client language settings. Because this is handled entirely client-side. So by default the web-vault just uses the Browser’s locale settings (i.e. which language you have selected). You can change it in your account’s settings to another language but this will only be stored in the Local Storage of that browser.

> [@kennymc.c](#):
>
> The language could be set as a new option in the admin panel.

I think that we would need to actually translate these files first before talking about specific solutions making this more convenient.

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 5, 2023, 10:38am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/5 "2023-04-05T10:38:15Z")

</div>

> [@stefan0xC](#):
>
> I think that we would need to actually translate these files first before talking about specific solutions making this more convenient.

That was the point of this feature request. Offering a community-driven solution like Crowdin to get the translations and then integrate them into the server.

> [@stefan0xC](#):
>
> The Bitwarden client supports over 50 languages but as I said the server does not even know about the client language settings. Because this is handled entirely client-side. So by default the web-vault just uses the Browser’s locale settings (i.e. which language you have selected). You can change it in your account’s settings to another language but this will only be stored in the Local Storage of that browser.

Why is the client language relevant? The language of mails and the admin panel could be set in the admin panel itself and as far as I know these settings are not stored locally.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [April 5, 2023, 10:47am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/6 "2023-04-05T10:47:46Z")

</div>

> [@kennymc.c](#):
>
> Why is the client language relevant?

You mentioned how it could be taken from the web-vault and I explained how this is (currently) not possible.

edit: I’ve created a wiki page that explains [how translating the email templates](https://github.com/dani-garcia/vaultwarden/wiki/Translating-the-email-templates) works.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [April 6, 2023, 7:54am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/7 "2023-04-06T07:54:35Z")

</div>

There is an item on there roadmap for `Enhanced Localization`, but that is not something we could use i think.

I’m not sure if we could leverage something like crowdin maybe to help and translate those mails. And then, we can only have one default language and not dynamic.

So, for now, i suggest to translate it your self.

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 6, 2023, 8:37am UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/8 "2023-04-06T08:37:31Z")

</div>

> [@BlackDex](#):
>
> There is an item on there roadmap for `Enhanced Localization`, but that is not something we could use i think.

As far as i know this Bitwarden roadmap item is for combining all Crowdin projects into one like they already did with the client Github repos. This will improve the translation consistency between all clients.

> [@BlackDex](#):
>
> I’m not sure if we could leverage something like crowdin maybe to help and translate those mails. And then, we can only have one default language and not dynamic.

I doesn’t need to be Crowdin. Other repos using Github itself where translators create a PR with their translated template files. But plattforms like Crowdin make it easier of course.  
Isn’t it relatively easy to integrate a language selection which templates should be used into the admin panel, or am I missing something?

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [April 6, 2023, 1:44pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/9 "2023-04-06T13:44:25Z")

</div>

Still, Bitwarden only has English for emails too.  
The localization per user is not stored in the database and only within the clients.

Bitwarden also does not support storing the language profile of the user on the server.  
The only thing we could do is make some kind of selection in the admin/env where you can say i want to use `en_US`, `nl_NL` or `de_DE` as default mail language. And if that folder exists then use that.  
But for one, we do not have that available right now. We do not support multi-language mails.

And, you would then force all users to use that default language, and no way to use a different language for specific users.

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 6, 2023, 2:06pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/10 "2023-04-06T14:06:20Z")

</div>

If the default language is English most of the users wouldn’t even notice this new language setting.  
Setting a different language for specific users is a special use case in my opinion. I think all users can agree to use one language that was set by the admin.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [April 6, 2023, 5:26pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/11 "2023-04-06T17:26:00Z")

</div>

You can already **set** the language by providing the translated handlebar files in `data/templates/email/` - the problem is that those translations **do not exist** yet. We don’t have the manpower to translate those files ourselves and so far there has been neither the demand nor an effort to share those translations.

So the first step for me would be for others to somehow provide translated files - maybe we could collect them on the wiki page I’ve linked above?

Having a mechanism to make this easier than downloading files from another repository and integrating it into the vaultwarden server itself is something we can discuss once there is a substantial number of translations, so we can keep them up-to-date ourselves somehow. But at least for now I don’t think there is a reason to work on improving the existing mechanism.

Regarding crowdin: I don’t have any experience in setting up crowdin (and it looks like it’s a proprietary product so maybe we want to use another solution) but maybe you could step up and begin by setting up a `vaultwarden_l10n` project yourself with just those email templates?

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 6, 2023, 7:41pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/12 "2023-04-06T19:41:58Z")

</div>

I will try to create a translation for the whole template folder including the admin panel. The wiki page would be a start.  
I also tried to create a new project at Crowdin with these template files. This worked in principle, but because the files also contain other code that should not be translated, manual work is necessary. It seems that Crowdin only allows you to show or hide automatically recognized code parts for the translators. Removing parts from it does not work if it is not a supported format.  
Alternatives would be Weblate and POEditor. Weblate is open source, but only free if you host it yourself. According to the docs, it at least supports HTML files and could probably recognize most of them automatically. HBS specific parts probably not. POEditor does not even accept HBS or HTML files.  
I think the best way would be to create one or more files in a supported format (e.g. json files like Bitwarden [clients/messages.json at master · bitwarden/clients · GitHub](https://github.com/bitwarden/clients/blob/master/apps/browser/src/_locales/en/messages.json)), which contain only the strings to be translated. These would then also have to be replaced by variables in the HBS templates. I could create the list of all strings from the templates.  
I think if the barrier to translation is low as on such platforms, then with good communication here and on Github more languages could follow.

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 11, 2023, 7:53pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/13 "2023-04-11T19:53:14Z")

</div>

I have now translated all mail templates to German and created a Github repo for it: [https://github.com/kennymc-c/vaultwarden-lang-de](https://github.com/kennymc-c/vaultwarden-lang-de)

I also noticed a few issues and inconsistencies between plain text and html texts. For this I have created a PR.

I also left the 404 page out for now, since the graphic contains English text.  
I also tried to translate the admin panel via the template files in the admin folder but this seems to contain only a small part of all texts. Other parts are probably in the scripts folder or somewhere else but adapting them obviously doesn’t make sense if you don’t want to manually adapt every change to your translated version.  
Changes or additions to the original are also generally the big problem of this kind of translation as already mentioned in the wiki. If I would get an example how variables from another file should look like in the templates and how this variable file should look like, I could create that myself as a basis for other translations.

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [April 14, 2023, 8:41pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/14 "2023-04-14T20:41:43Z")

</div>

I’ve update the wiki page with a link to your repository so it is easier to find. 👍

> [@kennymc.c](#):
>
> If I would get an example how variables from another file should look like in the templates and how this variable file should look like, I could create that myself as a basis for other translations.

Sorry, I am not sure what you mean or trying to accomplish.

---

<div class="post-metadata">

**Author:** ![kennymc.c](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@kennymc.c](https://vaultwarden.discourse.group/u/kennymc.c)\
**Post date:** [April 15, 2023, 6:47pm UTC](https://vaultwarden.discourse.group/t/localization-translation/2557/15 "2023-04-15T18:47:21Z")

</div>

> [@stefan0xC](#):
>
> Sorry, I am not sure what you mean or trying to accomplish.

Handlebar files can already contain variables. My question was how a file should look like, in which these variables are defined or specified. Inserting content from other files already works via partials but here only the complete code from the other file is inserted. For translated strings it would have to be only certain parts of a file. Also, the English version of this file would have to be used as the master if a variable was missing from the translated file. Is this possible via handlebars or would it have to be solved in a completely different way?
