diff --git a/README.md b/README.md index 91f44daba..796272792 100644 --- a/README.md +++ b/README.md @@ -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, pl, cs, sk - default to en + locale: 'en'; // language code for translations - available: en, fr, es, pt, hu, pl, cs, sk, nl - default to en ``` Generally avoid setting the `APIUrl`. You should only set this when your app is diff --git a/src/translations/index.js b/src/translations/index.js index 1119f6f7f..5dec9b905 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -6,9 +6,10 @@ import * as pt from "./pt.json"; import * as pl from "./pl.json"; import * as cs from "./cs.json"; import * as sk from "./sk.json"; +import * as nl from "./nl.json"; export const defaultLocale = "en"; -const translations = { en, fr, es, hu, pt, pl, cs, sk }; +const translations = { en, fr, es, hu, pt, pl, cs, sk, nl }; 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 55bb47496..46588eabc 100644 --- a/src/translations/index.test.js +++ b/src/translations/index.test.js @@ -48,6 +48,11 @@ describe("translations", () => { expect(getTranslation("log_in", "sk")).toEqual("Prihlásiť sa"); }); + it("should return translation for 'nl' locale", () => { + const { getTranslation } = require("./"); + expect(getTranslation("log_in", "nl")).toEqual("Inloggen"); + }); + it("should return key for non existing translation", () => { const { getTranslation } = require("./"); expect(getTranslation("unknown_key")).toEqual("unknown_key"); @@ -62,6 +67,7 @@ describe("translations", () => { jest.mock("./cs.json", () => ({})); jest.mock("./sk.json", () => ({})); jest.mock("./pl.json", () => ({})); + jest.mock("./nl.json", () => ({})); const { getTranslation } = require("./"); expect(getTranslation("log_in")).toEqual("Log in"); @@ -72,5 +78,6 @@ describe("translations", () => { expect(getTranslation("log_in", "pl")).toEqual("Log in"); expect(getTranslation("log_in", "cs")).toEqual("Log in"); expect(getTranslation("log_in", "sk")).toEqual("Log in"); + expect(getTranslation("log_in", "nl")).toEqual("Log in"); }); }); diff --git a/src/translations/nl.json b/src/translations/nl.json new file mode 100644 index 000000000..8d3f36760 --- /dev/null +++ b/src/translations/nl.json @@ -0,0 +1,41 @@ +{ + "log_in": "Inloggen", + "log_out": "Uitloggen", + "logged_in_as": "Ingelogd als", + "logged_in": "Ingelogd", + "logging_in": "Inloggen...", + "logging_out": "Uitloggen...", + "sign_up": "Registreren", + "signing_up": "Registreren...", + "forgot_password": "Wachtwoord vergeten?", + "recover_password": "Wachtwoord herstellen", + "send_recovery_email": "Herstelmail verzenden", + "sending_recovery_email": "Herstelmail wordt verzonden", + "never_mind": "Laat maar", + "update_password": "Wachtwoord wijzigen", + "updating_password": "Wachtwoord wordt gewijzigd", + "complete_your_signup": "Inschrijving voltooien", + "site_url_title": "Developer Instellingen", + "site_url_link_text": "Wis localhost URL", + "site_url_message": "Het lijkt erop dat je een lokale server draait. Vul de URL van je Netlify Website in.", + "site_url_label": "Vul je Netlify Website URL in", + "site_url_placeholder": "URL van je Netlify Website", + "site_url_submit": "Stel de URL in", + "message_confirm": "Er is een bevestigingsmail verzonden. Klik op de link in je mail om verder te gaan.", + "message_password_mail": "We hebben een herstelmail verzonden, klik op de link in je mail om je wachtwoord te herstellen.", + "message_email_changed": "Je e-mailadres is veranderd!", + "message_verfication_error": "Er ging iets mis bij het verifiëren van je account. Probeer opnieuw, of neem contact op met een beheerder.", + "message_signup_disabled": "Publieke inschrijvingen zijn uitgeschakeld. Neem contact op met een beheerder en vraag om een uitnodiging.", + "form_name_placeholder": "Naam", + "form_email_label": "Vul je e-mailadres in", + "form_name_label": "Vul je naam in", + "form_email_placeholder": "E-mail", + "form_password_label": "Vul je wachtwoord in", + "form_password_placeholder": "Wachtwoord", + "coded_by": "Gemaakt door Netlify", + "continue_with": "Verdergaan met", + "No user found with this email": "Er is geen gebruiker gevonden met dit e-mailadres", + "Invalid Password": "Ongeldig Wachtwoord", + "Email not confirmed": "E-mailadres niet bevestigd", + "User not found": "Gebruiker niet gevonden" +}