Skip to content

feat: add polish translations #409

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 2 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -157,7 +157,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, pt, hu - default to en
locale: 'en'; // language code for translations - available: en, fr, es, pt, hu, pl - 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 @@ -3,9 +3,10 @@ import * as fr from "./fr.json";
import * as es from "./es.json";
import * as hu from "./hu.json";
import * as pt from "./pt.json";
import * as pl from "./pl.json";

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

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 @@ -33,6 +33,11 @@ describe("translations", () => {
expect(getTranslation("log_in", "pt")).toEqual("Entrar");
});

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

it("should return key for non existing translation", () => {
const { getTranslation } = require("./");
expect(getTranslation("unknown_key")).toEqual("unknown_key");
Expand All @@ -44,12 +49,14 @@ describe("translations", () => {
jest.mock("./hu.json", () => ({}));
jest.mock("./es.json", () => ({}));
jest.mock("./pt.json", () => ({}));
jest.mock("./pl.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");
expect(getTranslation("log_in", "pl")).toEqual("Log in");
});
});
41 changes: 41 additions & 0 deletions src/translations/pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"log_in": "Zaloguj się",
"log_out": "Wyloguj się",
"logged_in_as": "Zaloguj jako",
"logged_in": "Zalogowany",
"logging_in": "Logowanie",
"logging_out": "Wylogowywanie",
"sign_up": "Zarejestruj się",
"signing_up": "Rejestracja",
"forgot_password": "Nie pamiętasz hasła?",
"recover_password": "Resetuj hasło",
"send_recovery_email": "Wyślij link do resetowania hasła",
"sending_recovery_email": "Wysyłanie linku do resetowania hasła",
"never_mind": "Nieistotne",
"update_password": "Zaktualizuj hasło",
"updating_password": "Aktualizowanie hasło",
"complete_your_signup": "Dokończ rejestrację",
"site_url_title": "Ustawienia strony",
"site_url_link_text": "Usuń adres localhost",
"site_url_message": "Wygląda na to że został uruchomiony lokalny serwer. Wprowadź adres Twojej strony na Netlify.",
"site_url_label": "Wprowadz adres strony na Netlify",
"site_url_placeholder": "Adres Twojej strony na Netlify",
"site_url_submit": "Ustaw adres strony",
"message_confirm": "Potwierdzenie zostało wysłane na Twój adres email. Kliknij w link w wiadomości aby kontunuować.",
"message_password_mail": "Wysłaliśmy link resetujący hasło na Twój adres email. Klknij w link w wiadomości aby zresetować hasło.",
"message_email_changed": "Twój adres email został zaktualizowany!",
"message_verfication_error": "Wystąpił błąd podczas weryfikcacji Twoje konta. Spróbuj ponownie lub skontaktuj się z administratorem,",
"message_signup_disabled": "Publiczna rejestracja jest wyłączona. Skontaktuj się z administratorem by uzyskać zaproszenie.",
"form_name_placeholder": "Imię",
"form_email_label": "Wprowadź Twój adres email",
"form_name_label": "Wprowadź Twoje imię",
"form_email_placeholder": "Email",
"form_password_label": "Wprowadź twoje hasło",
"form_password_placeholder": "Hasło",
"coded_by": "Coded by Netlify",
"continue_with": "Kontynuuj z",
"No user found with this email": "Nie znaleziono użytkownika o tym adresie",
"Invalid Password": "Hasło nieprawidłowe",
"Email not confirmed": "Email nie został potwierdzony",
"User not found": "Nie znaleziono użytkownika"
}