From aa06392bee22f4d6846a84689f65c38863d36af8 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sat, 24 Apr 2021 18:42:13 +0100 Subject: [PATCH] Update french translation. --- src/formatDistance.js | 16 ++++++++++++++++ src/main.js | 2 +- src/translations/en.js | 1 - src/translations/fr.js | 2 ++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/formatDistance.js diff --git a/src/formatDistance.js b/src/formatDistance.js new file mode 100644 index 0000000..68a8e09 --- /dev/null +++ b/src/formatDistance.js @@ -0,0 +1,16 @@ +import { de, enGB, fr, nl, ru } from 'date-fns/locale' +import { formatDistance as formatDistanceReal} from 'date-fns'; + +function getLocale() { + return { + "en": enGB, + "fr": fr, + "nl": nl, + "ru": ru, + "de": de, + }[localStorage.getItem("language") || "en"]; +} + +export function formatDistance(d1, d2) { + return formatDistanceReal(d1, d2, { locale: getLocale() }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 954afe9..a24ffe6 100644 --- a/src/main.js +++ b/src/main.js @@ -72,7 +72,7 @@ import translation_de from './translations/de.js' import translation_ru from './translations/ru.js' import translation_nl from './translations/nl.js' import translation_fr from './translations/fr.js' -import formatDistance from 'date-fns/formatDistance'; +import {formatDistance} from './formatDistance.js'; /*import "en-GB" as date_locale_en from 'date-fns/locale' diff --git a/src/translations/en.js b/src/translations/en.js index eb87019..a6bda02 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -28,7 +28,6 @@ module.exports = { "submit_key_btn": "Submit Key", "unseal_input_btn": "Switch to Manual Key Input", "unseal_qr_btn": "Switch to QR Key Input", - "key_input_placeholder": "Key", "unseal_keys_progress": "Keys: {{progress}}/{{keys_needed}}", diff --git a/src/translations/fr.js b/src/translations/fr.js index 80617f0..a1ffca6 100644 --- a/src/translations/fr.js +++ b/src/translations/fr.js @@ -26,6 +26,8 @@ module.exports = { // Unseal Page "unseal_vault_text": "Ouvrir le Vault", "submit_key_btn": "Ajouter la clé", + "unseal_input_btn": "Basculer en entrée de clé manuelle", + "unseal_qr_btn": "Basculer en entrée de QR code", "key_input_placeholder": "Clé", "unseal_keys_progress": "Clés: {{progress}}/{{keys_needed}}",