Skip to content

Add Dutch (nl) translations #541

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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, 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
Expand Down
3 changes: 2 additions & 1 deletion src/translations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
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 @@ -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");
Expand All @@ -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");
Expand All @@ -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");
});
});
41 changes: 41 additions & 0 deletions src/translations/nl.json
Original file line number Diff line number Diff line change
@@ -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"
}