oxen-io / session-desktop

Session Desktop - Onion routing based messenger
https://getsession.org
GNU General Public License v3.0
1.44k stars 186 forks source link

feat: option to change UI language #3087

Open VityaSchel opened 2 months ago

VityaSchel commented 2 months ago

First time contributor checklist:

Contributor checklist:

Description

Feature request: #1877

This PR adds option to change app's UI language in settings under Appearance tab. I've used native <select> tag and hardcoded all languages as <option> tags. I've used dynamic CSS variables for theming and transition: var(--default-duration) for theme animation.

I've used userConfig which stores data to config.json (uiLanguage property) to save and load language set by user. If language isn't set yet, it falls back to default language, evaluating this: process.env.LANGUAGE || app.getLocale() || 'en'. After choosing language, app is restarted using app.relaunch(); app.exit();

I've added two events to ipc: get-ui-language, set-ui-language.

I've added two translation keys: uiLanguage, uiLanguageDescription.

KeeJef commented 1 month ago

We have some design changes incoming for this one, mainly switching the select tag to the native multi select modal that we use in various places in the Session app (inviting members to communities) and strings changes

KeeJef commented 4 weeks ago

Tracking internally via SES-2059