diff --git a/.drone.yml b/.drone.yml index fbcd108886..e03f687cef 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,15 +19,15 @@ steps: - name: frontend-tests image: node:20-alpine volumes: - - name: cache-node-frontend - path: /drone/src/openbas-front/node_modules + - name: cache-node-frontend + path: /drone/src/openbas-front/node_modules commands: - cd openbas-front - yarn install - yarn build - yarn check-ts - yarn lint - # - yarn i18n-checker + - yarn i18n-checker - NODE_OPTIONS=--max_old_space_size=8192 yarn test - name: app-e2e @@ -66,8 +66,8 @@ steps: - name: frontend-e2e-tests image: node:20.16.0 volumes: - - name: cache-node-frontend-e2e - path: /drone/src/openbas-front/node_modules + - name: cache-node-frontend-e2e + path: /drone/src/openbas-front/node_modules commands: - apt update - apt -y install netcat-traditional diff --git a/openbas-front/i18n-checker.js b/openbas-front/i18n-checker.js index 96bbd1e82d..b2e298e872 100644 --- a/openbas-front/i18n-checker.js +++ b/openbas-front/i18n-checker.js @@ -25,7 +25,7 @@ const checkLanguageSupport = (lang) => { const match = (filePath) => { try { const data = fs.readFileSync(filePath, { encoding: 'utf8' }); - const regexp = /t\('([\w\s]+)'\)/g; + const regexp = /(? { const regexWithQuote = `'${m[1]}':`; @@ -57,16 +57,22 @@ const checkLanguageSupport = (lang) => { const run = () => { const languages = ['fr', 'zh']; - const _missingKeys = {}; + const missingKeys = {}; languages.forEach((lang) => { const keys = checkLanguageSupport(lang); if (keys.length > 0) { - _missingKeys[lang] = keys; + missingKeys[lang] = keys; } }); - return _missingKeys; + if (Object.keys(missingKeys).length) { + // eslint-disable-next-line no-console + console.error('Missing keys :', missingKeys); + process.exit(1); + } else { + process.exit(0); + } }; -const _missingKeys = run(); +run(); diff --git a/openbas-front/src/utils/Localization.js b/openbas-front/src/utils/Localization.js index 1cc168054f..386fbac8f7 100644 --- a/openbas-front/src/utils/Localization.js +++ b/openbas-front/src/utils/Localization.js @@ -1332,6 +1332,14 @@ const i18n = { here: 'ici', 'This scenario has never run, schedule or run it now!': 'Ce scénario n\'a jamais été exécuté, planifiez-le ou exécutez-le maintenant !', 'Something went wrong. Please refresh the page or try again later.': 'Une erreur s\'est produite. Veuillez actualiser la page ou réessayer plus tard.', + 'Targeting Players only': 'Cibler uniquement les joueurs', + 'Test Details': 'Détails du test', + Tests: 'Tests', + Warning: 'Avertissement', + 'Launch simulation now': 'Lancer la simulation maintenant', + 'Launch now': 'Lancer maintenant', + 'All teams value': 'Valeur de toutes les équipes', + 'not starts with': 'ne commence pas par', }, zh: { 'Email address': 'email地址', @@ -2563,6 +2571,25 @@ const i18n = { here: '此处', 'This scenario has never run, schedule or run it now!': '此场景从未运行,立即安排或运行它吧!', 'Something went wrong. Please refresh the page or try again later.': '发生错误。请刷新页面或稍后再试。', + 'Unknown result': '未知结果', + 'Validation type': '验证类型', + 'Targeting Players only': '仅定位玩家', + 'This expectation is handled automatically by the platform and triggered when target reads the articles': '该预期由平台自动处理,并在目标阅读文章时触发', + 'This expectation is handled automatically by the platform and triggered when the target completes the challenges': '该预期由平台自动处理,并在目标完成挑战时触发', + 'An isolated player is considered as a group of one player': '一个孤立的玩家被视为一个人的小组', + 'its dedicated page': '其专用页面', + 'Only SMS and emails related injects will be tested': '仅测试与短信和电子邮件相关的注入', + 'Test Details': '测试详情', + 'Replay test': '重放测试', + 'Delete test': '删除测试', + 'Replay all the tests': '重放所有测试', + Tests: '测试', + Warning: '警告', + 'Launch simulation now': '立即启动模拟', + 'Launch now': '立即启动', + 'All teams value': '所有团队的值', + 'The score set for the team will also be applied to all players in the team': '为团队设置的分数也将应用于团队中的所有玩家', + Player: '玩家', }, en: { openbas_email: 'Email',