From a84a13c76d99f1e6f4505d43108a4111749e5035 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Sat, 25 May 2024 19:14:54 -0400
Subject: Custom error handler and some misc fixes

---
 frontend/src/utils/TranslationHelper.tsx | 49 ++++++++++++++------------------
 1 file changed, 22 insertions(+), 27 deletions(-)

(limited to 'frontend/src/utils/TranslationHelper.tsx')

diff --git a/frontend/src/utils/TranslationHelper.tsx b/frontend/src/utils/TranslationHelper.tsx
index 99584d6b..61bd24bf 100644
--- a/frontend/src/utils/TranslationHelper.tsx
+++ b/frontend/src/utils/TranslationHelper.tsx
@@ -11,47 +11,42 @@ export enum TranslationClass {
 }
 
 interface TranslationHelperProps {
-  trans_class: TranslationClass;
-  trans_text: string;
-  i18n_args?: {};
-  install_type?: number;
+  transClass: TranslationClass;
+  transText: string;
+  i18nArgs?: {};
+  installType?: number;
 }
 
 const logger = new Logger('TranslationHelper');
 
-const TranslationHelper: FC<TranslationHelperProps> = ({
-  trans_class,
-  trans_text,
-  i18n_args = null,
-  install_type = 0,
-}) => {
+const TranslationHelper: FC<TranslationHelperProps> = ({ transClass, transText, i18nArgs = null, installType = 0 }) => {
   return (
     <Translation>
       {(t, {}) => {
-        switch (trans_class) {
+        switch (transClass) {
           case TranslationClass.PLUGIN_LOADER:
-            return i18n_args
-              ? t(TranslationClass.PLUGIN_LOADER + '.' + trans_text, i18n_args)
-              : t(TranslationClass.PLUGIN_LOADER + '.' + trans_text);
+            return i18nArgs
+              ? t(TranslationClass.PLUGIN_LOADER + '.' + transText, i18nArgs)
+              : t(TranslationClass.PLUGIN_LOADER + '.' + transText);
           case TranslationClass.PLUGIN_INSTALL_MODAL:
-            switch (install_type) {
+            switch (installType) {
               case InstallType.INSTALL:
-                return i18n_args
-                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.install.' + trans_text, i18n_args)
-                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.install.' + trans_text);
+                return i18nArgs
+                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.install.' + transText, i18nArgs)
+                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.install.' + transText);
               case InstallType.REINSTALL:
-                return i18n_args
-                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.reinstall.' + trans_text, i18n_args)
-                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.reinstall.' + trans_text);
+                return i18nArgs
+                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.reinstall.' + transText, i18nArgs)
+                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.reinstall.' + transText);
               case InstallType.UPDATE:
-                return i18n_args
-                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.update.' + trans_text, i18n_args)
-                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.update.' + trans_text);
+                return i18nArgs
+                  ? t(TranslationClass.PLUGIN_INSTALL_MODAL + '.update.' + transText, i18nArgs)
+                  : t(TranslationClass.PLUGIN_INSTALL_MODAL + '.update.' + transText);
             }
           case TranslationClass.DEVELOPER:
-            return i18n_args
-              ? t(TranslationClass.DEVELOPER + '.' + trans_text, i18n_args)
-              : t(TranslationClass.DEVELOPER + '.' + trans_text);
+            return i18nArgs
+              ? t(TranslationClass.DEVELOPER + '.' + transText, i18nArgs)
+              : t(TranslationClass.DEVELOPER + '.' + transText);
           default:
             logger.error('We should never fall in the default case!');
             return '';
-- 
cgit v1.2.3

