Skip to content

feat: Russian translation #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4ab8b09
russian translation
Aug 19, 2020
27d7dbc
russian
Aug 19, 2020
9473ebd
clean-up
Aug 19, 2020
578fea9
fixed translation
Aug 19, 2020
3ed8c6c
added missing translation
Aug 19, 2020
c0fc2f0
fixed mistake
Aug 19, 2020
a7b1e24
small appropriation of translation
Aug 19, 2020
ad6b80c
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
297487c
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
e408f0f
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
e3e6c64
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
d33e0c3
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
0660239
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
c927f81
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
dba589d
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
f6ba471
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
80757b8
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
eaa802e
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
7da56b7
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
9649620
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
4fe3b94
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
1fbf07e
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
ac399ef
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
e112e3f
Update src/translations/ru.json
noskovvkirill Aug 26, 2020
52d1c44
resolving conflicts with pt
Aug 26, 2020
7dbf896
removed ru readme specs
Aug 26, 2020
5e5c2bb
imported pt in index.js
Aug 26, 2020
57df7c3
add pt.json file
Aug 26, 2020
4d6c19c
fixed pt
Aug 26, 2020
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module API. Options include:
container: '#some-query-selector'; // container to attach to
APIUrl: 'https://www.example.com/.netlify/functions/identity'; // Absolute url to endpoint. ONLY USE IN SPECIAL CASES!
namePlaceholder: 'some-placeholder-for-Name'; // custom placeholder for name input form
locale: 'en'; // language code for translations - available: en, fr, es - default to en
locale: 'en'; // language code for translations - available: en, fr, es, pt, hu - default to en
}
```

Expand Down
3 changes: 2 additions & 1 deletion src/translations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import * as en from "./en.json";
import * as fr from "./fr.json";
import * as es from "./es.json";
import * as hu from "./hu.json";
import * as pt from "./pt.json";

export const defaultLocale = "en";
const translations = { en, fr, es, hu };
const translations = { en, fr, es, hu, pt };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are Russian translations connected? I don't see reference here or in imports 🤷‍♂️


export const getTranslation = (key, locale = defaultLocale) => {
const translated = translations[locale] && translations[locale][key];
Expand Down
7 changes: 7 additions & 0 deletions src/translations/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ describe("translations", () => {
expect(getTranslation("log_in", "es")).toEqual("Iniciar sesión");
});

it("should return translation for 'pt' locale", () => {
const { getTranslation } = require("./");
expect(getTranslation("log_in", "pt")).toEqual("Entrar");
});

it("should return key for non existing translation", () => {
const { getTranslation } = require("./");
expect(getTranslation("unknown_key")).toEqual("unknown_key");
Expand All @@ -38,11 +43,13 @@ describe("translations", () => {
jest.mock("./fr.json", () => ({}));
jest.mock("./hu.json", () => ({}));
jest.mock("./es.json", () => ({}));
jest.mock("./pt.json", () => ({}));

const { getTranslation } = require("./");
expect(getTranslation("log_in")).toEqual("Log in");
expect(getTranslation("log_in", "fr")).toEqual("Log in");
expect(getTranslation("log_in", "hu")).toEqual("Log in");
expect(getTranslation("log_in", "es")).toEqual("Log in");
expect(getTranslation("log_in", "pt")).toEqual("Log in");
});
});
41 changes: 41 additions & 0 deletions src/translations/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"log_in": "Entrar",
"log_out": "Sair",
"logged_in_as": "Logado como",
"logged_in": "Logado em",
"logging_in": "Logando em",
"logging_out": "Saindo",
"sign_up": "Registrar",
"signing_up": "Registrando",
"forgot_password": "Esqueceu a senha?",
"recover_password": "Recuperar senha",
"send_recovery_email": "Enviar email de recuperação de senha",
"sending_recovery_email": "Enviando email de recuperação de senha",
"never_mind": "Deixa pra lá",
"update_password": "Atualizar senha",
"updating_password": "Atualizando senha",
"complete_your_signup": "Complete seu registro",
"site_url_title": "Configurações de desenvolvimento",
"site_url_link_text": "Limpar URL do localhost",
"site_url_message": "Parece que você está executando um servidor local. Informe-nos o URL do seu site Netlify.",
"site_url_label": "Insira o URL do seu site Netlify",
"site_url_placeholder": "URL do seu site Netlify",
"site_url_submit": "Configure a URL do seu site",
"message_confirm": "Uma mensagem de confirmação foi enviada para o seu email, clique no link para continuar.",
"message_password_mail": "Enviamos um e-mail de recuperação para sua conta, siga o link para redefinir sua senha.",
"message_email_changed": "Seu email foi atualizado!",
"message_verfication_error": "Ocorreu um erro ao verificar sua conta. Tente novamente ou entre em contato com um administrador.",
"message_signup_disabled": "Registros públicos estão desabilitados. Contate um administrador e peça por um convite.",
"form_name_placeholder": "Nome",
"form_email_label": "Insira seu email",
"form_name_label": "Insira seu nome",
"form_email_placeholder": "Email",
"form_password_label": "Insira sua senha",
"form_password_placeholder": "Senha",
"coded_by": "Desenvolvido por Netlify",
"continue_with": "Continue com",
"No user found with this email": "Nenhum usuário encontrado com esse email",
"Invalid Password": "Senha inválida",
"Email not confirmed": "Email não confirmado",
"User not found": "Usuário não encontrado"
}
41 changes: 41 additions & 0 deletions src/translations/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"log_in": "Войти",
"log_out": "Выйти",
"logged_in_as": "Вы вошли как",
"logged_in": "Вы вошли",
"logging_in": "Выполняется вход",
"logging_out": "Выполняется выход",
"sign_up": "Зарегистрироваться",
"signing_up": "Выполняется регистрация",
"forgot_password": "Забыли пароль?",
"recover_password": "Восстановить пароль",
"send_recovery_email": "Отправить письмо для восстановления",
"sending_recovery_email": "Отправление письма для восстановления",
"never_mind": "Отмена",
"update_password": "Обновить пароль",
"updating_password": "Обновление пароля",
"complete_your_signup": "Завершите регистрацию",
"site_url_title": "Настройки разработки",
"site_url_link_text": "Сбросить локальный URL",
"site_url_message": "Похоже, вы используете локальный сервер. Введите адрес Вашего сайта, размещённого на Netlify.",
"site_url_label": "Адрес сайта Netlify",
"site_url_placeholder": "URL сайта Netlify",
"site_url_submit": "Установить URL сайта",
"message_confirm": "Письмо с подтверждением отправлено на Ваш адрес электронной почты. Нажмите на ссылку в письме для продолжения.",
"message_password_mail": "Мы отправили Вам электронное письмо для восстановления. Перейдите по ссылке в письме для сброса пароля.",
"message_email_changed": "Ваша электронная почта обновлена!",
"message_verfication_error": "Ошибка подтверждения аккаунта. Пожалуйста, попробуйте снова или свяжитесь с администратором.",
"message_signup_disabled": "Регистрация закрыта. Свяжитесь с администратором, чтобы запросить приглашение.",
"form_name_placeholder": "Имя",
"form_email_label": "Введите Ваш адрес электронной почты",
"form_name_label": "Введите имя",
"form_email_placeholder": "Электронная почта",
"form_password_label": "Введите пароль",
"form_password_placeholder": "Пароль",
"coded_by": "Сделано Netlify",
"No user found with this email": "Нет пользователя с такой электронной почтой",
"Invalid Password": "Неправильный пароль",
"continue_with": "Продолжить с",
"Email not confirmed": "Адрес электронной почты не подтверждён",
"User not found": "Пользователь не найден"
}