From e44f3cc7096a8370a3dff464e14c8f9cf26df65e Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 26 May 2017 11:58:45 +0100 Subject: [PATCH] Fix tests * Serve translation files from the karma server * Port UserSettingsStore to ES6 exports because the test runner gets confused by ES6 importing a commonjs module * Remove extra spaces in translations strings for MELS * Fix 'his/her' back to be 'their' * Change test to expect singular 'invitation' for a single person (there may be multiple invitations, but IMO this should be 'rejected n invitations' and we can play with the wording later, I don't think the singular is any worse than the plural). * set language in the MELS tests (and wait for it to complete) * Don't bother setting lang in other tests for now --- karma.conf.js | 9 ++- src/UserSettingsStore.js | 3 +- .../views/elements/MemberEventListSummary.js | 64 +++++++++--------- src/i18n/strings/de_DE.json | 66 +++++++++---------- src/i18n/strings/en_EN.json | 64 +++++++++--------- src/i18n/strings/pt_BR.json | 64 +++++++++--------- .../elements/MemberEventListSummary-test.js | 13 ++-- test/test-utils.js | 6 -- 8 files changed, 146 insertions(+), 143 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 13e88350c1..4ad72b4927 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -55,11 +55,18 @@ module.exports = function (config) { // some images to reduce noise from the tests {pattern: 'test/img/*', watched: false, included: false, served: true, nocache: false}, + // translation files + {pattern: 'src/i18n/strings/*', watcheed: false, included: false, served: true}, + {pattern: 'test/i18n/*', watched: false, included: false, served: true}, ], - // redirect img links to the karma server proxies: { + // redirect img links to the karma server "/img/": "/base/test/img/", + // special languages.json file for the tests + "/i18n/languages.json": "/base/test/i18n/languages.json", + // and redirect i18n requests + "/i18n/": "/base/src/i18n/strings/", }, // list of files to exclude diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index fd5ccb0de3..5b96692dc9 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -'use strict'; import q from 'q'; import MatrixClientPeg from './MatrixClientPeg'; import Notifier from './Notifier'; @@ -27,7 +26,7 @@ import Notifier from './Notifier'; * TODO: Find a way to translate the names of LABS_FEATURES. In other words, guarantee that languages were already loaded before building this array. */ -module.exports = { +export default { LABS_FEATURES: [ { name: "New Composer & Autocomplete", diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index 2999af42d6..fdfd46e9e5 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -215,67 +215,67 @@ module.exports = React.createClass({ case "joined": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s joined %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s joined %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)sjoined %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)sjoined %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s joined", { severalUsers: "" }) - : _t("%(oneUser)s joined", { oneUser: "" }); + ? _t("%(severalUsers)sjoined", { severalUsers: "" }) + : _t("%(oneUser)sjoined", { oneUser: "" }); } break; case "left": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s left %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s left %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)sleft %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)sleft %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s left", { severalUsers: "" }) - : _t("%(oneUser)s left", { oneUser: "" }); + ? _t("%(severalUsers)sleft", { severalUsers: "" }) + : _t("%(oneUser)sleft", { oneUser: "" }); } break; case "joined_and_left": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s joined and left %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s joined and left %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)sjoined and left %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)sjoined and left %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s joined and left", { severalUsers: "" }) - : _t("%(oneUser)s joined and left", { oneUser: "" }); + ? _t("%(severalUsers)sjoined and left", { severalUsers: "" }) + : _t("%(oneUser)sjoined and left", { oneUser: "" }); } break; case "left_and_joined": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s left and rejoined %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s left and rejoined %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)sleft and rejoined %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)sleft and rejoined %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s left and rejoined", { severalUsers: "" }) - : _t("%(oneUser)s left and rejoined", { oneUser: "" }); + ? _t("%(severalUsers)sleft and rejoined", { severalUsers: "" }) + : _t("%(oneUser)sleft and rejoined", { oneUser: "" }); } break; break; case "invite_reject": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s rejected their invitations %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s rejected his/her invitation %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)srejected their invitations %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)srejected their invitation %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s rejected their invitations", { severalUsers: "" }) - : _t("%(oneUser)s rejected his/her invitation", { oneUser: "" }); + ? _t("%(severalUsers)srejected their invitations", { severalUsers: "" }) + : _t("%(oneUser)srejected their invitation", { oneUser: "" }); } break; case "invite_withdrawal": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s had their invitations withdrawn %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s had his/her invitation withdrawn %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)shad their invitations withdrawn %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)shad their invitation withdrawn %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s had their invitations withdrawn", { severalUsers: "" }) - : _t("%(oneUser)s had his/her invitation withdrawn", { oneUser: "" }); + ? _t("%(severalUsers)shad their invitations withdrawn", { severalUsers: "" }) + : _t("%(oneUser)shad their invitation withdrawn", { oneUser: "" }); } break; case "invited": @@ -325,23 +325,23 @@ module.exports = React.createClass({ case "changed_name": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s changed their name %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s changed his/her name %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)schanged their name %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)schanged their name %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s changed their name", { severalUsers: "" }) - : _t("%(oneUser)s changed his/her name", { oneUser: "" }); + ? _t("%(severalUsers)schanged their name", { severalUsers: "" }) + : _t("%(oneUser)schanged their name", { oneUser: "" }); } break; case "changed_avatar": if (repeats > 1) { res = (plural) - ? _t("%(severalUsers)s changed their avatar %(repeats)s times", { severalUsers: "", repeats: repeats }) - : _t("%(oneUser)s changed his/her avatar %(repeats)s times", { oneUser: "", repeats: repeats }); + ? _t("%(severalUsers)schanged their avatar %(repeats)s times", { severalUsers: "", repeats: repeats }) + : _t("%(oneUser)schanged their avatar %(repeats)s times", { oneUser: "", repeats: repeats }); } else { res = (plural) - ? _t("%(severalUsers)s changed their avatar", { severalUsers: "" }) - : _t("%(oneUser)s changed his/her avatar", { oneUser: "" }); + ? _t("%(severalUsers)schanged their avatar", { severalUsers: "" }) + : _t("%(oneUser)schanged their avatar", { oneUser: "" }); } break; } diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index ffe46f5723..c161dd3ed4 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -654,30 +654,30 @@ "%(items)s and %(remaining)s others": "%(items)s und %(remaining)s weitere", "%(items)s and one other": "%(items)s und ein(e) weitere(r)", "%(items)s and %(lastItem)s": "%(items)s und %(lastItem)s", - "%(severalUsers)s joined %(repeats)s times": "%(severalUsers)s trat(en) %(repeats)s mal bei", - "%(oneUser)s joined %(repeats)s times": "%(oneUser)s trat %(repeats)s mal bei", - "%(severalUsers)s joined": "%(severalUsers)s traten bei", - "%(oneUser)s joined": "%(oneUser)s trat bei", - "%(severalUsers)s left %(repeats)s times": "%(severalUsers)s gingen %(repeats)s mal", - "%(oneUser)s left %(repeats)s times": "%(oneUser)s ging %(repeats)s mal", - "%(severalUsers)s left": "%(severalUsers)s gingen", - "%(oneUser)s left": "%(oneUser)s ging", - "%(severalUsers)s joined and left %(repeats)s times": "%(severalUsers)s traten bei und gingen %(repeats)s mal", - "%(oneUser)s joined and left %(repeats)s times": "%(oneUser)s trat bei und ging %(repeats)s mal", - "%(severalUsers)s joined and left": "%(severalUsers)s traten bei und gingen", - "%(oneUser)s joined and left": "%(oneUser)s trat bei und ging", - "%(severalUsers)s left and rejoined %(repeats)s times": "%(severalUsers)s gingen und traten erneut bei - %(repeats)s mal", - "%(oneUser)s left and rejoined %(repeats)s times": "%(oneUser)s ging und trat erneut bei - %(repeats)s mal", - "%(severalUsers)s left and rejoined": "%(severalUsers)s gingen und traten erneut bei", - "%(oneUser)s left left and rejoined": "%(oneUser)s ging und trat erneut bei", - "%(severalUsers)s rejected their invitations %(repeats)s times": "%(severalUsers)s lehnten %(repeats)s mal ihre Einladung ab", - "%(oneUser)s rejected his/her invitation %(repeats)s times": "%(oneUser)s lehnte seine/ihre Einladung %(repeats)s mal ab", - "%(severalUsers)s rejected their invitations": "%(severalUsers)s lehnten ihre Einladung ab", - "%(oneUser)s rejected his/her invitation": "%(oneUser)s lehnte seine/ihre Einladung ab", - "%(severalUsers)s had their invitations withdrawn %(repeats)s times": "%(severalUsers)s zogen ihre Einladungen %(repeats)s mal zurück", - "%(oneUser)s had his/her invitation withdrawn %(repeats)s times": "%(oneUser)s zog seine/ihre Einladung %(repeats)s mal zurück", - "%(severalUsers)s had their invitations withdrawn": "%(severalUsers)s zogen ihre Einladungen zurück", - "%(oneUser)s had his/her invitation withdrawn": "%(oneUser)s zog seine/ihre Einladung zurück", + "%(severalUsers)sjoined %(repeats)s times": "%(severalUsers)strat(en) %(repeats)s mal bei", + "%(oneUser)sjoined %(repeats)s times": "%(oneUser)strat %(repeats)s mal bei", + "%(severalUsers)sjoined": "%(severalUsers)straten bei", + "%(oneUser)sjoined": "%(oneUser)strat bei", + "%(severalUsers)sleft %(repeats)s times": "%(severalUsers)sgingen %(repeats)s mal", + "%(oneUser)sleft %(repeats)s times": "%(oneUser)sging %(repeats)s mal", + "%(severalUsers)sleft": "%(severalUsers)sgingen", + "%(oneUser)sleft": "%(oneUser)sging", + "%(severalUsers)sjoined and left %(repeats)s times": "%(severalUsers)straten bei und gingen %(repeats)s mal", + "%(oneUser)sjoined and left %(repeats)s times": "%(oneUser)strat bei und ging %(repeats)s mal", + "%(severalUsers)sjoined and left": "%(severalUsers)straten bei und gingen", + "%(oneUser)sjoined and left": "%(oneUser)strat bei und ging", + "%(severalUsers)sleft and rejoined %(repeats)s times": "%(severalUsers)sgingen und traten erneut bei - %(repeats)s mal", + "%(oneUser)sleft and rejoined %(repeats)s times": "%(oneUser)sging und trat erneut bei - %(repeats)s mal", + "%(severalUsers)sleft and rejoined": "%(severalUsers)sgingen und traten erneut bei", + "%(oneUser)sleft left and rejoined": "%(oneUser)sging und trat erneut bei", + "%(severalUsers)srejected their invitations %(repeats)s times": "%(severalUsers)slehnten %(repeats)s mal ihre Einladung ab", + "%(oneUser)srejected their invitation %(repeats)s times": "%(oneUser)slehnte seine/ihre Einladung %(repeats)s mal ab", + "%(severalUsers)srejected their invitations": "%(severalUsers)slehnten ihre Einladung ab", + "%(oneUser)srejected their invitation": "%(oneUser)slehnte seine/ihre Einladung ab", + "%(severalUsers)shad their invitations withdrawn %(repeats)s times": "%(severalUsers)szogen ihre Einladungen %(repeats)s mal zurück", + "%(oneUser)shad their invitation withdrawn %(repeats)s times": "%(oneUser)szog seine/ihre Einladung %(repeats)s mal zurück", + "%(severalUsers)shad their invitations withdrawn": "%(severalUsers)szogen ihre Einladungen zurück", + "%(oneUser)shad their invitation withdrawn": "%(oneUser)szog seine/ihre Einladung zurück", "were invited %(repeats)s times": "wurden %(repeats)s mal eingeladen", "was invited %(repeats)s times": "wurde %(repeats)s mal eingeladen", "were invited": "wurden eingeladen", @@ -690,14 +690,14 @@ "were kicked %(repeats)s times": "wurden %(repeats)s mal gekickt", "was kicked %(repeats)s times": "wurde %(repeats)s mal gekickt", "were kicked": "wurden gekickt", - "%(severalUsers)s changed their name %(repeats)s times": "%(severalUsers)s änderten %(repeats)s mal ihre Namen", - "%(oneUser)s changed his/her name %(repeats)s times": "%(oneUser)s änderte %(repeats)s mal seinen/ihren Namen", - "%(severalUsers)s changed their name": "%(severalUsers)s änderten ihre Namen", - "%(oneUser)s changed his/her name": "%(oneUser)s änderte seinen/ihren Namen", - "%(severalUsers)s changed their avatar %(repeats)s times": "%(severalUsers)s änderten %(repeats)s mal ihren Avatar", - "%(oneUser)s changed his/her avatar %(repeats)s times": "%(oneUser)s änderte %(repeats)s mal seinen/ihren Avatar", - "%(severalUsers)s changed their avatar": "%(severalUsers)s änderten ihre Avatare", - "%(oneUser)s changed his/her avatar": "%(severalUsers)s änderte seinen/ihren Avatar", + "%(severalUsers)schanged their name %(repeats)s times": "%(severalUsers)sänderten %(repeats)s mal ihre Namen", + "%(oneUser)schanged their name %(repeats)s times": "%(oneUser)sänderte %(repeats)s mal seinen/ihren Namen", + "%(severalUsers)schanged their name": "%(severalUsers)sänderten ihre Namen", + "%(oneUser)schanged their name": "%(oneUser)sänderte seinen/ihren Namen", + "%(severalUsers)schanged their avatar %(repeats)s times": "%(severalUsers)sänderten %(repeats)s mal ihren Avatar", + "%(oneUser)schanged their avatar %(repeats)s times": "%(oneUser)sänderte %(repeats)s mal seinen/ihren Avatar", + "%(severalUsers)schanged their avatar": "%(severalUsers)sänderten ihre Avatare", + "%(oneUser)schanged their avatar": "%(severalUsers)sänderte seinen/ihren Avatar", "%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s": "%(weekDayName)s, %(day)s. %(monthName)s %(fullYear)s %(time)s", - "%(oneUser)s left and rejoined": "%(oneUser)s ging und trat erneut bei" + "%(oneUser)sleft and rejoined": "%(oneUser)sging und trat erneut bei" } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 9afe796086..2a934d5f2f 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -612,30 +612,30 @@ "quote":"quote", "bullet":"bullet", "numbullet":"numbullet", - "%(severalUsers)s joined %(repeats)s times": "%(severalUsers)s joined %(repeats)s times", - "%(oneUser)s joined %(repeats)s times": "%(oneUser)s joined %(repeats)s times", - "%(severalUsers)s joined": "%(severalUsers)s joined", - "%(oneUser)s joined": "%(oneUser)s joined", - "%(severalUsers)s left %(repeats)s times": "%(severalUsers)s left %(repeats)s times", - "%(oneUser)s left %(repeats)s times": "%(oneUser)s left %(repeats)s times", - "%(severalUsers)s left": "%(severalUsers)s left", - "%(oneUser)s left": "%(oneUser)s left", - "%(severalUsers)s joined and left %(repeats)s times": "%(severalUsers)s joined and left %(repeats)s times", - "%(oneUser)s joined and left %(repeats)s times": "%(oneUser)s joined and left %(repeats)s times", - "%(severalUsers)s joined and left": "%(severalUsers)s joined and left", - "%(oneUser)s joined and left": "%(oneUser)s joined and left", - "%(severalUsers)s left and rejoined %(repeats)s times": "%(severalUsers)s left and rejoined %(repeats)s times", - "%(oneUser)s left and rejoined %(repeats)s times": "%(oneUser)s left and rejoined %(repeats)s times", - "%(severalUsers)s left and rejoined": "%(severalUsers)s left and rejoined", - "%(oneUser)s left and rejoined": "%(oneUser)s left and rejoined", - "%(severalUsers)s rejected their invitations %(repeats)s times": "%(severalUsers)s rejected their invitations %(repeats)s times", - "%(oneUser)s rejected his/her invitation %(repeats)s times": "%(oneUser)s rejected his/her invitation %(repeats)s times", - "%(severalUsers)s rejected their invitations": "%(severalUsers)s rejected their invitations", - "%(oneUser)s rejected his/her invitation": "%(oneUser)s rejected his/her invitation", - "%(severalUsers)s had their invitations withdrawn %(repeats)s times": "%(severalUsers)s had their invitations withdrawn %(repeats)s times", - "%(oneUser)s had his/her invitation withdrawn %(repeats)s times": "%(oneUser)s had his/her invitation withdrawn %(repeats)s times", - "%(severalUsers)s had their invitations withdrawn": "%(severalUsers)s had their invitations withdrawn", - "%(oneUser)s had his/her invitation withdrawn": "%(oneUser)s had his/her invitation withdrawn", + "%(severalUsers)sjoined %(repeats)s times": "%(severalUsers)sjoined %(repeats)s times", + "%(oneUser)sjoined %(repeats)s times": "%(oneUser)sjoined %(repeats)s times", + "%(severalUsers)sjoined": "%(severalUsers)sjoined", + "%(oneUser)sjoined": "%(oneUser)sjoined", + "%(severalUsers)sleft %(repeats)s times": "%(severalUsers)sleft %(repeats)s times", + "%(oneUser)sleft %(repeats)s times": "%(oneUser)sleft %(repeats)s times", + "%(severalUsers)sleft": "%(severalUsers)sleft", + "%(oneUser)sleft": "%(oneUser)sleft", + "%(severalUsers)sjoined and left %(repeats)s times": "%(severalUsers)sjoined and left %(repeats)s times", + "%(oneUser)sjoined and left %(repeats)s times": "%(oneUser)sjoined and left %(repeats)s times", + "%(severalUsers)sjoined and left": "%(severalUsers)sjoined and left", + "%(oneUser)sjoined and left": "%(oneUser)sjoined and left", + "%(severalUsers)sleft and rejoined %(repeats)s times": "%(severalUsers)sleft and rejoined %(repeats)s times", + "%(oneUser)sleft and rejoined %(repeats)s times": "%(oneUser)sleft and rejoined %(repeats)s times", + "%(severalUsers)sleft and rejoined": "%(severalUsers)sleft and rejoined", + "%(oneUser)sleft and rejoined": "%(oneUser)sleft and rejoined", + "%(severalUsers)srejected their invitations %(repeats)s times": "%(severalUsers)srejected their invitations %(repeats)s times", + "%(oneUser)srejected their invitation %(repeats)s times": "%(oneUser)srejected their invitation %(repeats)s times", + "%(severalUsers)srejected their invitations": "%(severalUsers)srejected their invitations", + "%(oneUser)srejected their invitation": "%(oneUser)srejected their invitation", + "%(severalUsers)shad their invitations withdrawn %(repeats)s times": "%(severalUsers)shad their invitations withdrawn %(repeats)s times", + "%(oneUser)shad their invitation withdrawn %(repeats)s times": "%(oneUser)shad their invitation withdrawn %(repeats)s times", + "%(severalUsers)shad their invitations withdrawn": "%(severalUsers)shad their invitations withdrawn", + "%(oneUser)shad their invitation withdrawn": "%(oneUser)shad their invitation withdrawn", "were invited %(repeats)s times": "were invited %(repeats)s times", "was invited %(repeats)s times": "was invited %(repeats)s times", "were invited": "were invited", @@ -652,12 +652,12 @@ "was kicked %(repeats)s times": "was kicked %(repeats)s times", "were kicked": "were kicked", "was kicked": "was kicked", - "%(severalUsers)s changed their name %(repeats)s times": "%(severalUsers)s changed their name %(repeats)s times", - "%(oneUser)s changed his/her name %(repeats)s times": "%(oneUser)s changed his/her name %(repeats)s times", - "%(severalUsers)s changed their name": "%(severalUsers)s changed their name", - "%(oneUser)s changed his/her name": "%(oneUser)s changed his/her name", - "%(severalUsers)s changed their avatar %(repeats)s times": "%(severalUsers)s changed their avatar %(repeats)s times", - "%(oneUser)s changed his/her avatar %(repeats)s times": "%(oneUser)s changed his/her avatar %(repeats)s times", - "%(severalUsers)s changed their avatar": "%(severalUsers)s changed their avatar", - "%(oneUser)s changed his/her avatar": "%(oneUser)s changed his/her avatar" + "%(severalUsers)schanged their name %(repeats)s times": "%(severalUsers)schanged their name %(repeats)s times", + "%(oneUser)schanged their name %(repeats)s times": "%(oneUser)schanged their name %(repeats)s times", + "%(severalUsers)schanged their name": "%(severalUsers)schanged their name", + "%(oneUser)schanged their name": "%(oneUser)schanged their name", + "%(severalUsers)schanged their avatar %(repeats)s times": "%(severalUsers)schanged their avatar %(repeats)s times", + "%(oneUser)schanged their avatar %(repeats)s times": "%(oneUser)schanged their avatar %(repeats)s times", + "%(severalUsers)schanged their avatar": "%(severalUsers)schanged their avatar", + "%(oneUser)schanged their avatar": "%(oneUser)schanged their avatar" } diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 1aebaab694..87570228df 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -536,7 +536,7 @@ "es-mx": "Espanhol (México)", "es-ni": "Espanhol (Nicarágua)", "es-pa": "Espanhol (Panamá)", - "%(oneUser)s changed his/her avatar": "%(oneUser)s alterou sua imagem pública", + "%(oneUser)schanged their avatar": "%(oneUser)salterou sua imagem pública", "es-pe": "Espanhol (Peru)", "es-pr": "Espanhol (Porto Rico)", "es-sv": "Espanhol (El Salvador)", @@ -659,30 +659,30 @@ "quote": "citação", "bullet": "marcador de lista", "numbullet": "marcador de numeração", - "%(severalUsers)s joined %(repeats)s times": "%(severalUsers)s ingressaram %(repeats)s vezes", - "%(oneUser)s joined %(repeats)s times": "%(oneUser)s ingressou %(repeats)s vezes", - "%(severalUsers)s joined": "%(severalUsers)s ingressaram", - "%(oneUser)s joined": "%(oneUser)s ingressou", - "%(severalUsers)s left %(repeats)s times": "%(severalUsers)s saíram %(repeats)s vezes", - "%(oneUser)s left %(repeats)s times": "%(oneUser)s saiu %(repeats)s vezes", - "%(severalUsers)s left": "%(severalUsers)s saíram", - "%(oneUser)s left": "%(oneUser)s saiu", - "%(severalUsers)s joined and left %(repeats)s times": "%(severalUsers)s ingressaram e saíram %(repeats)s vezes", - "%(oneUser)s joined and left %(repeats)s times": "%(oneUser)s ingressou e saiu %(repeats)s vezes", - "%(severalUsers)s joined and left": "%(severalUsers)s ingressaram e saíram", - "%(oneUser)s joined and left": "%(oneUser)s ingressou e saiu", - "%(severalUsers)s left and rejoined %(repeats)s times": "%(severalUsers)s saíram e entraram novamente %(repeats)s vezes", - "%(oneUser)s left and rejoined %(repeats)s times": "%(oneUser)s saiu e entrou novamente %(repeats)s vezes", - "%(severalUsers)s left and rejoined": "%(severalUsers)s saíram e entraram novamente", - "%(oneUser)s left and rejoined": "%(oneUser)s saiu e entrou novamente", - "%(severalUsers)s rejected their invitations %(repeats)s times": "%(severalUsers)s rejeitaram seus convites %(repeats)s vezes", - "%(oneUser)s rejected his/her invitation %(repeats)s times": "%(oneUser)s rejeitou seu convite %(repeats)s vezes", - "%(severalUsers)s rejected their invitations": "%(severalUsers)s rejeitaram seus convites", - "%(oneUser)s rejected his/her invitation": "%(oneUser)s rejeitou seu convite", - "%(severalUsers)s had their invitations withdrawn %(repeats)s times": "%(severalUsers)s tiveram seus convites desfeitos %(repeats)s vezes", - "%(oneUser)s had his/her invitation withdrawn %(repeats)s times": "%(oneUser)s teve seu convite desfeito %(repeats)s vezes", - "%(severalUsers)s had their invitations withdrawn": "%(severalUsers)s tiveram seus convites desfeitos", - "%(oneUser)s had his/her invitation withdrawn": "%(oneUser)s teve seu convite desfeito", + "%(severalUsers)sjoined %(repeats)s times": "%(severalUsers)singressaram %(repeats)s vezes", + "%(oneUser)sjoined %(repeats)s times": "%(oneUser)singressou %(repeats)s vezes", + "%(severalUsers)sjoined": "%(severalUsers)singressaram", + "%(oneUser)sjoined": "%(oneUser)singressou", + "%(severalUsers)sleft %(repeats)s times": "%(severalUsers)ssaíram %(repeats)s vezes", + "%(oneUser)sleft %(repeats)s times": "%(oneUser)ssaiu %(repeats)s vezes", + "%(severalUsers)sleft": "%(severalUsers)ssaíram", + "%(oneUser)sleft": "%(oneUser)ssaiu", + "%(severalUsers)sjoined and left %(repeats)s times": "%(severalUsers)singressaram e saíram %(repeats)s vezes", + "%(oneUser)sjoined and left %(repeats)s times": "%(oneUser)singressou e saiu %(repeats)s vezes", + "%(severalUsers)sjoined and left": "%(severalUsers)singressaram e saíram", + "%(oneUser)sjoined and left": "%(oneUser)singressou e saiu", + "%(severalUsers)sleft and rejoined %(repeats)s times": "%(severalUsers)ssaíram e entraram novamente %(repeats)s vezes", + "%(oneUser)sleft and rejoined %(repeats)s times": "%(oneUser)ssaiu e entrou novamente %(repeats)s vezes", + "%(severalUsers)sleft and rejoined": "%(severalUsers)ssaíram e entraram novamente", + "%(oneUser)sleft and rejoined": "%(oneUser)ssaiu e entrou novamente", + "%(severalUsers)srejected their invitations %(repeats)s times": "%(severalUsers)srejeitaram seus convites %(repeats)s vezes", + "%(oneUser)srejected their invitation %(repeats)s times": "%(oneUser)srejeitou seu convite %(repeats)s vezes", + "%(severalUsers)srejected their invitations": "%(severalUsers)srejeitaram seus convites", + "%(oneUser)srejected their invitation": "%(oneUser)srejeitou seu convite", + "%(severalUsers)shad their invitations withdrawn %(repeats)s times": "%(severalUsers)stiveram seus convites desfeitos %(repeats)s vezes", + "%(oneUser)shad their invitation withdrawn %(repeats)s times": "%(oneUser)steve seu convite desfeito %(repeats)s vezes", + "%(severalUsers)shad their invitations withdrawn": "%(severalUsers)stiveram seus convites desfeitos", + "%(oneUser)shad their invitation withdrawn": "%(oneUser)steve seu convite desfeito", "were invited %(repeats)s times": "foram convidadas(os) %(repeats)s vezes", "was invited %(repeats)s times": "foi convidada(o) %(repeats)s vezes", "were invited": "foram convidadas(os)", @@ -695,12 +695,12 @@ "were kicked %(repeats)s times": "foram expulsas(os) %(repeats)s vezes", "was kicked %(repeats)s times": "foi expulsa(o) %(repeats)s vezes", "were kicked": "foram expulsas(os)", - "%(severalUsers)s changed their name %(repeats)s times": "%(severalUsers)s alteraram seu nome %(repeats)s vezes", - "%(oneUser)s changed his/her name %(repeats)s times": "%(oneUser)s alterou seu nome %(repeats)s vezes", - "%(severalUsers)s changed their name": "%(severalUsers)s alteraram seus nomes", - "%(oneUser)s changed his/her name": "%(oneUser)s alterou seu nome", - "%(severalUsers)s changed their avatar %(repeats)s times": "%(severalUsers)s alteraram sua imagem pública %(repeats)s vezes", - "%(oneUser)s changed his/her avatar %(repeats)s times": "%(oneUser)s alterou sua imagem pública %(repeats)s vezes", - "%(severalUsers)s changed their avatar": "%(severalUsers)s alteraram sua imagem pública", + "%(severalUsers)schanged their name %(repeats)s times": "%(severalUsers)salteraram seu nome %(repeats)s vezes", + "%(oneUser)schanged their name %(repeats)s times": "%(oneUser)salterou seu nome %(repeats)s vezes", + "%(severalUsers)schanged their name": "%(severalUsers)salteraram seus nomes", + "%(oneUser)schanged their name": "%(oneUser)salterou seu nome", + "%(severalUsers)schanged their avatar %(repeats)s times": "%(severalUsers)salteraram sua imagem pública %(repeats)s vezes", + "%(oneUser)schanged their avatar %(repeats)s times": "%(oneUser)salterou sua imagem pública %(repeats)s vezes", + "%(severalUsers)schanged their avatar": "%(severalUsers)salteraram sua imagem pública", "Ban": "Banir" } diff --git a/test/components/views/elements/MemberEventListSummary-test.js b/test/components/views/elements/MemberEventListSummary-test.js index d01d705040..96fb4cc2e5 100644 --- a/test/components/views/elements/MemberEventListSummary-test.js +++ b/test/components/views/elements/MemberEventListSummary-test.js @@ -4,6 +4,7 @@ const ReactDOM = require("react-dom"); const ReactTestUtils = require('react-addons-test-utils'); const sdk = require('matrix-react-sdk'); const MemberEventListSummary = sdk.getComponent('views.elements.MemberEventListSummary'); +import * as languageHandler from '../../../../src/languageHandler'; const testUtils = require('../../../test-utils'); describe('MemberEventListSummary', function() { @@ -82,9 +83,11 @@ describe('MemberEventListSummary', function() { return eventsForUsers; }; - beforeEach(function() { + beforeEach(function(done) { testUtils.beforeEach(this); sandbox = testUtils.stubClient(); + + languageHandler.setLanguage('en').done(done); }); afterEach(function() { @@ -356,7 +359,7 @@ describe('MemberEventListSummary', function() { const summaryText = summary.innerText; expect(summaryText).toBe( - "user_1 and 1 other were unbanned, joined and left 2 times and were banned" + "user_1 and one other were unbanned, joined and left 2 times and were banned" ); }); @@ -559,7 +562,7 @@ describe('MemberEventListSummary', function() { const summaryText = summary.innerText; expect(summaryText).toBe( - "user_1 and 1 other rejected their invitations and " + + "user_1 and one other rejected their invitations and " + "had their invitations withdrawn" ); }); @@ -595,7 +598,7 @@ describe('MemberEventListSummary', function() { const summaryText = summary.innerText; expect(summaryText).toBe( - "user_1 rejected their invitations 2 times" + "user_1 rejected their invitation 2 times" ); }); @@ -650,7 +653,7 @@ describe('MemberEventListSummary', function() { const summaryText = summary.innerText; expect(summaryText).toBe( - "user_1, user_2 and 1 other joined" + "user_1, user_2 and one other joined" ); }); diff --git a/test/test-utils.js b/test/test-utils.js index 40be715abd..5209465362 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -3,8 +3,6 @@ import sinon from 'sinon'; import q from 'q'; import ReactTestUtils from 'react-addons-test-utils'; -import * as counterpart from 'counterpart-riot'; -var languageHandler = require("../src/languageHandler"); import peg from '../src/MatrixClientPeg.js'; import jssdk from 'matrix-js-sdk'; @@ -67,10 +65,6 @@ export function beforeEach(context) { console.log(desc); console.log(new Array(1 + desc.length).join("=")); - - const languages = languageHandler.getNormalizedLanguageKeys('en'); - languageHandler.setLanguage(languages, counterpart); - };