When updating browser on linux via AppImage (with zsync) doesn't wotk if the system is not in English
Captchas
- [X] I have read the instructions.
- [X] I have searched existing issues and avoided creating duplicates.
- [X] I am not filing an enhancement request.
What happened?
While using the appimage script (https://updates.zen-browser.app/appimage.sh) to update the browser to the latest version with zsync, the script doesn't work and doesn't update the browser if I have the system in other language different from English because the path used to find the zsync file is "${HOME}/Downloads/$file_base.AppImage.zsync" and in Spanish (LANG=es_ES.UTF-8) for example, the path should be "${HOME}/Descargas/$file_base.AppImage.zsync" because "Descargas" is the the name of the default directory for downloads. This happens because when you install the operating system the default directories are named in the language in which you perform the installation and therefore if this language is not English there will be no directory Downloads
Reproducible?
- [X] I have checked that this issue cannot be reproduced on Mozilla Firefox.
Version
1.0.2-b.2
What platform are you seeing the problem on?
Linux
Relevant log output
No response
I found 1 similar issue that might be helpful:
[1] The suggested solution is: Suggest using the default download folder from xdg-user-dirs, which relates to your problem by addressing the need for a language-agnostic path for the download directory.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
Does having the folder Downloads fix the issue?
As i'm not able to update the browser using bash <(curl https://updates.zen-browser.app/appimage.sh) and it only produces a ZenBrowser.AppImage.zsync file in the folder Downloads.
I honestly do not know because I have not tested it, I recommend you to look at the source code (I used wget https://updates.zen-browser.app/appimage.sh last time to check the problem presented), to see if maybe you have a problem that you are not considering.
While working on another project I had the same problem as now and looking around I found the command xdg-user-dir DOWNLOAD which basically fulfills this need although it doesn't necessarily work on all Linux desktop environments (although as far as I have seen in modern environments like GNOME, KDE, XFCE and Cinnamon it should work) but in case it doesn't work you could still use the path you already use today.
The resulting program could be the following:
# Get the download directory using xdg-user-dir, using Downloads as default value
DOWNLOAD_DIR=$(xdg-user-dir DOWNLOAD || echo "$HOME/Downloads")
# Set zsync file path
zsync_file="${DOWNLOAD_DIR}/${file_base}.AppImage.zsync"
If i have time i will open a Discussion in case someone knows a better way of handle it