Skip to content

Commit

Permalink
Merge pull request #3202 from oxen-io/standardised_strings_qa_2
Browse files Browse the repository at this point in the history
Standardised strings qa
  • Loading branch information
Bilb authored Sep 24, 2024
2 parents 66c2e09 + 5d0df6d commit 049c03d
Show file tree
Hide file tree
Showing 358 changed files with 70,068 additions and 32,283 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ stylesheets/dist/
compiled.d.ts
.eslintrc.js
playwright.config.js

ts/localization/locales.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ stylesheets/dist/

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

.yarn/**/*.mjs
.yarn/**/*.cjs
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
18.15.0
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ release/**
.nyc_output/
coverage/
stylesheets/dist/**

ts/localization/locales.ts

# _locales files are generated by crowdin now.
_locales/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,24 @@ Setup instructions for Windows using Chocolatey:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```


### Linux

1. Install build tools `apt install build-essential cmake` (this installs make, g++, gcc)
2. Depending on your distro, you might need to install `hunspell` and `hunspell-<lan>` (e.g. `hunspell-en-au`)

In Ubuntu, you may also need to install

```
sudo apt install cmake
npm install cmake-js
```
In Fedora, you may also need to install
```
sudo dnf install make automake gcc gcc-c++ kernel-devel
```
### All platforms
Now, run these commands in your preferred terminal in a good directory for development:
Expand Down Expand Up @@ -237,7 +237,7 @@ So you wanna make a pull request? Please observe the following guidelines.
this script generates updated TypeScript type definitions to ensure you aren't
using a localisation key which doesn't exist.
- Please do not submit pull requests for pure translation fixes. Anyone can update
the translations at [Crowdin](https://crowdin.com/project/session-desktop).
the translations at [Crowdin](https://getsession.org/translate).
- [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your
changes on the latest `clearnet` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.
Expand Down
796 changes: 796 additions & 0 deletions _locales/af/messages.json

Large diffs are not rendered by default.

1,287 changes: 782 additions & 505 deletions _locales/ar/messages.json

Large diffs are not rendered by default.

789 changes: 789 additions & 0 deletions _locales/az/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/bal/messages.json

Large diffs are not rendered by default.

1,295 changes: 788 additions & 507 deletions _locales/be/messages.json

Large diffs are not rendered by default.

1,296 changes: 789 additions & 507 deletions _locales/bg/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/bn/messages.json

Large diffs are not rendered by default.

1,290 changes: 786 additions & 504 deletions _locales/ca/messages.json

Large diffs are not rendered by default.

1,291 changes: 787 additions & 504 deletions _locales/cs/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/cy/messages.json

Large diffs are not rendered by default.

1,288 changes: 785 additions & 503 deletions _locales/da/messages.json

Large diffs are not rendered by default.

1,287 changes: 785 additions & 502 deletions _locales/de/messages.json

Large diffs are not rendered by default.

1,284 changes: 783 additions & 501 deletions _locales/el/messages.json

Large diffs are not rendered by default.

1,230 changes: 709 additions & 521 deletions _locales/en/messages.json

Large diffs are not rendered by default.

1,286 changes: 784 additions & 502 deletions _locales/eo/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/es-419/messages.json

Large diffs are not rendered by default.

1,287 changes: 785 additions & 502 deletions _locales/es/messages.json

Large diffs are not rendered by default.

514 changes: 0 additions & 514 deletions _locales/es_419/messages.json

This file was deleted.

1,300 changes: 791 additions & 509 deletions _locales/et/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/eu/messages.json

Large diffs are not rendered by default.

1,293 changes: 786 additions & 507 deletions _locales/fa/messages.json

Large diffs are not rendered by default.

1,287 changes: 785 additions & 502 deletions _locales/fi/messages.json

Large diffs are not rendered by default.

1,284 changes: 783 additions & 501 deletions _locales/fil/messages.json

Large diffs are not rendered by default.

1,289 changes: 786 additions & 503 deletions _locales/fr/messages.json

Large diffs are not rendered by default.

716 changes: 716 additions & 0 deletions _locales/gl/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/ha/messages.json

Large diffs are not rendered by default.

1,294 changes: 788 additions & 506 deletions _locales/he/messages.json

Large diffs are not rendered by default.

1,293 changes: 788 additions & 505 deletions _locales/hi/messages.json

Large diffs are not rendered by default.

1,300 changes: 791 additions & 509 deletions _locales/hr/messages.json

Large diffs are not rendered by default.

1,291 changes: 787 additions & 504 deletions _locales/hu/messages.json

Large diffs are not rendered by default.

1,288 changes: 785 additions & 503 deletions _locales/hy-AM/messages.json

Large diffs are not rendered by default.

1,284 changes: 783 additions & 501 deletions _locales/id/messages.json

Large diffs are not rendered by default.

1,288 changes: 784 additions & 504 deletions _locales/it/messages.json

Large diffs are not rendered by default.

1,281 changes: 779 additions & 502 deletions _locales/ja/messages.json

Large diffs are not rendered by default.

1,297 changes: 789 additions & 508 deletions _locales/ka/messages.json

Large diffs are not rendered by default.

1,285 changes: 783 additions & 502 deletions _locales/km/messages.json

Large diffs are not rendered by default.

1,298 changes: 790 additions & 508 deletions _locales/kmr/messages.json

Large diffs are not rendered by default.

1,301 changes: 791 additions & 510 deletions _locales/kn/messages.json

Large diffs are not rendered by default.

1,291 changes: 787 additions & 504 deletions _locales/ko/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/ku/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/lg/messages.json

Large diffs are not rendered by default.

264 changes: 264 additions & 0 deletions _locales/lo/messages.json

Large diffs are not rendered by default.

1,292 changes: 787 additions & 505 deletions _locales/lt/messages.json

Large diffs are not rendered by default.

1,250 changes: 738 additions & 512 deletions _locales/lv/messages.json

Large diffs are not rendered by default.

1,302 changes: 792 additions & 510 deletions _locales/mk/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/mn/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/ms/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/my/messages.json

Large diffs are not rendered by default.

1,288 changes: 785 additions & 503 deletions _locales/nb/messages.json

Large diffs are not rendered by default.

794 changes: 794 additions & 0 deletions _locales/ne/messages.json

Large diffs are not rendered by default.

1,289 changes: 786 additions & 503 deletions _locales/nl/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/nn/messages.json

Large diffs are not rendered by default.

1,288 changes: 785 additions & 503 deletions _locales/no/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/ny/messages.json

Large diffs are not rendered by default.

1,306 changes: 793 additions & 513 deletions _locales/pa/messages.json

Large diffs are not rendered by default.

1,290 changes: 786 additions & 504 deletions _locales/pl/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/ps/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/pt-BR/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/pt-PT/messages.json

Large diffs are not rendered by default.

514 changes: 0 additions & 514 deletions _locales/pt_BR/messages.json

This file was deleted.

514 changes: 0 additions & 514 deletions _locales/pt_PT/messages.json

This file was deleted.

1,289 changes: 786 additions & 503 deletions _locales/ro/messages.json

Large diffs are not rendered by default.

1,289 changes: 786 additions & 503 deletions _locales/ru/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/sh/messages.json

Large diffs are not rendered by default.

1,290 changes: 786 additions & 504 deletions _locales/si/messages.json

Large diffs are not rendered by default.

1,284 changes: 783 additions & 501 deletions _locales/sk/messages.json

Large diffs are not rendered by default.

1,292 changes: 787 additions & 505 deletions _locales/sl/messages.json

Large diffs are not rendered by default.

1,298 changes: 790 additions & 508 deletions _locales/sq/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/sr-CS/messages.json

Large diffs are not rendered by default.

796 changes: 796 additions & 0 deletions _locales/sr-SP/messages.json

Large diffs are not rendered by default.

514 changes: 0 additions & 514 deletions _locales/sr/messages.json

This file was deleted.

1,285 changes: 784 additions & 501 deletions _locales/sv/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/sw/messages.json

Large diffs are not rendered by default.

1,294 changes: 788 additions & 506 deletions _locales/ta/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/te/messages.json

Large diffs are not rendered by default.

1,297 changes: 790 additions & 507 deletions _locales/th/messages.json

Large diffs are not rendered by default.

1,292 changes: 787 additions & 505 deletions _locales/tl/messages.json

Large diffs are not rendered by default.

1,287 changes: 785 additions & 502 deletions _locales/tr/messages.json

Large diffs are not rendered by default.

1,289 changes: 786 additions & 503 deletions _locales/uk/messages.json

Large diffs are not rendered by default.

793 changes: 793 additions & 0 deletions _locales/ur/messages.json

Large diffs are not rendered by default.

1,295 changes: 789 additions & 506 deletions _locales/uz/messages.json

Large diffs are not rendered by default.

1,291 changes: 787 additions & 504 deletions _locales/vi/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/xh/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/zh-CN/messages.json

Large diffs are not rendered by default.

797 changes: 797 additions & 0 deletions _locales/zh-TW/messages.json

Large diffs are not rendered by default.

514 changes: 0 additions & 514 deletions _locales/zh_CN/messages.json

This file was deleted.

514 changes: 0 additions & 514 deletions _locales/zh_TW/messages.json

This file was deleted.

10 changes: 6 additions & 4 deletions about_preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
const { ipcRenderer } = require('electron');
const url = require('url');
const os = require('os');
const i18n = require('./ts/util/i18n');
const { setupI18n } = require('./ts/util/i18n/i18n');

const config = url.parse(window.location.toString(), true).query;
const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data');
const { dictionary, crowdinLocale } = ipcRenderer.sendSync('locale-data');

window.theme = config.theme;
window.i18n = i18n.setupi18n(locale, localeMessages);
window.i18n = setupI18n({
crowdinLocale,
translationDictionary: dictionary,
});

window.getOSRelease = () =>
`${os.type()} ${os.release()}, Node.js ${config.node_version} ${os.platform()} ${os.arch()}`;
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.13.2",
"version": "1.14.0",
"license": "GPL-3.0",
"author": {
"name": "Oxen Labs",
Expand All @@ -18,7 +18,6 @@
"getobject": "^1.0.0",
"ansi-regex": "^4.1.1",
"async": "^2.6.4",
"moment": "^2.29.4",
"lodash": "^4.17.20",
"ini": "^1.3.6",
"ejs": "^3.1.7",
Expand All @@ -37,10 +36,13 @@
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
"start-prod:pretty": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron . | npx bunyan",
"start-dev": "cross-env NODE_ENV=development NODE_APP_INSTANCE=devprod$MULTI electron .",
"build-everything": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything:soft": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && tsc && yarn build:workers",
"build-everything:watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && yarn build:workers && yarn tsc -w",
"start-dev:pretty": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron . | npx bunyan",
"build-everything": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && tsc && yarn build:workers",
"build-everything:watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:workers && tsc -w",
"build:workers": "yarn worker:utils && yarn worker:libsession",
"build:locales": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --error-on-problems --error-old-dynamic-variables",
"build:locales-soft": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --print-problem-strings",
"watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn build-everything:watch",
"protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"sass": "rimraf 'stylesheets/dist/' && webpack --config=./sass.config.js",
Expand All @@ -57,7 +59,7 @@
"update-git-info": "node ./build/updateLocalConfig.js",
"worker:utils": "webpack --config=./utils.worker.config.js",
"worker:libsession": "rimraf 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js",
"dedup-yarn-lock": "yarn-deduplicate yarn.lock",
"dedup-yarn-lock": "npx --yes yarn-deduplicate yarn.lock",
"prepare": "husky install"
},
"dependencies": {
Expand All @@ -78,7 +80,7 @@
"classnames": "2.2.5",
"config": "1.28.1",
"curve25519-js": "https://github.com/oxen-io/curve25519-js",
"date-fns": "^3.3.1",
"date-fns": "^3.6.0",
"dompurify": "^2.0.7",
"electron-localshortcut": "^3.2.1",
"electron-updater": "^4.2.2",
Expand All @@ -89,14 +91,13 @@
"fs-extra": "9.0.0",
"glob": "7.1.2",
"image-type": "^4.1.0",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.22/libsession_util_nodejs-v0.3.22.tar.gz",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.23/libsession_util_nodejs-v0.3.23.tar.gz",
"libsodium-wrappers-sumo": "^0.7.9",
"linkify-it": "^4.0.1",
"lodash": "^4.17.21",
"long": "^4.0.0",
"maxmind": "^4.3.18",
"mic-recorder-to-mp3": "^2.2.2",
"moment": "^2.29.4",
"node-fetch": "^2.6.7",
"os-locale": "5.0.0",
"p-retry": "^4.2.0",
Expand Down Expand Up @@ -201,10 +202,9 @@
"sass-loader": "^13.2.2",
"sinon": "9.0.2",
"ts-loader": "^9.4.2",
"typescript": "^5.1.6",
"typescript": "^5.5.4",
"webpack": "^5.76.3",
"webpack-cli": "^5.1.4",
"yarn-deduplicate": "^6.0.2"
"webpack-cli": "^5.1.4"
},
"engines": {
"node": "18.15.0"
Expand Down
11 changes: 7 additions & 4 deletions password_preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@

const { ipcRenderer } = require('electron');
const url = require('url');
const i18n = require('./ts/util/i18n');
const { setupI18n } = require('./ts/util/i18n/i18n');

const config = url.parse(window.location.toString(), true).query;
const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data');
const { dictionary, crowdinLocale } = ipcRenderer.sendSync('locale-data');

// If the app is locked we can't access the database to check the theme.
window.theme = 'classic-dark';
window.primaryColor = 'green';
window.i18n = i18n.setupi18n(locale, localeMessages);

window.i18n = setupI18n({
crowdinLocale,
translationDictionary: dictionary,
});

window.getEnvironment = () => config.environment;
window.getVersion = () => config.version;
Expand Down
22 changes: 11 additions & 11 deletions preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint:disable: no-require-imports no-var-requires
const { clipboard, ipcRenderer, webFrame } = require('electron/main');
const { clipboard, ipcRenderer: ipc, webFrame } = require('electron/main');
const { Storage } = require('./ts/util/storage');

const { isTestNet, isTestIntegration } = require('./ts/shared/env_vars');
Expand All @@ -9,9 +9,15 @@ const url = require('url');

const _ = require('lodash');

const { setupI18n } = require('./ts/util/i18n/i18n');

const { dictionary, crowdinLocale } = ipc.sendSync('locale-data');

const config = url.parse(window.location.toString(), true).query;
const configAny = config;

window.i18n = setupI18n({ crowdinLocale, translationDictionary: dictionary });

let title = config.name;
if (config.environment !== 'production') {
title += ` - ${config.environment}`;
Expand All @@ -29,12 +35,13 @@ window.getCommitHash = () => configAny.commitHash;
window.getNodeVersion = () => configAny.node_version;
window.getOSRelease = () =>
`${os.type()} ${os.release()}, Node.js ${config.node_version} ${os.platform()} ${os.arch()}`;
window.saveLog = additionalText => ipcRenderer.send('save-debug-log', additionalText);
window.saveLog = additionalText => ipc.send('save-debug-log', additionalText);

window.sessionFeatureFlags = {
useOnionRequests: true,
useTestNet: isTestNet() || isTestIntegration(),
useClosedGroupV3: false,
replaceLocalizedStringsWithKeys: false,
debug: {
debugLogging: !_.isEmpty(process.env.SESSION_DEBUG),
debugLibsessionDumps: !_.isEmpty(process.env.SESSION_DEBUG_LIBSESSION_DUMPS),
Expand All @@ -51,9 +58,6 @@ window.versionInfo = {
appInstance: window.getAppInstance(),
};

const ipc = ipcRenderer;
const localeMessages = ipc.sendSync('locale-data');

window.updateZoomFactor = () => {
const zoomFactor = window.getSettingValue('zoom-factor-setting') || 100;
window.setZoomFactor(zoomFactor / 100);
Expand Down Expand Up @@ -82,13 +86,13 @@ window.setPassword = async (passPhrase, oldPhrase) =>
// called to verify that the password is correct when showing the recovery from seed modal
window.onTryPassword = async passPhrase =>
new Promise((resolve, reject) => {
ipcRenderer.once('password-recovery-phrase-response', (_event, error) => {
ipc.once('password-recovery-phrase-response', (_event, error) => {
if (error) {
return reject(error);
}
return resolve();
});
ipcRenderer.send('password-recovery-phrase', passPhrase);
ipc.send('password-recovery-phrase', passPhrase);
});

window.setStartInTray = async startInTray =>
Expand Down Expand Up @@ -250,7 +254,6 @@ if (config.proxyUrl) {
window.nodeSetImmediate = setImmediate;

const data = require('./ts/data/dataInit');
const { setupi18n } = require('./ts/util/i18n');
window.Signal = data.initData();

const { getConversationController } = require('./ts/session/conversations/ConversationController');
Expand All @@ -272,9 +275,6 @@ window.getSeedNodeList = () =>
'https://seed3.getsession.org:4443/',
];

const { locale: localFromEnv } = config;
window.i18n = setupi18n(localFromEnv || 'en', localeMessages);

window.addEventListener('contextmenu', e => {
const editable = e && e.target.closest('textarea, input, [contenteditable="true"]');
const link = e && e.target.closest('a');
Expand Down
4 changes: 4 additions & 0 deletions stylesheets/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@
font-weight: 300;
}

.module-conversation-list-item__header__date {
flex-shrink: 0;
}

.module-conversation-list-item__header__name--with-unread {
font-weight: 300;
}
Expand Down
1 change: 1 addition & 0 deletions stylesheets/_session_left_pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ $session-compose-margin: 20px;
&__header__date--has-unread {
flex-grow: 1 !important;
text-align: end !important;
padding-inline-start: var(--margins-xs);
}

&__message__text {
Expand Down
4 changes: 4 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__
/localization/analysis
/localization/output
/localization/input
Loading

0 comments on commit 049c03d

Please sign in to comment.