Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = {
rules: { 'no-console': 'off', 'import/no-extraneous-dependencies': 'off' },
},
{
files: ['ts/localization/*.ts', 'ts/localization/**/*.ts'], // anything in ts/localization has to only reference the files in that folder (this makes it reusable)
files: ['ts/localization/*.ts', 'ts/localization/generated/*.ts'], // anything in ts/localization has to only reference the files in that folder (this makes it reusable)
rules: {
'no-restricted-imports': [
'error',
Expand Down Expand Up @@ -210,6 +210,7 @@ module.exports = {
'8*',
'9*',
'!./*',
'!./generated/*',
], // Disallow everything except ts/localization, this is the worst,
// but regexes are broken on our eslint8, and upgrading it means
// we need to bump node, which needs to bump electron.... and having '*' makes the other rules droped..
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ stylesheets/dist/

*.LICENSE.txt
ts/webworker/workers/node/**/*.node
ts/localization/locales.ts

.yarn/
4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ coverage/
stylesheets/dist/**

# _locales files are generated by crowdin now.
ts/localization/locales.ts
ts/localization/constants.ts
_locales/
ts/localization/generated/
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python 3.12.2
node 20.18.2
python 3.12.2
84 changes: 19 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ If you use other node versions you might have or need a node version manager.
- Some node version management tools can read from the `.nvmrc` file and automatically make the change. If you use [asdf](https://asdf-vm.com/) you can make a [config change](https://asdf-vm.com/guide/getting-started.html#using-existing-tool-version-files) to support the `.nvmrc` file.
- We use [Yarn Classic](https://classic.yarnpkg.com) as our package manager. You can install it by running `npm install --global yarn`.

### Python
### Strings & Localization

You will need a [Python](https://www.python.org) version which matches our current version. You can check [`.tool-versions` in the `dev` branch](https://github.com/session-foundation/session-desktop/blob/dev/.tool-versions) to see what the current version is.
All user-facing strings are localized and managed via our [Localization Platform](https://getsession.org/translate).

If you use other python versions you might have or need a python version manager.
If you are working on a planned feature, you may need to get the latest localized strings. An
automated PR will exist to merge these changes into dev, either merge this PR into dev or merge
its commit into your branch.

- [asdf](https://asdf-vm.com/) - you can run `asdf install` in the project directory and it will use the python version specified in `.tool-versions`.
During development you can modify the [`ts/localization/locales.ts`] and ['ts/localization/english.ts']
files so your changes can be built and tested locally. You **must not** modify and commit
changes to any files in [`ts/localization/generated/`](ts/localization/generated/) as they are generated. If your
changes require new strings, they can be requested as part of the PR.

> [!WARNING]
> The package [setuptools](https://pypi.org/project/setuptools/) was removed in Python 3.12, so you'll need to install it manually.
### Python

```sh
python -m pip install --upgrade pip setuptools
```
You will need a [Python](https://www.python.org) version which matches our current version so you can use node-gyp. You can check [`.tool-versions` in the `dev` branch](https://github.com/session-foundation/session-desktop/blob/dev/.tool-versions) to see what the current version is.

See [node-gyp installation instructions](https://github.com/nodejs/node-gyp#installation) for setting up Python.

## Linux

Expand Down Expand Up @@ -84,18 +88,6 @@ python -m pip install --upgrade pip setuptools

You can get the current `<version>` from the [`.nvmrc`](.nvmrc).

- Verify your [Python](https://www.python.org/downloads/) version.

Most modern Linux distributions should come with Python 3 pre-installed.

It should be equal to or greater than the version specified in the [`.tool-versions`](.tool-versions).

- Install [setuptools](https://pypi.org/project/setuptools/).

```sh
python -m pip install --upgrade pip setuptools
```

- Install [Yarn Classic](https://classic.yarnpkg.com/en/docs/install/#mac-stable)

```sh
Expand Down Expand Up @@ -128,18 +120,6 @@ python -m pip install --upgrade pip setuptools

You can get the current `<version>` from the [`.nvmrc`](.nvmrc).

- Install [Python](https://www.python.org/downloads/)

We recommend using [asdf](https://asdf-vm.com/).

You can get the current `<version>` from the [`.tool-versions`](.tool-versions).

- Install [setuptools](https://pypi.org/project/setuptools/).

```sh
python -m pip install --upgrade pip setuptools
```

- Install [Yarn Classic](https://classic.yarnpkg.com/en/docs/install/#mac-stable)

```sh
Expand All @@ -157,7 +137,6 @@ The following instructions will install the following:
- [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
- [Visual Studio C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
- [Node.js](https://nodejs.org/en/download/)
- [Python](https://www.python.org/downloads/)

Setup instructions for Windows using Chocolatey:

Expand Down Expand Up @@ -230,23 +209,6 @@ Setup instructions for Windows using Chocolatey:
choco install nodejs --version <version>
```

- Install [Python](https://www.python.org/downloads/)

You can get the current `<version>` from the [`.tool-versions`](.tool-versions).

```sh
choco install python --version <version>
```

> [!WARNING]
> You may need to restart PowerShell for python to be recognized.

- Install [setuptools](https://pypi.org/project/setuptools/)

```sh
python -m pip install --upgrade pip setuptools
```

- Install [Yarn Classic](https://classic.yarnpkg.com/en/docs/install/#windows-stable)

```sh
Expand Down Expand Up @@ -288,13 +250,6 @@ yarn start-prod --no-sandbox # Start Session!

</details>

<details>
<summary><em>Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.</em></summary>

We use the `python3` command for many of our scripts. If you have installed Python using [Chocolatey](https://chocolatey.org/), you will need to create an alias for `python3` that points to `python`. Alternatively, you can update the scripts to use `python` instead of `python3`.

</details>

<details>
<summary><em>...(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))...</em></summary>

Expand Down Expand Up @@ -398,14 +353,13 @@ So you wanna make a pull request? Please observe the following guidelines.

- First, make sure that your `yarn ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
- Never use plain strings right in the source code - pull them from `messages.json`!
You **only** need to modify the default locale
[`_locales/en/messages.json`](_locales/en/messages.json).
Other locales are generated automatically based on that file and then periodically
uploaded to Crowdin for translation. If you add or change strings in messages.json
you will need to run `yarn buid:locales-soft` this command generates updated TypeScript type definitions to ensure you aren't using a localization key which doesn't exist.
- Never use plain strings right in the source code - all of the user facing strings
are managed via our Localization Platform. See [Strings & Localization](#strings-localization).
You **must not** modify and commit changes to any files in [`ts/localization/generated/`](ts/localization/generated/)
as they are generated. If your changes require new strings, they can be
requested as part of the PR.
- Please do not submit pull requests for pure translation fixes. Anyone can update
the translations at [Crowdin](https://getsession.org/translate).
the translations via our [Localization Platform](https://getsession.org/translate).
- [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your
changes on the latest `dev` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.
Expand Down
Loading
Loading