Jelajahi Sumber

i18n: add missing specification and total labels to master translations file

unknown 2 bulan lalu
induk
melakukan
bf88943e1e
3 mengubah file dengan 39 tambahan dan 25 penghapusan
  1. 2 2
      backend/routers/orders.py
  2. 12 0
      src/locales/translations.user.json
  3. 25 23
      vite.config.ts

+ 2 - 2
backend/routers/orders.py

@@ -169,7 +169,7 @@ async def get_my_orders(
     query = """
     SELECT o.*, 
            (SELECT count(*) FROM order_messages om WHERE om.order_id = o.id AND om.is_from_admin = TRUE AND om.is_read = FALSE) as unread_count,
-           GROUP_CONCAT(IF(f.id IS NOT NULL, JSON_OBJECT('id', f.id, 'filename', f.filename, 'file_path', f.file_path, 'quantity', f.quantity, 'preview_path', f.preview_path, 'print_time', f.print_time, 'filament_g', f.filament_g), NULL)) as files
+           GROUP_CONCAT(IF(f.id IS NOT NULL, JSON_OBJECT('id', f.id, 'filename', f.filename, 'file_path', f.file_path, 'quantity', f.quantity, 'preview_path', f.preview_path, 'print_time', f.print_time, 'filament_g', f.filament_g, 'dimensions', f.dimensions), NULL)) as files
     FROM orders o
     LEFT JOIN order_files f ON o.id = f.order_id
     WHERE o.user_id = %s
@@ -276,7 +276,7 @@ async def get_admin_orders(
     query = f"""
     SELECT o.*, u.can_chat, COALESCE(o.total_price, o.estimated_price) AS invoice_amount,
            (SELECT count(*) FROM order_messages om WHERE om.order_id = o.id AND om.is_from_admin = FALSE AND om.is_read = FALSE) as unread_count,
-           GROUP_CONCAT(IF(f.id IS NOT NULL, JSON_OBJECT('id', f.id, 'filename', f.filename, 'file_path', f.file_path, 'file_size', f.file_size, 'quantity', f.quantity, 'preview_path', f.preview_path, 'print_time', f.print_time, 'filament_g', f.filament_g), NULL)) as files
+           GROUP_CONCAT(IF(f.id IS NOT NULL, JSON_OBJECT('id', f.id, 'filename', f.filename, 'file_path', f.file_path, 'file_size', f.file_size, 'quantity', f.quantity, 'preview_path', f.preview_path, 'print_time', f.print_time, 'filament_g', f.filament_g, 'dimensions', f.dimensions), NULL)) as files
     FROM orders o
     LEFT JOIN users u ON o.user_id = u.id
     LEFT JOIN order_files f ON o.id = f.order_id

+ 12 - 0
src/locales/translations.user.json

@@ -2540,6 +2540,18 @@
         "me": "Status",
         "ru": "Статус",
         "ua": "Статус"
+      },
+      "specification": {
+        "en": "Specification",
+        "me": "Specifikacija",
+        "ru": "Спецификация",
+        "ua": "Специфікація"
+      },
+      "total": {
+        "en": "Total",
+        "me": "Ukupno",
+        "ru": "Итого",
+        "ua": "Разом"
       }
     },
     "loading": {

+ 25 - 23
vite.config.ts

@@ -11,30 +11,32 @@ export default defineConfig(({ mode }) => {
   return {
     plugins: [
       vue(),
-      prerender({
-        staticDir: path.join(__dirname, outDir),
-        routes: ['/', '/en/', '/me/', '/ru/', '/ua/'],
-        renderer: new prerender.PuppeteerRenderer({
-          renderAfterDocumentEvent: 'render-event',
-          injectProperty: '__PRERENDER_INJECTED',
-          maxTimeout: 30000,
-          headless: true,
-          args: [
-            '--no-sandbox', 
-            '--disable-setuid-sandbox',
-            '--disable-dev-shm-usage',
-            '--disable-gpu',
-            '--single-process'
-          ],
-          consoleHandler: (route: string, message: any) => {
-            console.log(`[🔨 Prerender Console - ${route}] ${message.text()}`);
+      ...(mode === 'production' ? [
+        prerender({
+          staticDir: path.join(__dirname, outDir),
+          routes: ['/', '/en/', '/me/', '/ru/', '/ua/'],
+          renderer: new prerender.PuppeteerRenderer({
+            renderAfterDocumentEvent: 'render-event',
+            injectProperty: '__PRERENDER_INJECTED',
+            maxTimeout: 30000,
+            headless: true,
+            args: [
+              '--no-sandbox', 
+              '--disable-setuid-sandbox',
+              '--disable-dev-shm-usage',
+              '--disable-gpu',
+              '--single-process'
+            ],
+            consoleHandler: (route: string, message: any) => {
+              console.log(`[🔨 Prerender Console - ${route}] ${message.text()}`);
+            }
+          }),
+          postProcess(renderedRoute: any) {
+            console.log(`[🔨 Prerender] Finished: ${renderedRoute.route}`);
+            return renderedRoute;
           }
-        }),
-        postProcess(renderedRoute: any) {
-          console.log(`[🔨 Prerender] Finished: ${renderedRoute.route}`);
-          return renderedRoute;
-        }
-      })
+        })
+      ] : [])
   ],
   resolve: {
     alias: {