KeePassXC offers to rename the default database on non-English locales
Hello, By default, when creating a new password database, KeePassXC offers to save it using a localized file name by default (e.g., if Tails was started with the French language, `Mots de passe.kdbx`): ```c++ oldFilePath = QDir::toNativeSeparators(config()->get(Config::LastDir).toString() + "/" + tr("Passwords").append(".kdbx")); ``` (from [`src/gui/DatabaseWidget.cpp:1872-1873`](https://github.com/keepassxreboot/keepassxc/blob/2.6.2/src/gui/DatabaseWidget.cpp#L1872-L1873)) However, the default database name configured as `LastOpenedDatabases` in [`/etc/skel/.config/keepassxc/keepassxc.ini`](../5.0/config/chroot_local-includes/etc/skel/.config/keepassxc/keepassxc.ini#L6) is always `Passwords.kdbx`, whatever the selected language. The same goes for the [`/usr/local/bin/keepassxc`](../5.0/config/chroot_local-includes/usr/local/bin/keepassxc#L11) script. This discrepancy can lead to a warning message, which can be reproduced as follows: 1. Start Tails with a non-English locale (at least, a non-English language; e.g., French). 2. Start KeePassXC, create a new password database, and save it using the default name suggested by KeePassXC (e.g., `Mots de passe.kdbx`), under the persistent volume. 3. Close KeePassXC and start it again. Upon starting KeePassXC again, the `keepassxc` script will then open a dialog window and offer to rename the newly created database to `Passwords.kdbx` (“Do you want to rename your *KeePassXC* database?”, etc.). I'm afraid that this may be slightly confusing for a new user, who followed the default steps and is then told that the name they used for the database wasn't, in fact, the default one. Unfortunately, I couldn't think of any simple and satisfying way to solve this: - One could patch the KeePassXC translation files so that `tr("Passwords")` always translates to `"Passwords"`, so that KeePassXC always offers to save the new database to `Passwords.kdbx`. However, this would require a binary patch, and this might also prevent other instances of `Passwords` in KeePassXC from being properly translated. - Alternatively, one could patch the default KeePassXC configuration file `/etc/skel/.config/keepassxc/keepassxc.ini` and the launcher script `/usr/local/bin/keepassxc` so that they always use the localized name for the default database. However, if a user doesn't always use the same language localization when starting Tails, the `keepassxc` script will offer to rename the database file after each switch from one language to another; and even if the user chooses to stop the script from prompting for this option, the default `keepassxc.ini` will not always be in sync with the actual name of the database, and KeePassXC will not always be able to automatically open the database, which might also be confusing for the user. - Maybe a third possibility would be for the launcher script to check if the `~amnesia/.config/keepassxc/keepassxc.ini` is the default one (i.e., that it actually comes from the `/etc/skel`, and that it wasn't overwritten by a previous KeePassXC session) and, if so, tries to find whether there is a `.kbdx` file in the `Persistent` folder whose name is one of the possible KeePassXC-localized versions of `Passwords.kdbx` (maybe with a higher priority for the current language locale if there are several matches), and patch the `~amnesia/.config/keepassxc/keepassxc.ini` file to have the `LastOpenedDatabases` setting point to this file instead. However, the behavior of KeePassXC would still depend on the session's language locale. - Along the same lines, the `LastOpenedDatabases` setting for KeePassXC can specify a comma-separated list of several database files. Each existing file in the list is then opened, and missing files are ignored silently (see [`src/core/Bootstrap.cpp:118-123`](https://github.com/keepassxreboot/keepassxc/blob/2.6.2/src/core/Bootstrap.cpp#L118-L123)). Therefore, if the default configuration file `/etc/skel/.config/keepassxc/keepassxc.ini` was to specify all possible localized versions of `Passwords.kdbx` in the `LastOpenedDatabases` setting, KeePassXC would automatically open any database file whose name corresponds to a localized name for the default database in KeePassXC. However, if the user has several matching database files in their `Persistent` folder (e.g., if they have both `Passwords.kdbx` and `Mots de passe.kdbx`), KeePassXC would then open them all. - Maybe a simpler solution would be to update the translations of the KeePassXC documentation in the Tails wiki (such as [here](https://tails.boum.org/doc/encryption_and_privacy/manage_passwords/index.fr.html#index1h1), for the French translation) and to advise users to save their password database as `Passwords.kdbx`, regardless of the default name suggested by KeePassXC? Of course, this would only fix the issue for users following the Tails documentation, but that may be an acceptable middle ground. In any case, whatever the retained solution, I'm OK to try and work on a patch and propose a merge request along the lines you would deem to be the best. Also, apologies for this overly long report and for the absence of a proper solution to such a tiny issue! Thanks a lot in advance! snip
issue