This fixes Element on older versions of Firefox by adding a Polyfill
for Intl.Segmenter. The Polyfill is conditionally imported so it only
inflates the initial bundle size by about 100 bytes. On browsers that
need it, the polyfill is quite large at 317Kb.
Users on these browser will still see the 'unsupported browser' screen,
but will be able to click through to use the app anyway. This keeps the
Intl.Segmenter modernizr check but this would also happen due to
https://github.com/element-hq/element-web/pull/27674
We don't work at all without this now and currently fail in terrible
ways. This will cause us to display the 'unsupported browser' screen
if we don't have wasm.
Also comment the three different types of error page.
Playwright test coming for this in react-sdk.
I plan to use v mode regexes to test for emoji sequences, and Michael has advised me that we need to ensure that the "incompatible browser" screen shows if they are not supported.
* Typescriptify & use service worker for MSC3916 authentication
* appease the linter
* appease jest
* appease linter
* Get the access token directly
* Add a bit of jitter
* Improve legibility, use factored-out functions for pickling
* Add docs
* Appease the linter
* Document risks of postMessage
* Split service worker post message handling out to function
* Move registration to async function
* Use more early returns
* Thanks(?), WebStorm
* Handle case of no access token for /versions
* Appease linter
* Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Remove spurious try/catch
* Factor out fetch config stuff
* Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Finish applying code review suggestions
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@nordeck/element-web-opendesk-module@0.4.0:
- Remove widget toggles
- Breaking Change: The module does not support the widget toggles anymore. The widget toggles are an own module now. See https://www.npmjs.com/package/@nordeck/element-web-widget-toggles-module.
@nordeck/element-web-widget-toggles-module@0.1.0:
- Initial version
Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
The loading test, which mocks a `/versions` response, currently mocks the
response of a 2-year-old server. This will soon be incompatible with the
JS-SDK. Update the test in preparation.
This adds all the labels that element-web has over element-meta to labels.yml. There is some deduplication to do that we can take care of over time. This at least should ensure that we don't lose anything we have to day while still benefiting from label sync.
commit 069c1bc833
Author: Johannes Marbach <johannesm@element.io>
Date: Sat Nov 11 16:08:30 2023 +0100
Replace worker-loader with built-in Webpack 5 support for web workers
This reverts commit e4d365a1ab.
This is better done through the project board automation, otherwise we risk
moving items out of "In Progress" back to "Qualification".
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/ka/
Co-authored-by: Nicholas Winterhalter <gewinum@gmail.com>
Co-authored-by: Weblate <translate@riot.im>
* Update all non-major dependencies
* Roll back typescript
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This is an experimental version of Element Call using a LiveKit SFU that we'd like to start dogfooding and gaining confidence on internally, so the current plan is to trial it on develop.element.io and Nightly for a while.
* Translated using Weblate (Vietnamese)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/vi/
* Translated using Weblate (Vietnamese)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/vi/
* Translated using Weblate (Portuguese)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/pt/
---------
Co-authored-by: someone1611 <hahahahacker2009@outlook.com>
Co-authored-by: Weblate <translate@riot.im>
Co-authored-by: Someone <hahahahacker2009@gmail.com>
Co-authored-by: luy dinilta <luydinilta@gufum.com>
* Translated using Weblate (Norwegian Bokmål)
Currently translated at 96.6% (29 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/nb_NO/
* Translated using Weblate (Portuguese)
Currently translated at 93.3% (28 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/pt/
---------
Co-authored-by: Thor Arne Johansen <tajcon@gmail.com>
Co-authored-by: Pedro costa <c.pedro@live.com.pt>
Most people probably only want the dev server to listen on localhost.
Additionally, overriding with `--host 0.0.0.0` here prevents passing a different
value for `--host` to yarn. For example:
```
$ yarnpkg start:js --host=::
yarn run v1.22.19
$ webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot --host=::
Unset VERSION variable - this may affect build output
✖ 「wds」: webpack Dev Server Invalid Options
options.host should be {String|Null} (https://webpack.js.org/configuration/dev-server/#devserverhost)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
* Bump @matrix-org/react-sdk-module-api to 0.0.4
* Move to latest matrix-react-sdk and yarn install to change react-sdk-module-api version
* Undo accidental change to matrix-react-sdk version
* One more yarn install
* Pass current language into Jitsi
Jitsi itself now uses the current language of the user. However, this does not yet apply to the welcome page of the Jitsi widget that says "Join conference", which is only hard-coded to
english for now.
Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
* Map between Element and Jitsi language codes
---------
Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
* Add some advice on good PR titles
* Extra 'the'
Co-authored-by: Germain <germains@element.io>
---------
Co-authored-by: Germain <germains@element.io>
* Jitsi requests 'io.element.requires_client' capability if auth token is provided
* Added a comment that Jitsi should request 'requires_client' capability to hide the popup icon in the Element if auth token is provided.
---------
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
* Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/pt_BR/
* Translated using Weblate (Arabic)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/ar/
* Translated using Weblate (Hungarian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/hu/
* Translated using Weblate (Icelandic)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/is/
Co-authored-by: Feroli <feroli@tuta.io>
Co-authored-by: Weblate <translate@riot.im>
Co-authored-by: Ali-x98 <ahj696@hotmail.com>
Co-authored-by: Balázs Meskó <meskobalazs@gmail.com>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
* Added translation using Weblate (Breton)
* Translated using Weblate (Thai)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/th/
* Translated using Weblate (Esperanto)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/eo/
* Translated using Weblate (Breton)
Currently translated at 3.3% (1 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/br/
* Translated using Weblate (Armenian)
Currently translated at 63.3% (19 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/hy/
Co-authored-by: jmguyader <jeanmarie.guyader@gmail.com>
Co-authored-by: pk'Mysickz <kokoloman001@gmail.com>
Co-authored-by: Christian Paul <info@jaller.de>
Co-authored-by: Aramayis Hovhannisyan <aramayis.hovhannisyan@gmail.com>
Co-authored-by: Weblate <translate@riot.im>
* Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hant/
* Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hans/
* Translated using Weblate (Galician)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/gl/
Co-authored-by: MomentQYC <yateam@foxmail.com>
Co-authored-by: Weblate <translate@riot.im>
Co-authored-by: phardyle <bradney_ccea@aleeas.com>
Co-authored-by: josé m <xosem@disroot.org>
* Lock file maintenance
* Hold @types/react back
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Update all non-major dependencies
* Hold back postcss-hexrgba - they violated semver
* Update @types/node
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update all non-major dependencies
* Hold back postcss-hexrgba - they violated semver
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Update all
* Hold back @types/react* & node-fetch & @testing-library/react
* Hold back webpack things, upgrading is hell
* Hold back more things
* Align deps
* Roll back @types/node
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
I've been experimenting with loading WebAssembly into EW, for which I need to
use webpack's default wasm loader. Currently we're overriding that for *all*
files called `*.wasm`, which is too broad.
There are currently two `*.wasm` artifacts in EW: `decoderWorker.min.wasm`, and
`olm.wasm`. `decoderWorker` has its own rule, so the `*.wasm` rule is only used
for `olm.wasm`. So, let's tighten up the test for that rule so that it doesn't
catch other innocent `.wasm`s in the cross-fire.
* Added translation using Weblate (Luxembourgish)
* Translated using Weblate (Turkish)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/tr/
* Translated using Weblate (German)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/de/
* Translated using Weblate (Indonesian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/id/
* Translated using Weblate (Korean)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/ko/
* Translated using Weblate (Czech)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/cs/
* Translated using Weblate (Ukrainian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/uk/
* Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/zh_Hant/
* Translated using Weblate (Slovak)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/sk/
* Translated using Weblate (French)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/fr/
* Translated using Weblate (Russian)
Currently translated at 96.6% (29 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/ru/
* Translated using Weblate (Italian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/it/
* Translated using Weblate (Persian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/fa/
* Translated using Weblate (Estonian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/et/
* Translated using Weblate (Hungarian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/hu/
* Translated using Weblate (Swedish)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/sv/
* Translated using Weblate (Bulgarian)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/bg/
* Translated using Weblate (Spanish)
Currently translated at 100.0% (30 of 30 strings)
Translation: Element Web/element-web
Translate-URL: https://translate.element.io/projects/element-web/element-web/es/
Co-authored-by: pierrebolze <pierre.bolze@epitech.eu>
Co-authored-by: Weblate <translate@riot.im>
Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com>
Co-authored-by: Vri <element@vrifox.cc>
Co-authored-by: Linerly <linerly@protonmail.com>
Co-authored-by: Youngbin Han <sukso96100@gmail.com>
Co-authored-by: waclaw66 <waclaw66@seznam.cz>
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
Co-authored-by: Jeff Huang <s8321414@gmail.com>
Co-authored-by: Jozef Gaal <preklady@mayday.sk>
Co-authored-by: Glandos <bugs-github@antipoul.fr>
Co-authored-by: DjAntony <djantony.org@yandex.ru>
Co-authored-by: random <dictionary@tutamail.com>
Co-authored-by: Seyed Masih Sajadi <smasihsajadi@gmail.com>
Co-authored-by: Priit Jõerüüt <riot@joeruut.com>
Co-authored-by: Szimszon <github@oregpreshaz.eu>
Co-authored-by: LinAGKar <linus.kardell@gmail.com>
Co-authored-by: Slavi Pantaleev <slavi@devture.com>
Co-authored-by: iaiz <git@iapellaniz.com>
@ -2,75 +2,75 @@ name: Bug report for the Element desktop app (not in a browser)
description:File a bug report if you are using the desktop Element application.
labels:[T-Defect]
body:
- type:markdown
attributes:
value:|
Thanks for taking the time to fill out this bug report!
- type:markdown
attributes:
value:|
Thanks for taking the time to fill out this bug report!
Please report security issues by email to security@matrix.org
- type:textarea
id:reproduction-steps
attributes:
label:Steps to reproduce
description:Please attach screenshots, videos or logs if you can.
placeholder:Tell us what you see!
value:|
1. Where are you starting? What can you see?
2. What do you click?
3. More steps…
validations:
required:true
- type:textarea
id:result
attributes:
label:Outcome
placeholder:Tell us what went wrong
value:|
#### What did you expect?
Please report security issues by email to security@matrix.org
- type:textarea
id:reproduction-steps
attributes:
label:Steps to reproduce
description:Please attach screenshots, videos or logs if you can.
placeholder:Tell us what you see!
value:|
1. Where are you starting? What can you see?
2. What do you click?
3. More steps…
validations:
required:true
- type:textarea
id:result
attributes:
label:Outcome
placeholder:Tell us what went wrong
value:|
#### What did you expect?
#### What happened instead?
validations:
required:true
- type:input
id:os
attributes:
label:Operating system
placeholder:Windows, macOS, Ubuntu, Arch Linux…
validations:
required:false
- type:input
id:version
attributes:
label:Application version
description:You can find the version information in Settings -> Help & About.
placeholder:e.g. Element version 1.7.34, olm version 3.2.3
validations:
required:false
- type:input
id:source
attributes:
label:How did you install the app?
description:Where did you install the app from? Please give a link or a description.
placeholder:e.g. From https://element.io/get-started
validations:
required:false
- type:input
id:homeserver
attributes:
label:Homeserver
description:|
Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex:Synapse/Dendrite/etc.) and the version.
placeholder:e.g. matrix.org or Synapse 1.50.0rc1
validations:
required:false
- type:dropdown
id:rageshake
attributes:
label:Will you send logs?
description:|
Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
options:
- 'Yes'
- 'No'
validations:
required:true
#### What happened instead?
validations:
required:true
- type:input
id:os
attributes:
label:Operating system
placeholder:Windows, macOS, Ubuntu, Arch Linux…
validations:
required:false
- type:input
id:version
attributes:
label:Application version
description:You can find the version information in Settings -> Help & About.
placeholder:e.g. Element version 1.7.34, olm version 3.2.3
validations:
required:false
- type:input
id:source
attributes:
label:How did you install the app?
description:Where did you install the app from? Please give a link or a description.
placeholder:e.g. From https://element.io/get-started
validations:
required:false
- type:input
id:homeserver
attributes:
label:Homeserver
description:|
Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex:Synapse/Dendrite/etc.) and the version.
placeholder:e.g. matrix.org or Synapse 1.50.0rc1
validations:
required:false
- type:dropdown
id:rageshake
attributes:
label:Will you send logs?
description:|
Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
description:You can find the version information in Settings -> Help & About.
placeholder:e.g. Element version 1.7.34, olm version 3.2.3
validations:
required:false
- type:input
id:homeserver
attributes:
label:Homeserver
description:|
Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex:Synapse/Dendrite/etc.) and the version.
placeholder:e.g. matrix.org or Synapse 1.50.0rc1
validations:
required:false
- type:dropdown
id:rageshake
attributes:
label:Will you send logs?
description:|
Did you know that you can send a /rageshake command from the web application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
options:
- 'Yes'
- 'No'
validations:
required:true
#### What happened instead?
validations:
required:true
- type:input
id:os
attributes:
label:Operating system
placeholder:Windows, macOS, Ubuntu, Arch Linux…
validations:
required:false
- type:input
id:browser
attributes:
label:Browser information
description:Which browser are you using? Which version?
placeholder:e.g. Chromium Version 92.0.4515.131
validations:
required:false
- type:input
id:webapp-url
attributes:
label:URL for webapp
description:Which URL are you using to access the webapp? If a private server, tell us what version of Element Web you are using.
description:You can find the version information in Settings -> Help & About.
placeholder:e.g. Element version 1.7.34, olm version 3.2.3
validations:
required:false
- type:input
id:homeserver
attributes:
label:Homeserver
description:|
Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex:Synapse/Dendrite/etc.) and the version.
placeholder:e.g. matrix.org or Synapse 1.50.0rc1
validations:
required:false
- type:dropdown
id:rageshake
attributes:
label:Will you send logs?
description:|
Did you know that you can send a /rageshake command from the web application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
description:Do you have a suggestion or feature request?
labels:[T-Enhancement]
body:
- type:markdown
attributes:
value:|
Thank you for taking the time to propose a new feature or make a suggestion.
- type:textarea
id:usecase
attributes:
label:Your use case
description:What would you like to be able to do? Please feel welcome to include screenshots or mock ups.
placeholder:Tell us what you would like to do!
value:|
#### What would you like to do?
- type:markdown
attributes:
value:|
Thank you for taking the time to propose an enhancement to an existing feature. If you would like to propose a new feature or a major cross-platform change, please [start a discussion here](https://github.com/element-hq/element-meta/discussions/new?category=ideas).
- type:textarea
id:usecase
attributes:
label:Your use case
description:What would you like to be able to do? Please feel welcome to include screenshots or mock ups.
placeholder:Tell us what you would like to do!
value:|
#### What would you like to do?
#### Why would you like to do it?
#### Why would you like to do it?
#### How would you like to achieve it?
validations:
required:true
- type:textarea
id:alternative
attributes:
label:Have you considered any alternatives?
placeholder:A clear and concise description of any alternative solutions or features you've considered.
validations:
required:false
- type:textarea
id:additional-context
attributes:
label:Additional context
placeholder:Is there anything else you'd like to add?
validations:
required:false
#### How would you like to achieve it?
validations:
required:true
- type:textarea
id:alternative
attributes:
label:Have you considered any alternatives?
placeholder:A clear and concise description of any alternative solutions or features you've considered.
validations:
required:false
- type:textarea
id:additional-context
attributes:
label:Additional context
placeholder:Is there anything else you'd like to add?
Everyone is welcome to contribute code to Element Web, provided that they are
willing to license their contributions under the same license as the project
@ -9,8 +8,7 @@ license the code under the same terms as the project's overall 'outbound'
license - in this case, Apache Software License v2 (see
[LICENSE](LICENSE)).
How to contribute
-----------------
## How to contribute
The preferred and easiest way to contribute changes to the project is to fork
it on github, and then create a pull request to ask us to pull your changes
@ -19,39 +17,48 @@ into our repo (https://help.github.com/articles/using-pull-requests/)
We use GitHub's pull request workflow to review the contribution, and either
ask you to make any refinements needed or merge it and make them ourselves.
Things that should go into your PR description:
* A changelog entry in the `Notes` section (see below)
* References to any bugs fixed by the change (in GitHub's `Fixes` notation)
* Describe the why and what is changing in the PR description so it's easy for
onlookers and reviewers to onboard and context switch. This information is
also helpful when we come back to look at this in 6 months and ask "why did
we do it like that?" we have a chance of finding out.
* Why didn't it work before? Why does it work now? What use cases does it
Your PR should have a title that describes what change is being made. This
is used for the text in the Changelog entry by default (see below), so a good
title will tell a user succinctly what change is being made. "Fix bug where
cows had five legs" and, "Add support for miniature horses" are examples of good
titles. Don't include an issue number here: that belongs in the description.
Definitely don't use the GitHub default of "Update file.ts".
As for your PR description, it should include these things:
- References to any bugs fixed by the change (in GitHub's `Fixes` notation)
- Describe the why and what is changing in the PR description so it's easy for
onlookers and reviewers to onboard and context switch. This information is
also helpful when we come back to look at this in 6 months and ask "why did
we do it like that?" we have a chance of finding out.
- Why didn't it work before? Why does it work now? What use cases does it
unlock?
* If you find yourself adding information on how the code works or why you
- If you find yourself adding information on how the code works or why you
chose to do it the way you did, make sure this information is instead
written as comments in the code itself.
* Sometimes a PR can change considerably as it is developed. In this case,
- Sometimes a PR can change considerably as it is developed. In this case,
the description should be updated to reflect the most recent state of
the PR. (It can be helpful to retain the old content under a suitable
heading, for additional context.)
* Include both **before** and **after** screenshots to easily compare and discuss
what's changing.
* Include a step-by-step testing strategy so that a reviewer can check out the
code locally and easily get to the point of testing your change.
* Add comments to the diff for the reviewer that might help them to understand
why the change is necessary or how they might better understand and review it.
- Include both **before** and **after** screenshots to easily compare and discuss
what's changing.
- Include a step-by-step testing strategy so that a reviewer can check out the
code locally and easily get to the point of testing your change.
- Add comments to the diff for the reviewer that might help them to understand
why the change is necessary or how they might better understand and review it.
We rely on information in pull request to populate the information that goes into
the changelogs our users see, both for Element Web itself and other projects on
which it is based. This is picked up from both labels on the pull request and
the `Notes:` annotation in the description. By default, the PR title will be
used for the changelog entry, but you can specify more options, as follows.
### Changelogs
There's no need to manually add Changelog entries: we use information in the
pull request to populate the information that goes into the changelogs our
users see, both for Element Web itself and other projects on which it is based.
This is picked up from both labels on the pull request and the `Notes:`
annotation in the description. By default, the PR title will be used for the
changelog entry, but you can specify more options, as follows.
To add a longer, more detailed description of the change for the changelog:
*Fix llama herding bug*
_Fix llama herding bug_
```
Notes: Fix a bug (https://github.com/matrix-org/notaproject/issues/123) where the 'Herd' button would not herd more than 8 Llamas if the moon was in the waxing gibbous phase
@ -60,7 +67,8 @@ Notes: Fix a bug (https://github.com/matrix-org/notaproject/issues/123) where th
For some PRs, it's not useful to have an entry in the user-facing changelog (this is
the default for PRs labelled with `T-Task`):
*Remove outdated comment from `Ungulates.ts`*
_Remove outdated comment from `Ungulates.ts`_
```
Notes: none
```
@ -68,16 +76,18 @@ Notes: none
Sometimes, you're fixing a bug in a downstream project, in which case you want
an entry in that project's changelog. You can do that too:
*Fix another herding bug*
_Fix another herding bug_
```
Notes: Fix a bug where the `herd()` function would only work on Tuesdays
element-web notes: Fix a bug where the 'Herd' button only worked on Tuesdays
```
This example is for Element Web. You can specify:
* matrix-react-sdk
* element-web
* element-desktop
- matrix-react-sdk
- element-web
- element-desktop
If your PR introduces a breaking change, use the `Notes` section in the same
way, additionally adding the `X-Breaking-Change` label (see below). There's no need
@ -85,17 +95,18 @@ to specify in the notes that it's a breaking change - this will be added
automatically based on the label - but remember to tell the developer how to
migrate:
*Remove legacy class*
_Remove legacy class_
```
Notes: Remove legacy `Camelopard` class. `Giraffe` should be used instead.
```
Other metadata can be added using labels.
* `X-Breaking-Change`: A breaking change - adding this label will mean the change causes a *major* version bump.
* `T-Enhancement`: A new feature - adding this label will mean the change causes a *minor* version bump.
* `T-Defect`: A bug fix (in either code or docs).
* `T-Task`: No user-facing changes, eg. code comments, CI fixes, refactors or tests. Won't have a changelog entry unless you specify one.
- `X-Breaking-Change`: A breaking change - adding this label will mean the change causes a _major_ version bump.
- `T-Enhancement`: A new feature - adding this label will mean the change causes a _minor_ version bump.
- `T-Defect`: A bug fix (in either code or docs).
- `T-Task`: No user-facing changes, eg. code comments, CI fixes, refactors or tests. Won't have a changelog entry unless you specify one.
If you don't have permission to add labels, your PR reviewer(s) can work with you
to add them: ask in the PR description or comments.
@ -104,8 +115,8 @@ We use continuous integration, and all pull requests get automatically tested:
if your change breaks the build, then the PR will show that there are failed
checks, so please check back after a few minutes.
Tests
-----
## Tests
Your PR should include tests.
For new user facing features in `matrix-js-sdk`, `matrix-react-sdk` or `element-web`, you
@ -113,7 +124,7 @@ must include:
1. Comprehensive unit tests written in Jest. These are located in `/test`.
2. "happy path" end-to-end tests.
These are located in `/cypress/e2e` in `matrix-react-sdk`, and
These are located in `/playwright/e2e` in `matrix-react-sdk`, and
are run using `element-web`. Ideally, you would also include tests for edge
and error cases.
@ -129,7 +140,7 @@ end-to-end test; which is best depends on what sort of test most concisely
exercises the area.
Changes to must be accompanied by unit tests written in Jest.
These are located in `/spec/` in `matrix-js-sdk` or `/test/` in `element-web`
These are located in `/spec/` in `matrix-js-sdk` or `/test/` in `element-web`
and `matrix-react-sdk`.
When writing unit tests, please aim for a high level of test coverage
@ -139,6 +150,7 @@ why it's not possible in your PR.
Some sections of code are not sensible to add coverage for, such as those
which explicitly inhibit noisy logging for tests. Which can be hidden using
an istanbul magic comment as [documented here][1]. See example:
```javascript
/* istanbul ignore if */
if (process.env.NODE_ENV !== "test") {
@ -160,8 +172,8 @@ tests later will become progressively more difficult.
If you're not sure how to approach writing tests for your change, ask for help
in [#element-dev](https://matrix.to/#/#element-dev:matrix.org).
Code style
----------
## Code style
Element Web aims to target TypeScript/ES6. All new files should be written in
TypeScript and existing files should use ES6 principles where possible.
@ -174,11 +186,11 @@ The remaining code style is documented in [code_style.md](./code_style.md).
Contributors are encouraged to it and follow the principles set out there.
Please ensure your changes match the cosmetic style of the existing project,
and ***never*** mix cosmetic and functional changes in the same commit, as it
and **_never_** mix cosmetic and functional changes in the same commit, as it
makes it horribly hard to review otherwise.
Attribution
-----------
## Attribution
Everyone who contributes anything to Matrix is welcome to be listed in the
AUTHORS.rst file for the project in question. Please feel free to include a
change to AUTHORS.rst in your pull request to list yourself and a short
@ -187,12 +199,12 @@ give away to contributors - if you feel that Matrix-branded apparel is missing
from your life, please mail us your shipping address to matrix at matrix.org
and we'll try to fix it :)
Sign off
--------
## Sign off
In order to have a concrete record that your contribution is intentional
and you agree to license it under the same terms as the project's license, we've
adopted the same lightweight approach that the Linux Kernel
(https://github.com/docker/docker/blob/master/CONTRIBUTING.md), and many other
projects use: the DCO (Developer Certificate of Origin:
http://developercertificate.org/). This is a simple declaration that you wrote
@ -259,19 +271,27 @@ on Git 2.17+ you can mass signoff using rebase:
git rebase --signoff origin/develop
```
Review expectations
===================
## Private sign off
See https://github.com/vector-im/element-meta/wiki/Review-process
If you would like to provide your legal name privately to the Matrix.org
Foundation (instead of in a public commit or comment), you can do so by emailing
your legal name and a link to the pull request to dco@matrix.org. It helps to
include "sign off" or similar in the subject line. You will then be instructed
further.
Once private sign off is complete, doing so for future contributions will not
be required.
Merge Strategy
==============
# Review expectations
See https://github.com/element-hq/element-meta/wiki/Review-process
# Merge Strategy
The preferred method for merging pull requests is squash merging to keep the
commit history trim, but it is up to the discretion of the team member merging
the change. We do not support rebase merges due to `allchange` being unable to
handle them. When merging make sure to leave the default commit title, or
handle them. When merging make sure to leave the default commit title, or
at least leave the PR number at the end in brackets like by default.
When stacking pull requests, you may wish to do the following:
@ -279,5 +299,11 @@ When stacking pull requests, you may wish to do the following:
2. Branch from your base branch (branch1) to your work branch (branch2), push commits and open a pull request configuring the base to be branch1, saying in the description that it is based on your other PR.
3. Merge the first PR using a merge commit otherwise your stacked PR will need a rebase. Github will automatically adjust the base branch of your other PR to be develop.
Element has several tiers of support for different environments:
* Supported
* Definition: Issues **actively triaged**, regressions **block** the release
* Last 2 major versions of Chrome, Firefox, Safari, and Edge on desktop OSes
* Latest release of official Element Desktop app on desktop OSes
* Desktop OSes means macOS, Windows, and Linux versions for desktop devices
that are actively supported by the OS vendor and receive security updates
* Experimental
* Definition: Issues **accepted**, regressions **do not block** the release
* Element as an installed PWA via current stable version of Chrome, Firefox, and Safari
* Mobile web for current stable version of Chrome, Firefox, and Safari on Android, iOS, and iPadOS
* Not supported
* Definition: Issues only affecting unsupported environments are **closed**
* Everything else
- Supported
- Definition:
- Issues **actively triaged**, regressions **block** the release
- Last 2 major versions of Chrome, Firefox, and Edge on desktop OSes
- Last 2 versions of Safari
- Latest release of official Element Desktop app on desktop OSes
- Desktop OSes means macOS, Windows, and Linux versions for desktop devices
that are actively supported by the OS vendor and receive security updates
- Best effort
- Definition:
- Issues **accepted**, regressions **do not block** the release
- The wider Element Products(including Element Call and the Enterprise Server Suite) do still not officially support these browsers.
- The element web project and its contributors should keep the client functioning and gracefully degrade where other sibling features (E.g. Element Call) may not function.
- Last major release of Firefox ESR and Chrome/Edge Extended Stable
- Community Supported
- Definition:
- Issues **accepted**, regressions **do not block** the release
- Community contributions are welcome to support these issues
- Mobile web for current stable version of Chrome, Firefox, and Safari on Android, iOS, and iPadOS
- Not supported
- Definition: Issues only affecting unsupported environments are **closed**
- Everything else
The period of support for these tiers should last until the releases specified above, plus 1 app release cycle(2 weeks). In the case of Firefox ESR this is extended further to allow it land in Debian Stable.
For accessing Element on an Android or iOS device, we currently recommend the
Issues are triaged by community members and the Web App Team, following the [triage process](https://github.com/element-hq/element-meta/wiki/Triage-process).
Issues are triaged by community members and the Web App Team, following the [triage process](https://github.com/vector-im/element-meta/wiki/Triage-process).
We use [issue labels](https://github.com/vector-im/element-meta/wiki/Issue-labelling) to sort all incoming issues.
We use [issue labels](https://github.com/element-hq/element-meta/wiki/Issue-labelling) to sort all incoming issues.
@ -234,16 +254,59 @@ When Element is deployed alongside a homeserver with SSO-only login, some option
user can be sent to in order to log them out of that system too, making logout symmetric between Element and the SSO system.
2. `sso_redirect_options`: Options to define how to handle unauthenticated users. If the object contains `"immediate": true`, then
all unauthenticated users will be automatically redirected to the SSO system to start their login. If instead you'd only like to
have users which land on the welcome page to be redirected, use `"on_welcome_page": true`. As an example:
```json
{
"sso_redirect_options": {
"immediate": false,
"on_welcome_page": true
}
}
```
It is most common to use the `immediate` flag instead of `on_welcome_page`.
have users which land on the welcome page to be redirected, use `"on_welcome_page": true`. Additionally, there is an option to
redirect anyone landing on the login page, by using `"on_login_page": true`. As an example:
```json
{
"sso_redirect_options": {
"immediate": false,
"on_welcome_page": true,
"on_login_page": true
}
}
```
It is most common to use the `immediate` flag instead of `on_welcome_page`.
## Native OIDC
Native OIDC support is currently in labs and is subject to change.
Static OIDC Client IDs are preferred and can be specified under `oidc_static_clients` as a mapping from `issuer` to configuration object containing `client_id`.
Issuer must have a trailing forward slash. As an example:
```json
{
"oidc_static_clients": {
"https://auth.example.com/": {
"client_id": "example-client-id"
}
}
}
```
If a matching static client is not found, the app will attempt to dynamically register a client using metadata specified under `oidc_metadata`.
The app has sane defaults for the metadata properties below but on stricter policy identity providers they may not pass muster, e.g. `contacts` may be required.
The following subproperties are available:
1. `client_uri`: This is the base URI for the OIDC client registration, typically `logo_uri`, `tos_uri`, and `policy_uri` must be either on the same domain or a subdomain of this URI.
2. `logo_uri`: Optional URI for the client logo.
3. `tos_uri`: Optional URI for the client's terms of service.
4. `policy_uri`: Optional URI for the client's privacy policy.
5. `contacts`: Optional list of contact emails for the client.
As an example:
```json
{
"oidc_metadata": {
"client_uri": "https://example.com",
"logo_uri": "https://example.com/logo.png",
"tos_uri": "https://example.com/tos",
"policy_uri": "https://example.com/policy",
"contacts": ["support@example.com"]
}
}
```
## VoIP / Jitsi calls
@ -256,77 +319,84 @@ More information about the Jitsi setup can be found [here](./jitsi.md).
The VoIP and Jitsi options are:
1. `jitsi`: Optional configuration for how to start Jitsi conferences. Currently can only contain a single `preferred_domain`
value which points at the domain of the Jitsi instance. Defaults to `meet.element.io`. This is *not* used if the Jitsi widget
value which points at the domain of the Jitsi instance. Defaults to `meet.element.io`. This is _not_ used if the Jitsi widget
was created by an integration manager, or if the homeserver provides Jitsi information in `/.well-known/matrix/client`. For
example:
```json
{
"jitsi": {
"preferred_domain": "meet.jit.si"
}
}
```
```json
{
"jitsi": {
"preferred_domain": "meet.jit.si"
}
}
```
2. `jitsi_widget`: Optional configuration for the built-in Jitsi widget. Currently can only contain a single `skip_built_in_welcome_screen`
value, denoting whether the "Join Conference" button should be shown. When `true` (default `false`), Jitsi calls will skip to
the call instead of having a screen with a single button on it. This is most useful if the Jitsi instance being used already
has a landing page for users to test audio and video before joining the call, otherwise users will automatically join the call.
For example:
```json
{
"jitsi_widget": {
"skip_built_in_welcome_screen": true
}
}
```
```json
{
"jitsi_widget": {
"skip_built_in_welcome_screen": true
}
}
```
3. `voip`: Optional configuration for various VoIP features. Currently can only contain a single `obey_asserted_identity` value to
send MSC3086-style asserted identity messages during VoIP calls in the room corresponding to the asserted identity. This *must*
send MSC3086-style asserted identity messages during VoIP calls in the room corresponding to the asserted identity. This _must_
only be set in trusted environments. The option defaults to `false`. For example:
```json
{
"voip": {
"obey_asserted_identity": false
}
}
```
```json
{
"voip": {
"obey_asserted_identity": false
}
}
```
4. `widget_build_url`: Optional URL to have Element make a request to when a user presses the voice/video call buttons in the app,
if a call would normally be started by the action. The URL will be called with a `roomId` query parameter to identify the room
being called in. The URL must respond with a JSON object similar to the following:
```json
{
"widget_id": "$arbitrary_string",
"widget": {
"creatorUserId": "@user:example.org",
"id": "$the_same_widget_id",
"type": "m.custom",
"waitForIframeLoad": true,
"name": "My Widget Name Here",
"avatar_url": "mxc://example.org/abc123",
"url": "https://example.org/widget.html",
"data": {
"title": "Subtitle goes here"
}
},
"layout": {
"container": "top",
"index": 0,
"width": 65,
"height": 50
}
}
```
The `widget` is the `content` of a normal widget state event. The `layout` is the layout specifier for the widget being created,
as defined by the `io.element.widgets.layout` state event.
```json
{
"widget_id": "$arbitrary_string",
"widget": {
"creatorUserId": "@user:example.org",
"id": "$the_same_widget_id",
"type": "m.custom",
"waitForIframeLoad": true,
"name": "My Widget Name Here",
"avatar_url": "mxc://example.org/abc123",
"url": "https://example.org/widget.html",
"data": {
"title": "Subtitle goes here"
}
},
"layout": {
"container": "top",
"index": 0,
"width": 65,
"height": 50
}
}
```
The `widget` is the `content` of a normal widget state event. The `layout` is the layout specifier for the widget being created,
as defined by the `io.element.widgets.layout` state event. By default this applies to all rooms, but the behaviour can be skipped for
2-person rooms, causing Element to fall back to 1:1 VoIP, by setting the option `widget_build_url_ignore_dm` to `true`.
5. `audio_stream_url`: Optional URL to pass to Jitsi to enable live streaming. This option is considered experimental and may be removed
at any time without notice.
6. `element_call`: Optional configuration for native group calls using Element Call, with the following subkeys:
- `url`: The URL of the Element Call instance to use for native group calls. This option is considered experimental
- `url`: The URL of the Element Call instance to use for native group calls. This option is considered experimental
and may be removed at any time without notice. Defaults to `https://call.element.io`.
- `use_exclusively`: A boolean specifying whether Element Call should be used exclusively as the only VoIP stack in
- `use_exclusively`: A boolean specifying whether Element Call should be used exclusively as the only VoIP stack in
the app, removing the ability to start legacy 1:1 calls or Jitsi calls. Defaults to `false`.
- `participant_limit`: The maximum number of users who can join a call; if
this number is exceeded, the user will not be able to join a given call.
- `brand`: Optional name for the app. Defaults to `Element Call`. This is
used throughout the application in various strings/locations.
- `participant_limit`: The maximum number of users who can join a call; if
this number is exceeded, the user will not be able to join a given call.
- `brand`: Optional name for the app. Defaults to `Element Call`. This is
used throughout the application in various strings/locations.
- `guest_spa_url`: Optional URL for an Element Call single-page app (SPA),
for guest links. If this is set, Element Web will expose a "join" link
for public video rooms, which can then be shared to non-matrix users.
The target Element Call SPA is typically set up to use a homeserver that
allows users to register without email ("passwordless guest users") and to
federate.
## Bug reporting
@ -336,10 +406,10 @@ If you run your own rageshake server to collect bug reports, the following optio
not present in the config, the app will disable all rageshake functionality. Set to `https://element.io/bugreports/submit` to submit
rageshakes to us, or use your own rageshake server.
2. `uisi_autorageshake_app`: If a user has enabled the "automatically send debug logs on decryption errors" flag, this option will be sent
alongside the rageshake so the rageshake server can filter them by app name. By default, this will be `element-web`, as with any other
rageshake submitted by the app.
If you are using the element.io rageshake server, please set this to `element-auto-uisi` so we can better filter them.
alongside the rageshake so the rageshake server can filter them by app name. By default, this will be `element-auto-uisi`
(in contrast to other rageshakes submitted by the app, which use `element-web`).
3. `existing_issues_url`: URL for where to find existing issues.
4. `new_issue_url`: URL for where to submit new issues.
If you would like to use [Sentry](https://sentry.io/) for rageshake data, add a `sentry` object to your config with the following values:
@ -350,18 +420,17 @@ For example:
```json
{
"sentry": {
"dsn": "dsn-goes-here",
"environment": "production"
}
"sentry": {
"dsn": "dsn-goes-here",
"environment": "production"
}
}
```
## Integration managers
Integration managers are embedded applications within Element to help the user configure bots, bridges, and widgets. An integration manager
is a separate piece of software not typically available with your homeserver. To disable integrations, leave the options defined here out of
your config.
is a separate piece of software not typically available with your homeserver. To disable integrations, set the options defined here to `null`.
1. `integrations_ui_url`: The UI URL for the integration manager.
2. `integrations_rest_url`: The REST interface URL for the integration manager.
@ -371,15 +440,15 @@ If you would like to use Scalar, the integration manager maintained by Element,
@ -389,9 +458,9 @@ If you would like to include a custom message when someone is reporting an event
```json
{
"report_event": {
"admin_message_md": "Please be sure to review our [terms of service](https://example.org/terms) before reporting a message."
}
"report_event": {
"admin_message_md": "Please be sure to review our [terms of service](https://example.org/terms) before reporting a message."
}
}
```
@ -399,9 +468,7 @@ To add additional "terms and conditions" links throughout the app, use the follo
```json
{
"terms_and_conditions_links": [
{ "text": "Code of conduct", "url": "https://example.org/code-of-conduct" }
]
"terms_and_conditions_links": [{ "text": "Code of conduct", "url": "https://example.org/code-of-conduct" }]
}
```
@ -418,42 +485,9 @@ analytics are deemed impossible and the user won't be asked to opt in to the sys
There are additional root-level options which can be specified:
1. `analytics_owner`: the company name used in dialogs talking about analytics - this defaults to `brand`,
and is useful when the provider of analytics is different from the provider of the Element instance.
and is useful when the provider of analytics is different from the provider of the Element instance.
2. `privacy_policy_url`: URL to the privacy policy including the analytics collection policy.
## Server hosting links
If you would like to encourage matrix.org users to sign up for a service like [Element Matrix Services](https://element.io/matrix-services/server-hosting),
the following configuration options can be set. Note that if the options are missing from the configuration then the hosting prompts
will not be shown to the user.
1. `hosting_signup_link`: Optional URL to link the user to when talking about "Upgrading your account". Will contain a query parameter
of `utm_campaign` to denote which link the user clicked on within the app. Only ever applies to matrix.org users specifically.
2. `host_signup`: Optional configuration for an account importer to your hosting platform. The API surface of this is not documented
at the moment, but can be configured with the following subproperties:
1. `brand`: The brand name to use.
2. `url`: The iframe URL for the importer.
3. `domains`: The homeserver domains to show the importer to.
4. `cookie_policy_url`: The URL to the cookie policy for the importer.
5. `privacy_policy_url`: The URL to the privacy policy for the importer.
6. `terms_of_service_url`: The URL to the terms of service for the importer.
If you're looking to mirror a setup from our production/development environments, the following config should be used:
4. `latex_maths_delims`: An optional setting to override the default delimiters used for maths parsing. See https://github.com/matrix-org/matrix-react-sdk/pull/5939 for details. Only used when `feature_latex_maths` is enabled.
5. `voice_broadcast.chunk_length`: Target chunk length in seconds for the Voice Broadcast feature currently under development.
Customisations have been deprecated in favour of the [Module API](https://github.com/element-hq/element-web/blob/develop/docs/modules.md).
If you have use cases from customisations which are not yet available via the Module API please open an issue.
Customisations will be removed from the codebase in a future release.
---
Element Web and the React SDK support "customisation points" that can be used to
easily add custom logic specific to a particular deployment of Element Web.
@ -30,7 +38,7 @@ maintenance.
**Note**: The project deliberately does not exclude `customisations.json` from Git.
This is to ensure that in shared projects it's possible to have a common config. By
default, Element Web does *not* ship with this file to prevent conflicts.
default, Element Web does _not_ ship with this file to prevent conflicts.
### Custom components
@ -41,9 +49,10 @@ that properties/state machines won't change.
### Component visibility customisation
UI for some actions can be hidden via the ComponentVisibility customisation:
- inviting users to rooms and spaces,
- creating rooms,
- creating spaces,
- inviting users to rooms and spaces,
- creating rooms,
- creating spaces,
To customise visibility create a customisation module from [ComponentVisibility](https://github.com/matrix-org/matrix-react-sdk/blob/master/src/customisations/ComponentVisibility.ts) following the instructions above.
@ -55,6 +64,7 @@ might be shown to the user, but they won't have permission to invite users to
the current room: the button will appear disabled.
For example, to only allow users who meet a certain condition to create spaces:
```typescript
function shouldShowComponent(component: UIComponent): boolean {
if (component === UIComponent.CreateSpaces) {
@ -65,4 +75,5 @@ function shouldShowComponent(component: UIComponent): boolean {
return true;
}
```
In this example, all UI related to creating a space will be hidden unless the users meets the custom condition.
**Familiarise yourself with the [Important Security Notes](../README.md#important-security-notes) before starting, they apply to all installation methods.**
_Note: that for the security of your chats will need to serve Element over HTTPS.
Major browsers also do not allow you to use VoIP/video chats over HTTP, as WebRTC is only usable over HTTPS.
There are some exceptions like when using localhost, which is considered a [secure context](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts) and thus allowed._
## Release tarball
1. Download the latest version from <https://github.com/element-hq/element-web/releases>
1. Untar the tarball on your web server
1. Move (or symlink) the `element-x.x.x` directory to an appropriate name
1. Configure the correct caching headers in your webserver (see below)
1. Configure the app by copying `config.sample.json` to `config.json` and
modifying it. See the [configuration docs](config.md) for details.
1. Enter the URL into your browser and log into Element!
Releases are signed using gpg and the OpenPGP standard,
and can be checked against the public key located at <https://packages.element.io/element-release-key.asc>.
## Debian package
Element Web is now also available as a Debian package for Debian and Ubuntu based systems.
@ -24,13 +24,14 @@ Element will use the Jitsi server that is embedded in the widget, even if it is
one you configured. This is because conference calls must be held on a single Jitsi
server and cannot be split over multiple servers.
However, you can configure Element to *start* a conference with your Jitsi server by adding
However, you can configure Element to _start_ a conference with your Jitsi server by adding
to your [config](./config.md) the following:
```json
{
"jitsi": {
"preferredDomain": "your.jitsi.example.org"
}
"jitsi": {
"preferred_domain": "your.jitsi.example.org"
}
}
```
@ -46,11 +47,12 @@ domain will appear later in the URL as a configuration parameter.
**Hint**: If you want everyone on your homeserver to use the same Jitsi server by
default, and you are using element-web 1.6 or newer, set the following on your homeserver's
`/.well-known/matrix/client` config:
```json
{
"im.vector.riot.jitsi": {
"preferredDomain": "your.jitsi.example.org"
}
"im.vector.riot.jitsi": {
"preferredDomain": "your.jitsi.example.org"
}
}
```
@ -62,7 +64,7 @@ Element Android (1.0.5+) supports custom Jitsi domains, similar to Element Web a
calls work directly between clients or via TURN servers configured on the respective
homeservers.
For rooms with more than 2 joined members, when creating a Jitsi conference via call/video buttons of the toolbar (not via integration manager), Element Android will create a widget using the [wrapper](https://github.com/vector-im/element-web/blob/develop/docs/jitsi-dev.md) hosted on `app.element.io`.
For rooms with more than 2 joined members, when creating a Jitsi conference via call/video buttons of the toolbar (not via integration manager), Element Android will create a widget using the [wrapper](https://github.com/element-hq/element-web/blob/develop/docs/jitsi-dev.md) hosted on `app.element.io`.
The domain used is the one specified by the `/.well-known/matrix/client` endpoint, and if not present it uses the fallback defined in `config.json` (meet.element.io)
For active Jitsi widgets in the room, a native Jitsi widget UI is created and points to the instance specified in the `domain` key of the widget content data.
@ -4,6 +4,9 @@ If Labs is enabled in the [Element config](config.md), you can enable some of th
to `Settings->Labs`. This list is non-exhaustive and subject to change, chat in
[#element-web:matrix.org](https://matrix.to/#/#element-web:matrix.org) for more information.
If a labs features gets more stable, it _may_ be promoted to a beta feature
(see [Betas](https://github.com/element-hq/element-web/blob/develop/docs/betas.md)).
**Be warned! Labs features are not finalised, they may be fragile, they may change, they may be
dropped. Ask in the room if you are unclear about any details here.**
@ -34,29 +37,6 @@ date from the calendar.
Also adds the `/jumptodate 2022-01-31` slash command.
## Render simple counters in room header (`feature_state_counters`)
Allows rendering of labelled counters above the message list.
Once enabled, send a custom state event to a room to set values:
1. In a room, type `/devtools` to bring up the devtools interface
2. Click "Send Custom Event"
3. Toggle from "Event" to "State Event"
4. Set the event type to: `re.jki.counter` and give it a unique key
5. Specify the content in the following format:
```
{
"link": "",
"severity": "normal",
"title": "my counter",
"value": 0
}
```
That's it. Now should see your new counter under the header.
## New ways to ignore people (`feature_mjolnir`)
When enabled, a new settings tab appears for users to be able to manage their ban lists.
@ -83,11 +63,6 @@ present in the room. The Bridge info tab pulls information from the `m.bridge` s
bridges are not expected to be compatible, and users should not rely on this
tab as the single source of truth just yet.
## Presence indicator in room list (`feature_presence_in_room_list`)
This adds a presence indicator in the room list next to DM rooms where the other
person is online.
## Custom themes (`feature_custom_themes`)
Custom themes are possible through Element's [theme support](./theming.md), though
@ -97,67 +72,15 @@ theme definition.
For some sample themes, check out [aaronraimist/element-themes](https://github.com/aaronraimist/element-themes).
## Message preview tweaks
To enable message previews in the left panel for reactions in all rooms, enable `feature_roomlist_preview_reactions_all`.
To enable message previews for reactions in DMs only, enable `feature_roomlist_preview_reactions_dms`. This is ignored when it is enabled for all rooms.
## Dehydrated devices (`feature_dehydration`)
Allows users to receive encrypted messages by creating a device that is stored
encrypted on the server, as described in [MSC2697](https://github.com/matrix-org/matrix-doc/pull/2697).
## Breadcrumbs v2 (`feature_breadcrumbs_v2`)
Instead of showing the horizontal list of breadcrumbs under the filter field, the new UX is an interactive context menu
triggered by the button to the right of the filter field.
Extensible Events are a [new event format](https://github.com/matrix-org/matrix-doc/pull/1767) which
supports graceful fallback in unknown event types. Instead of rendering nothing or a blank space, events
can define a series of other events which represent the event's information but in different ways. The
base of these fallbacks being text.
Turning this flag on indicates that, when possible, the extensible events structure should be parsed on
supported event types. This should lead to zero perceptual change in the timeline except in cases where
the sender is using unknown/unrecognised event types.
Sending events with extensible events structure is always enabled - this should not affect any downstream
client.
## Right panel stays open (`feature_right_panel_default_open`)
This is an experimental default open right panel mode as a quick fix for those
who prefer to have the right panel open consistently across rooms.
If no right panel state is known for the room or it was closed on the last room
visit, it will default to the room member list. Otherwise, the saved card last
used in that room is shown.
## Pin drop location sharing (`feature_location_share_pin_drop`) [In Development]
Enables sharing a pin drop location to the timeline.
## Live location sharing (`feature_location_share_live`) [In Development]
Enables sharing your current location to the timeline, with live updates.
## Threaded Messaging (`feature_thread`)
Threading allows users to branch out a new conversation from the main timeline of a room. This is particularly useful in high traffic rooms where multiple conversations can happen in parallel or when a single discussion might stretch over a very long period of time.
Threads can be access by clicking their summary below the root event on the room timeline. Users can find a comprehensive list of threads by click the icon on the room header button.
This feature might work in degraded mode if the homeserver a user is connected to does not advertise support for the unstable feature `org.matrix.msc3440` when calling the `/versions` API endpoint.
## Video rooms (`feature_video_rooms`)
Enables support for creating and joining video rooms, which are persistent video chats that users can jump in and out of.
@ -174,15 +97,27 @@ This feature allows users to place and join native [MSC3401](https://github.com/
If you're enabling this at the deployment level, you may also want to reference the docs for the `element_call` config section.
## Disable per-sender encryption for Element Call (`feature_disable_call_per_sender_encryption`)
The default for embedded Element Call in Element Web is per-participant encryption.
This labs flag disables encryption for embedded Element Call in encrypted rooms.
Under the hood this stops Element Web from adding the `perParticipantE2EE` flag for the Element Call widget url.
This is useful while we experiment with encryption and to make calling compatible with platforms that don't use encryption yet.
## Rich text in room topics (`feature_html_topic`) [In Development]
Enables rendering of MD / HTML in room topics.
## Exploring public spaces (`feature_exploring_public_spaces`)
## New room header & details (`feature_new_room_decoration_ui`) [In Development]
Enables exploring public spaces in the new search dialog. Requires the server to
have [MSC3827](https://github.com/matrix-org/matrix-spec-proposals/pull/3827) enabled.
Refactors visually the room header and room sidebar
This documentation moved to the [`element-desktop`](https://github.com/vector-im/element-desktop/blob/develop/docs/native-node-modules.md) repository.
This documentation moved to the [`element-desktop`](https://github.com/element-hq/element-desktop/blob/develop/docs/native-node-modules.md) repository.
This mode uses an SSO flow to gain a `loginToken` from the authentication provider, then continues with SSO login.
Element Web uses [MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965) to discover the configured provider.
Wherever valid MSC2965 configuration is discovered, OIDC-aware login flow will be the only option offered.
## (🧪Experimental) OIDC-native flow
Can be enabled by a config-level-only setting in `config.json`
```json
{
"features": {
"feature_oidc_native_flow": true
}
}
```
See https://areweoidcyet.com/client-implementation-guide/ for implementation details.
Element Web uses [MSC2965: OIDC provider discovery](https://github.com/matrix-org/matrix-spec-proposals/pull/2965) to discover the configured provider.
Where OIDC native login flow is enabled and valid MSC2965 configuration is discovered, OIDC native login flow will be the only login option offered.
Element Web will attempt to [dynamically register](https://openid.net/specs/openid-connect-registration-1_0.html) with the configured OP.
Then, authentication will be completed [as described here](https://areweoidcyet.com/client-implementation-guide/).
#### Statically configured OIDC clients
Clients that are already registered with the OP can configure their `client_id` in `config.json`.
Where static configuration exists for the OP dynamic client registration will not be attempted.
> Tip: Paste this into the browser console to make the checkboxes on this page tickable. (Bear in mind that your ticks will be lost if you reload though.)
The develop branch holds the very latest and greatest code we have to offer, as such it may be less stable. It corresponds to the develop.element.io CD platform.
#### staging
The staging branch corresponds to the very latest release regardless of whether it is an RC or not. Deployed to staging.element.io manually.
#### master
The master branch is the most stable as it is the very latest non-RC release. Deployed to app.element.io manually.
The matrix-js-sdk follows semver, the matrix-react-sdk loosely follows semver, most releases for both will bump the minor version number.
Breaking changes will bump the major version number.
Element Web & Element Desktop do not follow semver and always have matching version numbers. The patch version number is normally incremented for every release.
- You will need access to the **VPN** ([docs](https://gitlab.matrix.org/new-vector/internal/-/wikis/SRE/Tailscale)) to be able to follow the instructions under Deploy below.
- You will need the ability to **SSH** in to the production machines to be able to follow the instructions under Deploy below. Ensure that your SSH key has a non-empty passphrase, and you registered your SSH key with Ops. Log a ticket at https://github.com/matrix-org/matrix-ansible-private and ask for:
- Two-factor authentication to be set up on your SSH key. (This is needed to get access to production).
- SSH access to `horme` (staging.element.io and app.element.io)
- Permission to sudo on horme as the user `element`
- You need "**jumphost**" configuration in your local `~/.ssh/config`. This should have been set up as part of your onboarding.
this will take `develop` and merge it into the `staging` on the chosen repositories.
For subsequent RCs, if you need to include a change you may PR it directly to the `staging` branch or rely on the
backport automation via labelling a PR to `develop` with `backport staging` which will cause a new PR to be opened
which backports the requested change to the `staging` branch.
For security, you may wish to merge the security advisory private fork or apply the patches manually and then push them directly to `staging`.
It is worth noting that at the end of the Final/Hotfix/Security release `staging` is merged to `master` which is merged back into `develop` -
this means that any commit which goes to `staging` will eventually make its way back to the default branch.
- [ ] The staging branch is prepared
# Releasing
Shortly after concluding the preparation stage (or pushing any changes to `staging` in general);
a draft release will be automatically made on the 4 project repositories with suggested changelogs and version numbers.
_Note: we should add a step here to write summaries atop the changelogs manually, or via AI_
Publishing the SDKs to npm also commits a dependency upgrade to the relevant downstream projects,
if you skip a layer of this release (e.g. for a hotfix) then the dependency will remain on `#develop` which will be
switched back to the version of the dependency from the master branch to not leak develop code into a release.
### Matrix JS SDK
- [ ] Check the draft release which has been generated by [the automation](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release-drafter.yml)
- [ ] Make any changes to the release notes in the draft release as are necessary - **Do not click publish, only save draft**
- [ ] Kick off a release using [the automation](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options.
### Matrix React SDK
- [ ] Check the draft release which has been generated by [the automation](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/release-drafter.yml)
- [ ] Make any changes to the release notes in the draft release as are necessary - **Do not click publish, only save draft**
- [ ] Kick off a release using [the automation](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options.
### Element Web
- [ ] Check the draft release which has been generated by [the automation](https://github.com/element-hq/element-web/actions/workflows/release-drafter.yml)
- [ ] Make any changes to the release notes in the draft release as are necessary - **Do not click publish, only save draft**
- [ ] Kick off a release using [the automation](https://github.com/element-hq/element-web/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options.
### Element Desktop
- [ ] Check the draft release which has been generated by [the automation](https://github.com/element-hq/element-desktop/actions/workflows/release-drafter.yml)
- [ ] Make any changes to the release notes in the draft release as are necessary - **Do not click publish, only save draft**
- [ ] Kick off a release using [the automation](https://github.com/element-hq/element-desktop/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options.
# Deploying
We ship the SDKs to npm, this happens as part of the release process.
We ship Element Web to dockerhub, `*.element.io`, and packages.element.io.
We ship Element Desktop to packages.element.io.
- [ ] Check that element-web has shipped to dockerhub
- [ ] Ensure Element Web package has shipped to packages.element.io
- [ ] Ensure Element Desktop packages have shipped to packages.element.io
# Housekeeping
We have some manual housekeeping to do in order to prepare for the next release.
- [ ] Update topics using [the automation](https://github.com/element-hq/element-web/actions/workflows/update-topics.yaml). It will autodetect the current latest version. Don't forget the date you supply should be e.g. September 5th (including the "th") for the script to work.
- [ ] Announce the release in [#element-web-announcements:matrix.org](https://matrix.to/#/#element-web-announcements:matrix.org)
<details><summary>(show)</summary>
With wording like:
> Element Web v1.11.24 is here!
>
> This version adds ... and fixes bugs ...
>
> Check it out at app.element.io, in Element Desktop, or from Docker Hub. Changelog and more details at https://github.com/element-hq/element-web/releases/tag/v1.11.24
</details>
For the first RC of a given release cycle do these steps:
- [ ] Go to the [matrix-js-sdk Renovate dashboard](https://github.com/matrix-org/matrix-js-sdk/issues/2406) and click the checkbox to create/update its PRs.
- [ ] Go to the [matrix-react-sdk Renovate dashboard](https://github.com/matrix-org/matrix-react-sdk/issues/9667) and click the checkbox to create/update its PRs.
- [ ] Go to the [element-web Renovate dashboard](https://github.com/element-hq/element-web/issues/22941) and click the checkbox to create/update its PRs.
- [ ] Go to the [element-desktop Renovate dashboard](https://github.com/element-hq/element-desktop/issues/465) and click the checkbox to create/update its PRs.
- [ ] Later, check back and merge the PRs that succeeded to build. The ones that failed will get picked up by the [maintainer](https://docs.google.com/document/d/1V5VINWXATMpz9UBw4IKmVVB8aw3CxM0Jt7igtHnDfSk/edit#).
For final releases additionally do these steps:
- [ ] Archive done column on the [team board](https://github.com/orgs/element-hq/projects/67/views/34) _Note: this should be automated_
- [ ] Add entry to the [milestones diary](https://docs.google.com/document/d/1cpRFJdfNCo2Ps6jqzQmatzbYEToSrQpyBug0aP_iwZE/edit#heading=h.6y55fw4t283z). The document says only to add significant releases, but we add all of them just in case.
`username-colors` is expected to contain 8 colors. `avatar-background-colors` is expected to contain 3 colors. Both values are optional and have fallbacks from the built-in theme.
These are exposed as `--username-colors_0`, ... and `--avatar-background-colors_0`, ... respectively in CSS.
`compound` may contain overrides for any [semantic design token](https://compound.element.io/?path=/docs/tokens-semantic-colors--docs) belonging to our design system. The above example shows how you might change the accent color to blue by setting the relevant semantic tokens to refer to blue [base tokens](https://compound.element.io/?path=/docs/tokens-color-palettes--docs).
All properties in `fonts` are optional, and will default to the standard Riot fonts.
- A working [Development Setup](../README.md#setting-up-a-dev-environment)
- Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
- Latest LTS version of Node.js installed
- Be able to understand English
- Be able to understand the language you want to translate Element into
- A working [Development Setup](../README.md#setting-up-a-dev-environment)
- Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
- Latest LTS version of Node.js installed
- Be able to understand English
## Translating strings vs. marking strings for translation
Translating strings are done with the `_t()` function found in matrix-react-sdk/lib/languageHandler.js. It is recommended to call this function wherever you introduce a string constant which should be translated. However, translating can not be performed until after the translation system has been initialized. Thus, sometimes translation must be performed at a different location in the source code than where the string is introduced. This breaks some tooling and makes it difficult to find translatable strings. Therefore, there is the alternative `_td()` function which is used to mark strings for translation, without actually performing the translation (which must still be performed separately, and after the translation system has been initialized).
Translating strings are done with the `_t()` function found in matrix-react-sdk/lib/languageHandler.js.
It is recommended to call this function wherever you introduce a string constant which should be translated.
However, translating can not be performed until after the translation system has been initialized.
Thus, sometimes translation must be performed at a different location in the source code than where the string is introduced.
This breaks some tooling and makes it difficult to find translatable strings.
Therefore, there is the alternative `_td()` function which is used to mark strings for translation,
without actually performing the translation (which must still be performed separately, and after the translation system has been initialized).
Basically, whenever a translatable string is introduced, you should call either `_t()` immediately OR `_td()` and later `_t()`.
Example:
```
// Module-level constant
const COLORS = {
@ -28,36 +34,49 @@ function getColorName(hex) {
}
```
## Key naming rules
These rules are based on https://github.com/element-hq/element-x-android/blob/develop/tools/localazy/README.md
At this time we are not trying to have a translation key per UI element as some methodologies use,
whilst that would offer the greatest flexibility, it would also make reuse between projects nigh impossible.
We are aiming for a set of common strings to be shared then some more localised translations per context they may appear in.
1. Ensure the string doesn't already exist in a related project, such as https://localazy.com/p/element
2. Keys for common strings, i.e. strings that can be used at multiple places must start by `action_` if this is a verb, or `common_` if not
3. Keys for common accessibility strings must start by `a11y_`. Example: `a11y_hide_password`
4. Otherwise, try to group keys logically and nest where appropriate, such as `keyboard_` for strings relating to keyboard shortcuts.
5. Ensure your translation keys do not include `.` or `|` or ` `. Try to balance string length against descriptiveness.
## Adding new strings
1. Check if the import ``import { _t } from 'matrix-react-sdk/src/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `yarn i18n` to update ``src/i18n/strings/en_EN.json``
1. If you added a string with a plural, you can add other English plural variants to ``src/i18n/strings/en_EN.json`` (remeber to edit the one in the same project as the source file containing your new translation).
1. Check if the import `import { _t } from 'matrix-react-sdk/src/languageHandler';` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add `_t()` to your string passing the translation key you come up with based on the rules above. If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `yarn i18n` to add the keys to `src/i18n/strings/en_EN.json`
1. Modify the new entries in `src/i18n/strings/en_EN.json` with the English (UK) translations for the added keys.
## Editing existing strings
1. Edit every occurrence of the string inside `_t()` and `_td()` in the JSX files.
1. Run `yarn i18n` to update `src/i18n/strings/en_EN.json`. (Be sure to run this in the same project as the JSX files you just edited.)
1. Run `yarn prunei18n` to remove the old string from `src/i18n/strings/*.json`.
Edits to existing strings should be performed only via Localazy.
There you can also require all translations to be redone if the meaning of the string has changed significantly.
## Adding variables inside a string.
1. Extend your ``_t()`` call. Instead of ``_t(STRING)`` use ``_t(STRING, {})``
1. Extend your `_t()` call. Instead of `_t(TKEY)` use `_t(TKEY, {})`
1. Decide how to name it. Please think about if the person who has to translate it can understand what it does. E.g. using the name 'recipient' is bad, because a translator does not know if it is the name of a person, an email address, a user ID, etc. Rather use e.g. recipientEmailAddress.
1. Add it to the array in ``_t`` for example ``_t(STRING, {variable: this.variable})``
1. Add the variable inside the string. The syntax for variables is ``%(variable)s``. Please note the _s_ at the end. The name of the variable has to match the previous used name.
1. Add it to the array in `_t` for example `_t(TKEY, {variable: this.variable})`
1. Add the variable inside the string. The syntax for variables is `%(variable)s`. Please note the _s_ at the end. The name of the variable has to match the previous used name.
- You can use the special ``count`` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. ``_t('You have %(count)s new messages', { count: 2 })`` would show 'You have 2 new messages', while ``_t('You have %(count)s new messages', { count: 1 })`` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in ``count`` is much prefered over having an if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two).
- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. ``_t('<a>Click here!</a>', {}, { 'a': (sub) => <a>{sub}</a> })``. If you don't do the tag substitution you will end up showing literally '<a>' rather than making a hyperlink.
- You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. ``_t('Your email address is %(emailAddress)s', { emailAddress: <i>{userEmailAddress}</i> })``.
- You can use the special `count` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. `_t('You have %(count)s new messages', { count: 2 })` would show 'You have 2 new messages', while `_t('You have %(count)s new messages', { count: 1 })` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in `count` is much preferred over having an if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two).
- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. `_t('<a>Click here!</a>', {}, { 'a': (sub) => <a>{sub}</a> })`. If you don't do the tag substitution you will end up showing literally '<a>' rather than making a hyperlink.
- You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. `_t('Your email address is %(emailAddress)s', { emailAddress: <i>{userEmailAddress}</i> })`.
## Things to know/Style Guides
- Do not use `_t()` inside ``getDefaultProps``: the translations aren't loaded when `getDefaultProps` is called, leading to missing translations. Use `_td()` to indicate that `_t()` will be called on the string later.
- If using translated strings as constants, translated strings can't be in constants loaded at class-load time since the translations won't be loaded. Mark the strings using `_td()` instead and perform the actual translation later.
- If a string is presented in the UI with punctuation like a full stop, include this in the translation strings, since punctuation varies between languages too.
- Avoid "translation in parts", i.e. concatenating translated strings or using translated strings in variable substitutions. Context is important for translations, and translating partial strings this way is simply not always possible.
- Concatenating strings often also introduces an implicit assumption about word order (e.g. that the subject of the sentence comes first), which is incorrect for many languages.
- Translation 'smell test': If you have a string that does not begin with a capital letter (is not the start of a sentence) or it ends with e.g. ':' or a preposition (e.g. 'to') you should recheck that you are not trying to translate a partial sentence.
- If you have multiple strings, that are almost identical, except some part (e.g. a word or two) it is still better to translate the full sentence multiple times. It may seem like inefficient repetion, but unlike programming where you try to minimize repetition, translation is much faster if you have many, full, clear, sentences to work with, rather than fewer, but incomplete sentence fragments.
- Do not use `_t()` inside `getDefaultProps`: the translations aren't loaded when `getDefaultProps` is called, leading to missing translations. Use `_td()` to indicate that `_t()` will be called on the string later.
- If using translated strings as constants, translated strings can't be in constants loaded at class-load time since the translations won't be loaded. Mark the strings using `_td()` instead and perform the actual translation later.
- If a string is presented in the UI with punctuation like a full stop, include this in the translation strings, since punctuation varies between languages too.
- Avoid "translation in parts", i.e. concatenating translated strings or using translated strings in variable substitutions. Context is important for translations, and translating partial strings this way is simply not always possible.
- Concatenating strings often also introduces an implicit assumption about word order (e.g. that the subject of the sentence comes first), which is incorrect for many languages.
- Translation 'smell test': If you have a string that does not begin with a capital letter (is not the start of a sentence) or it ends with e.g. ':' or a preposition (e.g. 'to') you should recheck that you are not trying to translate a partial sentence.
- If you have multiple strings, that are almost identical, except some part (e.g. a word or two) it is still better to translate the full sentence multiple times. It may seem like inefficient repetition, but unlike programming where you try to minimize repetition, translation is much faster if you have many, full, clear, sentences to work with, rather than fewer, but incomplete sentence fragments.
- Don't forget curly braces when you assign an expression to JSX attributes in the render method)
- Be able to understand the language you want to translate Element into
- Web Browser
- Be able to understand English
- Be able to understand the language you want to translate Element into
## Step 0: Join #element-translations:matrix.org
## Join #element-translations:matrix.org
1. Come and join https://matrix.to/#/#element-translations:matrix.org for general discussion
1. Come and join https://matrix.to/#/#element-translations:matrix.org for general discussion
2. Join https://matrix.to/#/#element-translators:matrix.org for language-specific rooms
3. Read scrollback and/or ask if anyone else is working on your language, and co-ordinate if needed. In general little-or-no coordination is needed though :)
## Step 1: Preparing your Weblate Profile
1. Head to https://translate.element.io and register either via Github or email
2. After registering check if you got an email to verify your account and click the link (if there is none head to step 1.4)
3. Log into weblate
4. Head to https://translate.element.io/accounts/profile/ and select the languages you know and maybe another language you know too.
3. Read scrollback and/or ask if anyone else is working on your language, and co-ordinate if needed. In general little-or-no coordination is needed though :)
## How to check if your language already is being translated
Go to https://translate.element.io/projects/element-web/ and visit the 2 sub-projects.
If your language is listed go to Step 2a and if not go to Step 2b
Go to https://localazy.com/p/element-web. If your language is listed then you can get started. Have a read
of https://localazy.com/docs/general/translating-strings if you need help getting started. If your language is not yet
listed please express your wishes to start translating it in the general discussion room linked above.
## Step 2a: Helping on existing languages.
### What are `%(something)s`?
1. Head to one of the projects listed https://translate.element.io/projects/element-web/
2. Click on the ``translate`` button on the right side of your language
3. Fill in the translations in the writeable field. You will see the original English string and the string of your second language above.
These things are placeholders that are expanded when displayed by Element. They can be room names, usernames or similar.
If you find one, you can move to the right place for your language, but not delete it as the variable will be missing if you do.
A special case is `%(count)s` as this is also used to determine which pluralisation is used.
Head to the explanations under Steb 2b
### What are `<link>Something</link>`
## Step 2b: Adding a new language
These things are markup tags, they encapsulate sections of translations to be marked up, with links, buttons, emphasis and such.
You must keep these markers surrounding the equivalent string in your language that needs to be marked up.
1. Go to one of the projects listed https://translate.element.io/projects/element-web/
2. Click the ``Start new translation`` button at the bottom
3. Select a language
4. Start translating like in 2a.3
5. Repeat these steps for the other projects which are listed at the link of step 2b.1
### When will my translations be available?
### What means the green button under the text field?
The green button let you save our translations directly. Please only use it if you are 100% sure about that translation. If you do not know a translation please DO NOT click that button. Use the arrows above the translations field and click to the right.
### What means the yellow button under the text field?
The yellow button has to be used if you are unsure about the translation but you have a rough idea. It adds a new suggestion to the string which can than be reviewed by others.
### What are "%(something)s"?
These things are variables that are expanded when displayed by Element. They can be room names, usernames or similar. If you find one, you can move to the right place for your language, but not delete it as the variable will be missing if you do.
A special case is `%(urlStart)s` and `%(urlEnd)s` which are used to mark the beginning of a hyperlink (i.e. `<a href="/somewhere">` and `</a>`. You must keep these markers surrounding the equivalent string in your language that needs to be hyperlinked.
### "I want to come back to this string. How?"
You can use inside the translation field "Review needed" checkbox. It will be shown as Strings that need to be reviewed.
### Further reading
The official Weblate doc provides some more in-depth explanation on how to do translations and talks about do and don'ts. You can find it at: https://docs.weblate.org/en/latest/user/translating.html
We automatically pull changes from Localazy 3 times a week, so your translations should be available at https://develop.element.io
within a few days of you submitting them and them being approved. They will then also be included in the following release cycle.