Skip to content

Commit bf6a347

Browse files
committed
Merge branch 'develop' of github.com:vector-im/riot-web into set_default_federate_by_settings
2 parents befc9b7 + 3d7b1cb commit bf6a347

87 files changed

Lines changed: 2610 additions & 790 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,111 @@
1+
Changes in [0.12.6](https://github.com/vector-im/riot-web/releases/tag/v0.12.6) (2017-09-21)
2+
============================================================================================
3+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.5...v0.12.6)
4+
5+
* Use matrix-js-sdk v0.8.4 to fix build
6+
7+
Changes in [0.12.5](https://github.com/vector-im/riot-web/releases/tag/v0.12.5) (2017-09-21)
8+
============================================================================================
9+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.4...v0.12.5)
10+
11+
* Use react-sdk v0.10.5 to fix build
12+
13+
Changes in [0.12.4](https://github.com/vector-im/riot-web/releases/tag/v0.12.4) (2017-09-20)
14+
============================================================================================
15+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.4-rc.1...v0.12.4)
16+
17+
* No changes
18+
19+
Changes in [0.12.4-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.12.4-rc.1) (2017-09-19)
20+
======================================================================================================
21+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.3...v0.12.4-rc.1)
22+
23+
* Fix test for new behaviour of 'joining' flag
24+
[\#5053](https://github.com/vector-im/riot-web/pull/5053)
25+
* fix really dumb blunder/typo preventing system from going to sleep.
26+
[\#5080](https://github.com/vector-im/riot-web/pull/5080)
27+
* T3chguy/devtools
28+
[\#4735](https://github.com/vector-im/riot-web/pull/4735)
29+
* CSS for unignore button in UserSettings
30+
[\#5042](https://github.com/vector-im/riot-web/pull/5042)
31+
* Fix alias on home page for identity room
32+
[\#5044](https://github.com/vector-im/riot-web/pull/5044)
33+
* generic contextual menu for tooltip/responses
34+
[\#4989](https://github.com/vector-im/riot-web/pull/4989)
35+
* Update from Weblate.
36+
[\#5018](https://github.com/vector-im/riot-web/pull/5018)
37+
* Avoid re-rendering RoomList on room switch
38+
[\#5015](https://github.com/vector-im/riot-web/pull/5015)
39+
* Fix menu on change keyboard language issue #4345
40+
[\#4623](https://github.com/vector-im/riot-web/pull/4623)
41+
* Make isInvite default to false
42+
[\#4999](https://github.com/vector-im/riot-web/pull/4999)
43+
* Revert "Implement sticky date separators"
44+
[\#4991](https://github.com/vector-im/riot-web/pull/4991)
45+
* Implement sticky date separators
46+
[\#4939](https://github.com/vector-im/riot-web/pull/4939)
47+
48+
Changes in [0.12.3](https://github.com/vector-im/riot-web/releases/tag/v0.12.3) (2017-09-06)
49+
============================================================================================
50+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.3-rc.3...v0.12.3)
51+
52+
* No changes
53+
54+
Changes in [0.12.3-rc.3](https://github.com/vector-im/riot-web/releases/tag/v0.12.3-rc.3) (2017-09-05)
55+
======================================================================================================
56+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.3-rc.2...v0.12.3-rc.3)
57+
58+
* Fix plurals in translations
59+
[\#4971](https://github.com/vector-im/riot-web/pull/4971)
60+
* Update from Weblate.
61+
[\#4968](https://github.com/vector-im/riot-web/pull/4968)
62+
63+
Changes in [0.12.3-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.12.3-rc.2) (2017-09-05)
64+
======================================================================================================
65+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.3-rc.1...v0.12.3-rc.2)
66+
67+
* New react-sdk version to pull in new translations and fix some translation bugs.
68+
69+
70+
Changes in [0.12.3-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.12.3-rc.1) (2017-09-01)
71+
======================================================================================================
72+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.2...v0.12.3-rc.1)
73+
74+
* Fix overflowing login/register buttons on some languages issue #4804
75+
[\#4858](https://github.com/vector-im/riot-web/pull/4858)
76+
* Update vector-im to riot-im on Login
77+
[\#4943](https://github.com/vector-im/riot-web/pull/4943)
78+
* lets let people know that the bug report actually sent properly :)
79+
[\#4910](https://github.com/vector-im/riot-web/pull/4910)
80+
* another s/vector/riot/ in README
81+
[\#4934](https://github.com/vector-im/riot-web/pull/4934)
82+
* fix two room list regressions
83+
[\#4907](https://github.com/vector-im/riot-web/pull/4907)
84+
85+
Changes in [0.12.2](https://github.com/vector-im/riot-web/releases/tag/v0.12.2) (2017-08-24)
86+
============================================================================================
87+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.1...v0.12.2)
88+
89+
* Update react-sdk and js-sdk to fix bugs with incoming calls, messages and notifications
90+
in encrypted rooms.
91+
92+
Changes in [0.12.1](https://github.com/vector-im/riot-web/releases/tag/v0.12.1) (2017-08-23)
93+
============================================================================================
94+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.1-rc.1...v0.12.1)
95+
96+
* [No changes]
97+
98+
Changes in [0.12.1-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.12.1-rc.1) (2017-08-22)
99+
======================================================================================================
100+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.12.0-rc.2...v0.12.1-rc.1)
101+
102+
* Update from Weblate.
103+
[\#4832](https://github.com/vector-im/riot-web/pull/4832)
104+
* Misc styling fixes.
105+
[\#4826](https://github.com/vector-im/riot-web/pull/4826)
106+
* Show / Hide apps icons
107+
[\#4774](https://github.com/vector-im/riot-web/pull/4774)
108+
1109
Changes in [0.12.0-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.12.0-rc.1) (2017-08-16)
2110
======================================================================================================
3111
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.11.4...v0.12.0-rc.1)

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ released version of Riot:
1616

1717
1. Download the latest version from https://github.com/vector-im/riot-web/releases
1818
1. Untar the tarball on your web server
19-
1. Move (or symlink) the vector-x.x.x directory to an appropriate name
19+
1. Move (or symlink) the riot-x.x.x directory to an appropriate name
2020
1. If desired, copy `config.sample.json` to `config.json` and edit it
2121
as desired. See below for details.
2222
1. Enter the URL into your browser and log into Riot!

‎docs/translating-dev.md‎

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,30 @@
66
- Be able to understand English
77
- Be able to understand the language you want to translate riot-web into
88

9+
## Translating strings vs. marking strings for translation
10+
11+
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).
12+
13+
Basically, whenever a translatable string is introduced, you should call either `_t()` immediately OR `_td()` and later `_t()`.
14+
15+
Example:
16+
```
17+
// Module-level constant
18+
const COLORS = {
19+
'#f8481c': _td('reddish orange'), // Can't call _t() here yet
20+
'#fc2647': _td('pinky red') // Use _td() instead so the text is picked up for translation anyway
21+
}
22+
23+
// Function that is called some time after i18n has been loaded
24+
function getColorName(hex) {
25+
return _t(COLORS[hex]); // Perform actual translation here
26+
}
27+
```
28+
929
## Adding new strings
1030

11-
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements.
12-
2. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method)
31+
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
32+
2. 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.
1333
3. Add the String to the ``en_EN.json`` file in ``src/i18n/strings`` (respect which repository you are on).
1434

1535
## Adding variables inside a string.
@@ -21,6 +41,8 @@
2141

2242
## Things to know/Style Guides
2343

24-
- Do not use it inside ``getDefaultProps`` at the point where ``getDefaultProps`` is initialized the translations aren't loaded yet and it causes missing translations.
25-
- 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.
44+
- 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.
45+
- 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.
2646
- 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.
47+
- 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.
48+
- 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.

‎electron_app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "riot-web",
33
"productName": "Riot",
44
"main": "src/electron-main.js",
5-
"version": "0.12.0-rc.1",
5+
"version": "0.12.6",
66
"description": "A feature-rich client for Matrix.org",
77
"author": "Vector Creations Ltd.",
88
"dependencies": {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIF0jCCBLqgAwIBAgIRAISYBqZi3VvCUeSfHXF+cbwwDQYJKoZIhvcNAQELBQAw
3+
gZExCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
4+
BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTcwNQYD
5+
VQQDEy5DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gQ29kZSBTaWduaW5n
6+
IENBMB4XDTE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vQ1BTMFUGA1Ud
22+
HwROMEwwSqBIoEaGRGh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUV4
23+
dGVuZGVkVmFsaWRhdGlvbkNvZGVTaWduaW5nQ0EuY3JsMIGGBggrBgEFBQcBAQR6
24+
MHgwUAYIKwYBBQUHMAKGRGh0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JT
25+
QUV4dGVuZGVkVmFsaWRhdGlvbkNvZGVTaWduaW5nQ0EuY3J0MCQGCCsGAQUFBzAB
26+
hhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wJgYDVR0RBB8wHaAbBggrBgEFBQcI
27+
A6APMA0MC0dCLTEwODczNjYxMA0GCSqGSIb3DQEBCwUAA4IBAQBJ2aH4aixh0aiz
28+
4WKlK+LMVLHpQ2POE3FZYNpAW7o1q2YDGEADXdGrygPE9NCGNBXKo0CAemCYNWfX
29+
Ov/jdoiMfeqW3vrZ66oEy8OqbvJSwK1xmomWuYw3wYPWcPVG+YbWYD2CGdQu8jTz
30+
fzAJCpvAuY3Wji3fQjiecAC7JCSB4fBHa0ALJOmiSqKQUUpkXs5kW7O0lPBnHzNF
31+
2tQGltXMSIrq1QfFtcreMyKlwDOxPIh360dv5aHhaeSRDRKxq7uq5ikQF2gjKx4k
32+
ieg2HRbAW6fVPpFr4zRS5umpeZV3i06i11VQQPS/mA/OBEXyaqzx4mr6B7U6ptrp
33+
jMqiUv2w
34+
-----END CERTIFICATE-----

‎electron_app/src/electron-main.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ let powerSaveBlockerId;
8484
electron.ipcMain.on('app_onAction', function(ev, payload) {
8585
switch (payload.action) {
8686
case 'call_state':
87-
if (powerSaveBlockerId && powerSaveBlockerId.isStarted(powerSaveBlockerId)) {
87+
if (powerSaveBlockerId && electron.powerSaveBlocker.isStarted(powerSaveBlockerId)) {
8888
if (payload.state === 'ended') {
8989
electron.powerSaveBlocker.stop(powerSaveBlockerId);
9090
}

‎electron_app/src/vectormenu.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {app, shell, Menu} = require('electron');
1919
// Menu template from http://electron.atom.io/docs/api/menu/, edited
2020
const template = [
2121
{
22-
label: 'Edit',
22+
label: '&Edit',
2323
submenu: [
2424
{ role: 'undo' },
2525
{ role: 'redo' },
@@ -33,7 +33,7 @@ const template = [
3333
],
3434
},
3535
{
36-
label: 'View',
36+
label: '&View',
3737
submenu: [
3838
{ type: 'separator' },
3939
{ role: 'resetzoom' },
@@ -45,13 +45,15 @@ const template = [
4545
],
4646
},
4747
{
48+
label: '&Window',
4849
role: 'window',
4950
submenu: [
5051
{ role: 'minimize' },
5152
{ role: 'close' },
5253
],
5354
},
5455
{
56+
label: '&Help',
5557
role: 'help',
5658
submenu: [
5759
{
@@ -122,7 +124,7 @@ if (process.platform === 'darwin') {
122124
];
123125
} else {
124126
template.unshift({
125-
label: 'File',
127+
label: '&File',
126128
submenu: [
127129
// For some reason, 'about' does not seem to work on windows.
128130
/*{

‎package.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "riot-web",
33
"productName": "Riot",
44
"main": "electron_app/src/electron-main.js",
5-
"version": "0.12.0-rc.1",
5+
"version": "0.12.6",
66
"description": "A feature-rich client for Matrix.org",
77
"author": "Vector Creations Ltd.",
88
"repository": {
@@ -47,7 +47,7 @@
4747
"lint": "eslint src/",
4848
"lintall": "eslint src/ test/",
4949
"clean": "rimraf lib webapp electron_app/dist",
50-
"prepublish": "npm run build:compile",
50+
"prepublish": "npm run clean && npm run build:compile",
5151
"test": "karma start --single-run=true --autoWatch=false --browsers ChromeHeadless",
5252
"test-multi": "karma start"
5353
},
@@ -66,10 +66,11 @@
6666
"gfm.css": "^1.1.1",
6767
"highlight.js": "^9.0.0",
6868
"linkifyjs": "^2.1.3",
69-
"matrix-js-sdk": "0.8.0",
70-
"matrix-react-sdk": "0.10.0-rc.1",
69+
"matrix-js-sdk": "0.8.4",
70+
"matrix-react-sdk": "0.10.6",
7171
"modernizr": "^3.1.0",
7272
"pako": "^1.0.5",
73+
"prop-types": "^15.5.10",
7374
"react": "^15.6.0",
7475
"react-dnd": "^2.1.4",
7576
"react-dnd-html5-backend": "^2.1.2",
@@ -151,7 +152,7 @@
151152
"build": {
152153
"appId": "im.riot.app",
153154
"category": "Network",
154-
"electronVersion": "1.6.8",
155+
"electronVersion": "1.7.5",
155156
"//asar=false": "https://github.com/electron-userland/electron-builder/issues/675",
156157
"asar": false,
157158
"dereference": true,

‎res/home.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ <h4>_t("Building services on Matrix")</h4>
249249
<span class="mx_HomePage_desc">_t("Implementing VoIP services with Matrix")</span>
250250
</div>
251251
<div class="mx_HomePage_room">
252-
<a href="#/room/#identity:matrix.org">
252+
<a href="#/room/#matrix-identity:matrix.org">
253253
<img class="mx_HomePage_icon" src="home/rooms/identity.jpg">
254254
<span class="mx_HomePage_name">Matrix Identity</span>
255255
</a>

‎scripts/copy-res.js‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const INCLUDE_LANGS = [
1717
{'value': 'eo', 'label': 'Esperanto'},
1818
{'value': 'es', 'label': 'Español'},
1919
{'value': 'eu', 'label': 'Euskal'},
20+
{'value': 'fi', 'label': 'Suomi'},
2021
{'value': 'fr', 'label': 'Français'},
2122
{'value': 'hu', 'label': 'Magyar'},
2223
{'value': 'ko', 'label': '한국어'},
@@ -156,7 +157,7 @@ function genLangFile(lang, dest) {
156157
const reactSdkFile = 'node_modules/matrix-react-sdk/src/i18n/strings/' + lang + '.json';
157158
const riotWebFile = 'src/i18n/strings/' + lang + '.json';
158159

159-
const translations = {};
160+
let translations = {};
160161
[reactSdkFile, riotWebFile].forEach(function(f) {
161162
if (fs.existsSync(f)) {
162163
Object.assign(
@@ -165,6 +166,9 @@ function genLangFile(lang, dest) {
165166
);
166167
}
167168
});
169+
170+
translations = weblateToCounterpart(translations)
171+
168172
fs.writeFileSync(dest + lang + '.json', JSON.stringify(translations, null, 4));
169173
if (verbose) {
170174
console.log("Generated language file: " + lang);
@@ -193,5 +197,39 @@ function genLangList() {
193197
}
194198
}
195199

200+
/**
201+
* Convert translation key from weblate format
202+
* (which only supports a single level) to counterpart
203+
* which requires object values for 'count' translations.
204+
*
205+
* eg.
206+
* "there are %(count)s badgers|one": "a badger",
207+
* "there are %(count)s badgers|other": "%(count)s badgers"
208+
* becomes
209+
* "there are %(count)s badgers": {
210+
* "one": "a badger",
211+
* "other": "%(count)s badgers"
212+
* }
213+
*/
214+
function weblateToCounterpart(inTrs) {
215+
const outTrs = {};
216+
217+
for (const key of Object.keys(inTrs)) {
218+
const keyParts = key.split('|', 2);
219+
if (keyParts.length === 2) {
220+
let obj = outTrs[keyParts[0]];
221+
if (obj === undefined) {
222+
obj = {};
223+
outTrs[keyParts[0]] = obj;
224+
}
225+
obj[keyParts[1]] = inTrs[key];
226+
} else {
227+
outTrs[key] = inTrs[key];
228+
}
229+
}
230+
231+
return outTrs;
232+
}
233+
196234
genLangList();
197235
next(0);

0 commit comments

Comments
 (0)