From d9c697ca3ac9960e492e284ba9e1e53cf18d4ce2 Mon Sep 17 00:00:00 2001 From: Nitrrine Date: Fri, 30 Aug 2024 14:40:54 +0500 Subject: [PATCH] Use full language name (en_US, etc.) instead of short (en, etc.) --- crowdin.yml | 2 +- html/alert.js | 4 +++- html/i18n/{en.json => en_US.json} | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename html/i18n/{en.json => en_US.json} (100%) diff --git a/crowdin.yml b/crowdin.yml index 9027d2b..d4481e6 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -9,6 +9,6 @@ files: [ { "source": "/html/i18n/en.json", - "translation": "/html/i18n/%two_letters_code%.json", + "translation": "/html/i18n/%locale_with_underscore%.json", }, ] diff --git a/html/alert.js b/html/alert.js index 1f7fe2f..3a8bc19 100644 --- a/html/alert.js +++ b/html/alert.js @@ -5,7 +5,9 @@ let blockedSite = { path: "", url: "", }; -let preferedLanguage = navigator.language.split("-")[0]; +let preferedLanguage = navigator.language; + +console.log(preferedLanguage); fetch(`./i18n/${preferedLanguage}.json`) .then((response) => response.json()) diff --git a/html/i18n/en.json b/html/i18n/en_US.json similarity index 100% rename from html/i18n/en.json rename to html/i18n/en_US.json