From 914c918eaa60e50fe75ae5e99a1826d38c877efa Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 10 Mar 2023 16:36:52 -0300 Subject: [PATCH 1/5] Add a simpler, more organized i18n.ts implementation --- .eslintrc.js | 1 + Rules | 5 +++ src/html/pages/surah/index.html.erb | 3 ++ src/html/pages/surah/stream.html.erb | 3 ++ src/i18n.json | 16 +++++++++ src/js/components/Stream.tsx | 17 +++++---- src/js/lib/i18n.ts | 52 ++++++++++------------------ src/js/pages/surah/index.tsx | 13 +++---- src/js/pages/surah/stream.tsx | 13 +++---- 9 files changed, 68 insertions(+), 55 deletions(-) create mode 100644 src/i18n.json diff --git a/.eslintrc.js b/.eslintrc.js index 4d8b1c1c8..e245e40b5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,6 +13,7 @@ module.exports = { "@typescript-eslint/prefer-nullish-coalescing": 0, "@typescript-eslint/restrict-template-expressions": 0, "@typescript-eslint/promise-function-async": 0, + "@typescript-eslint/consistent-type-definitions": 0, "@typescript-eslint/no-misused-promises": ["error", {"checksConditionals": false}], "@typescript-eslint/no-redeclare": 0, "@typescript-eslint/no-non-null-assertion": 0, diff --git a/Rules b/Rules index 598e9fc3a..4661e768d 100644 --- a/Rules +++ b/Rules @@ -36,6 +36,11 @@ require_rules "rules/pages/surah/index", {locales:} require_rules "rules/pages/surah/redirect" require_rules "rules/pages/surah/id_redirect", {locales:} +compile "/i18n.json" do + filter(:minify_json) + write("/i18n.json") +end + ## # Defaults compile("/**/*") { write(nil) } diff --git a/src/html/pages/surah/index.html.erb b/src/html/pages/surah/index.html.erb index e17a76e5f..717957f38 100644 --- a/src/html/pages/surah/index.html.erb +++ b/src/html/pages/surah/index.html.erb @@ -14,5 +14,8 @@
+