Skip to content

Feat: Hungarian translation #330

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 8 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
<option value="en">English</option>
<option value="fr">Fran&ccedil;ais</option>
<option value="es">Espa&ntilde;ol</option>
<option value="hu">Magyar</option>
</select>
</div>
</div>
Expand Down
39 changes: 39 additions & 0 deletions src/translations/hu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"log_in": "Bejelentkezés",
"log_out": "Kijelentkezés",
"logged_in_as": "Bejelentkezve mint",
"logged_in": "Bejelentkezve",
"logging_in": "Bejelentkezés...",
"logging_out": "Kijelentkezés...",
"sign_up": "Regisztráció",
"signing_up": "Regisztrálás...",
"forgot_password": "Elfelejtette a jelszavát?",
"recover_password": "Jelszó visszaállítása",
"send_recovery_email": "Jelszópótló levél küldése",
"sending_recovery_email": "Jelszópótló levél küldése...",
"never_mind": "Mégsem",
"update_password": "Új jelszó beállítása",
"updating_password": "Új jelszó beállítása...",
"complete_your_signup": "Regisztráció befejezése",
"site_url_title": "Fejlesztői Beállítások",
"site_url_link_text": "Localhost URL törlése",
"site_url_message": "Úgy néz ki egy helyi szervert futtat. Kérjük adja meg a Netlify oldala URL-jét.",
"site_url_label": "Adja meg a Netlify oldala URL-jét",
"site_url_placeholder": "a Netlify oldala URL-je",
"site_url_submit": "URL beállítása",
"message_confirm": "Elküldtünk egy megerősítő levelet e-mailben, kérjük kattintson a linkre a levélben a folytatáshoz.",
"message_password_mail": "Elküldtünk egy jelszópótló levelet e-mailtben, kérjük kövesse a linket a levélben a jelszava visszaállításához.",
"message_email_changed": "Az e-mail címét frissítettük!",
"message_verfication_error": "probléma történt a fiókja megerősítése közben. Kérjük próbálja újra, vagy vegye fel a kapcsolatot egy adminisztrátorral.",
"message_signup_disabled": "A nyilvános regisztráció nincs engedélyezve. Vegye fel a kapcsolatot egy adminisztrátorral és kérjen meghívót.",
"form_name_placeholder": "Név",
"form_email_label": "Adja meg az e-mail címét",
"form_name_label": "Adja meg a nevét",
"form_email_placeholder": "E-mail",
"form_password_label": "Adja meg a jelszavát",
"form_password_placeholder": "Jelszó",
"coded_by": "Fejlesztette a Netlify",
"No user found with this email": "Nem található fiók ezzel az e-mail címmel",
"Invalid Password": "Helytelen Jelszó",
"continue_with": "Bejelentkezés a következővel:"
}
3 changes: 2 additions & 1 deletion src/translations/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,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";

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

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

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

it("should return translation for 'es' locale", () => {
const { getTranslation } = require("./");
expect(getTranslation("log_in", "es")).toEqual("Iniciar sesión");
Expand All @@ -31,11 +36,13 @@ describe("translations", () => {
it("should default to 'en' on missing key", () => {
jest.mock("./en.json", () => ({ log_in: "Log in" }));
jest.mock("./fr.json", () => ({}));
jest.mock("./hu.json", () => ({}));
jest.mock("./es.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");
});
});