diff --git a/README.md b/README.md index 236923e0d..336579759 100644 --- a/README.md +++ b/README.md @@ -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 } ``` diff --git a/src/translations/index.js b/src/translations/index.js index c69ddaaee..55b78da7d 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -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 }; export const getTranslation = (key, locale = defaultLocale) => { const translated = translations[locale] && translations[locale][key]; diff --git a/src/translations/index.test.js b/src/translations/index.test.js index 66521945b..7937a6cce 100644 --- a/src/translations/index.test.js +++ b/src/translations/index.test.js @@ -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"); @@ -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"); }); }); diff --git a/src/translations/pt.json b/src/translations/pt.json new file mode 100644 index 000000000..2e7a7ae40 --- /dev/null +++ b/src/translations/pt.json @@ -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" +} diff --git a/src/translations/ru.json b/src/translations/ru.json new file mode 100644 index 000000000..c32cbbe69 --- /dev/null +++ b/src/translations/ru.json @@ -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": "Пользователь не найден" +}