From dd3c80bd624faa20c0b97671186a8845c8a9082b Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 24 Mar 2025 09:26:51 +0100 Subject: [PATCH] Frontend: Reformat gettext.config.js with eslint Signed-off-by: Michael Mayer --- frontend/gettext.config.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/gettext.config.js b/frontend/gettext.config.js index 48a97710e..d4998f068 100644 --- a/frontend/gettext.config.js +++ b/frontend/gettext.config.js @@ -1,42 +1,42 @@ -const glob = require('glob'); -const fs = require('fs'); -const path = require('path'); +const glob = require("glob"); +const fs = require("fs"); +const path = require("path"); // Find all .po files in the frontend/src/locales -const poFiles = glob.sync('src/locales/*.po'); +const poFiles = glob.sync("src/locales/*.po"); if (poFiles.length === 0) { - console.error('No .po files found in src/locales'); + console.error("No .po files found in src/locales"); process.exit(1); } // Find output folder or create the new one in assets/static/locales -const outputDir = path.resolve(__dirname, '../assets/static/locales'); +const outputDir = path.resolve(__dirname, "../assets/static/locales"); if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir, { recursive: true }); } // Copy .po files from frontend/src/locales to assets/static/locales -poFiles.forEach(filePath => { +poFiles.forEach((filePath) => { const fileName = path.basename(filePath); const destinationPath = path.join(outputDir, fileName); fs.copyFileSync(filePath, destinationPath); }); // Find all languages codes from .po files (cut file names without .po) -const languageCodes = poFiles.map(filePath => { +const languageCodes = poFiles.map((filePath) => { const fileName = path.basename(filePath); - return fileName.replace('.po', ''); + return fileName.replace(".po", ""); }); // Transform files from .po to .json in the assets/static/locales module.exports = { input: { - path: path.resolve(__dirname, '../assets/static/locales'), - include: ['**/*.po'], + path: path.resolve(__dirname, "../assets/static/locales"), + include: ["**/*.po"], }, output: { - path: path.resolve(__dirname, '../assets/static/locales'), - jsonPath: '', + path: path.resolve(__dirname, "../assets/static/locales"), + jsonPath: "", locales: languageCodes, splitJson: true, },