From 4e0b1d06e3255dcd72900be7d2e6b5f3c6c406e5 Mon Sep 17 00:00:00 2001 From: Ewald Arnold Date: Sat, 2 Nov 2019 16:18:18 +0100 Subject: [PATCH 1/5] added Russian to locales --- webapp/locales/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/locales/index.js b/webapp/locales/index.js index c4a21c724..28cbd27d0 100644 --- a/webapp/locales/index.js +++ b/webapp/locales/index.js @@ -1,4 +1,4 @@ -import { enUS, de, nl, fr, es, it, pt, pl } from 'date-fns/locale' +import { enUS, de, nl, fr, es, it, pt, pl, ru } from 'date-fns/locale' import find from 'lodash/find' const locales = [ @@ -58,6 +58,13 @@ const locales = [ enabled: true, dateFnsLocale: pl, }, + { + name: 'Русский', + code: 'ru', + iso: 'ru-RU', + enabled: true, + dateFnsLocale: ru, + }, ] export default locales From 5fbe0da2ae9c43c82861036f6526507206a88c32 Mon Sep 17 00:00:00 2001 From: Ewald Arnold Date: Sun, 3 Nov 2019 17:31:10 +0100 Subject: [PATCH 2/5] add empty russian template --- webapp/locales/ru.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 webapp/locales/ru.json diff --git a/webapp/locales/ru.json b/webapp/locales/ru.json new file mode 100644 index 000000000..e69de29bb From 97bd1b4816cb0eb61c733aa451af9140a73efe55 Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Sun, 3 Nov 2019 19:12:20 +0100 Subject: [PATCH 3/5] in ru.json i started this once in ru.json i started this once. as a template you can use german or english. both languages are complete. you can copy and paste the ru.json. what is not translated. default will be shown in english. --- webapp/locales/ru.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/webapp/locales/ru.json b/webapp/locales/ru.json index e69de29bb..6f97cdf10 100644 --- a/webapp/locales/ru.json +++ b/webapp/locales/ru.json @@ -0,0 +1,28 @@ +{ + "components": { + "password-reset": { + "request": { + "title": "Сбросить пароль", + "form": { + "description": "На указанный адрес электронной почты будет отправлено письмо для сброса пароля.", + "submit": "Запросить электронную почту", + "submitted": "На {email} отправлено письмо с дополнительными инструкциями." + } + }, + "change-password": { + "success": "Смена пароля прошла успешно!", + "error": "Смена пароля не удалась. Может быть, код безопасности был неверным?", + "help": "В случае возникновения проблем, не стесняйтесь обратиться за помощью, отправив нам письмо по адресу:" + } + }, + "enter-nonce": { + "form": { + "nonce": "Введите ваш код", + "description": "Откройте свой почтовый ящик и введите код, который мы вам отправили.", + "next": "Продолжить", + "validations": { + "length": "должно быть длиной 6 символов" + } + } + } + } From 60c2bba2718cda5507024ea1224f5f025657ef0e Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Sun, 3 Nov 2019 19:14:44 +0100 Subject: [PATCH 4/5] fix missing bracket fix missing bracket --- webapp/locales/ru.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/locales/ru.json b/webapp/locales/ru.json index 6f97cdf10..a103ef7a9 100644 --- a/webapp/locales/ru.json +++ b/webapp/locales/ru.json @@ -25,4 +25,5 @@ } } } - } + } +} From a704709ba3ec9e8013f9af4f8141a712a52e5aa6 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Mon, 4 Nov 2019 18:52:34 +0100 Subject: [PATCH 5/5] fix: resolver returned undefined for `nameRU` This registers the language Russian in the backend. Unfortunately, the locations seem to be implemented with a hard coded attribute for each language. :disappointed: We should refactor this. --- backend/src/middleware/nodes/locations.js | 4 +++- backend/src/models/Location.js | 1 + backend/src/schema/types/Location.gql | 1 + backend/src/seed/seed-db.js | 5 +++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/middleware/nodes/locations.js b/backend/src/middleware/nodes/locations.js index a90d8c0d7..e72869cb6 100644 --- a/backend/src/middleware/nodes/locations.js +++ b/backend/src/middleware/nodes/locations.js @@ -19,7 +19,7 @@ const fetch = url => { }) } -const locales = ['en', 'de', 'fr', 'nl', 'it', 'es', 'pt', 'pl'] +const locales = ['en', 'de', 'fr', 'nl', 'it', 'es', 'pt', 'pl', 'ru'] const createLocation = async (session, mapboxData) => { const data = { @@ -32,6 +32,7 @@ const createLocation = async (session, mapboxData) => { nameES: mapboxData.text_es, namePT: mapboxData.text_pt, namePL: mapboxData.text_pl, + nameRU: mapboxData.text_ru, type: mapboxData.id.split('.')[0].toLowerCase(), lat: mapboxData.center && mapboxData.center.length ? mapboxData.center[0] : null, lng: mapboxData.center && mapboxData.center.length ? mapboxData.center[1] : null, @@ -48,6 +49,7 @@ const createLocation = async (session, mapboxData) => { 'l.nameES = $nameES, ' + 'l.namePT = $namePT, ' + 'l.namePL = $namePL, ' + + 'l.nameRU = $nameRU, ' + 'l.type = $type' if (data.lat && data.lng) { diff --git a/backend/src/models/Location.js b/backend/src/models/Location.js index bd6e0b5d9..2c62877f7 100644 --- a/backend/src/models/Location.js +++ b/backend/src/models/Location.js @@ -12,6 +12,7 @@ module.exports = { nameDE: { type: 'string' }, nameNL: { type: 'string' }, namePL: { type: 'string' }, + nameRU: { type: 'string' }, isIn: { type: 'relationship', relationship: 'IS_IN', diff --git a/backend/src/schema/types/Location.gql b/backend/src/schema/types/Location.gql index e7053e345..78bc07656 100644 --- a/backend/src/schema/types/Location.gql +++ b/backend/src/schema/types/Location.gql @@ -9,6 +9,7 @@ type Location { nameES: String namePT: String namePL: String + nameRU: String type: String! lat: Float lng: Float diff --git a/backend/src/seed/seed-db.js b/backend/src/seed/seed-db.js index 76fbb4875..1fc5af85a 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/seed/seed-db.js @@ -39,6 +39,7 @@ import { gql } from '../jest/helpers' nameDE: 'Hamburg', nameNL: 'Hamburg', namePL: 'Hamburg', + nameRU: 'Гамбург', }), factory.create('Location', { id: 'region.14880313158564380', @@ -54,6 +55,7 @@ import { gql } from '../jest/helpers' nameDE: 'Berlin', nameNL: 'Berlijn', namePL: 'Berlin', + nameRU: 'Берлин', }), factory.create('Location', { id: 'country.10743216036480410', @@ -67,6 +69,7 @@ import { gql } from '../jest/helpers' nameFR: 'Allemagne', nameIT: 'Germania', nameEN: 'Germany', + nameRU: 'Германия', }), factory.create('Location', { id: 'region.9397217726497330', @@ -82,6 +85,7 @@ import { gql } from '../jest/helpers' nameDE: 'Paris', nameNL: 'Parijs', namePL: 'Paryż', + nameRU: 'Париж', }), factory.create('Location', { id: 'country.9759535382641660', @@ -95,6 +99,7 @@ import { gql } from '../jest/helpers' nameFR: 'France', nameIT: 'Francia', nameEN: 'France', + nameRU: 'Франция', }), ]) await Promise.all([