From db803585d56a5e06a80fbc78f133d287f2a4f3c2 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sat, 12 Oct 2019 18:36:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Utilise=20URLSearchParams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Utilise la fonction standard URLSearchParams à la place de la dépendance NPM `query-string`. --- source/i18n.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/i18n.js b/source/i18n.js index a08de02b6..e00a46ae3 100644 --- a/source/i18n.js +++ b/source/i18n.js @@ -1,5 +1,4 @@ import i18next from 'i18next' -import queryString from 'query-string' import { initReactI18next } from 'react-i18next' import enTranslations from './locales/en.yaml' import { @@ -11,8 +10,7 @@ import { let lang = getIframeOption('lang') || - (typeof location !== 'undefined' && - queryString.parse(location.search)['lang']) || + new URLSearchParams(document.location.search.substring(1)).get('lang') || parseDataAttributes(getFromSessionStorage('lang')) || 'fr'