Open fightuntilwedie opened 3 years ago
Hey, on linux you can start the app with LANGUAGE=FR_fr yarn start-prod
.
Could you give me more information? I've got the AppImage in a folder on the desktop and a shortcut/starter in the shortcut bar.
@fightuntilwedie sorry for the delay You would need to edit your shortcut to launch a script instead of the appimage directly.
Something like that should work
sudo gedit /usr/local/bin/session-desktop-localized.sh
Copy paste what's following in the opening window
#!/bin/bash
LANGUAGE=ru ~/Downloads/session-desktop-linux-x86_64-1.7.1.AppImage
In this same window edit the path to the appimage (here I used ~/Downloads/
but that's probably not your case)
In this same window edit the language you want to start the app in (here I used ru
for russian
)
Then, allow execution for this script:
sudo chmod +x /usr/local/bin/session-desktop-localized.sh
Finally, edit the shortcut you have in your shortcut bar to start this script directly by giving its fullpath like so /usr/local/bin/session-desktop-localized.sh
What would be the language you want the app in?
Hi and thank you for your answer. In the meantime I solved the issue by simply switching the whole system's language to English US. Hence, Session did the same! ;))
I think it would be great to have a language setting under settings -> appearance, to force Session language to be different from the system language
We could do that quite easily, but that would require a restart to take effect (localized strings are loaded on startup and not refresh after that)
Just waiting on UI designs to attach to this issue before this can be picked up
Just waiting on UI designs to attach to this issue before this can be picked up
Does this looks good enough?
I used native <select>
, removed default arrow by setting background image to none, added my own arrow built with 0px border hack which has var(--input-border-color) as color. Added transitions to ensure colors are animated during theme change.
From the technical side, I wanted to use window.get/setSettingValue but it wasn't available on startup in mainnode.ts, so I used userConfig instead with ipc events to sync between frontend and backend. It stores current language code in config and falls back the same way app falls back (process.env.LANGUAGE || app.getLocale() || 'en'
). Languages are stored as part before `character i.e. directory names in /_locales. Additionally, I'm using
app.relaunch();and
app.exit();` to restart electron after changing language.
Languages in <select>
are hardcoded and static, which means you have to edit this list each time new language is added or removed, because you need to write a language name anytime it's added anyway and I didn't want to spend time passing directory names into frontend, but I can patch this quickly if needed.
I can't create pull requests though, because I already forked this repository some time ago for https://github.com/VityaSchel/session-nodejs-bot and now it won't let me fork it second time 😅 I already submitted ticket to GitHub support, hopefully they'll be able to detach my bot framework into standalone repository tomorrow and then I'll create PR for review.
GitHub still does not let me fork this repository, so I'll put patch file here with changes and then I'll create PR as soon as I'm able to fork.
I am using Debian 11 and an unofficial LineageOS. Session App on both devices doesn't offer an option to change the UI's language. Would be great if it was implemented in future versions.