From 536d79a4d51597b1ce56078d2dd45aca292cf46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=B0=D0=B1?= =?UTF-8?q?=D1=83=D1=88=D0=BA=D0=B8=D0=BD?= Date: Fri, 7 Mar 2025 11:46:14 +0100 Subject: [PATCH] add locales --- frontend/app/locales/en.json | 8 +++++++- frontend/app/locales/es.json | 8 +++++++- frontend/app/locales/fr.json | 8 +++++++- frontend/app/locales/ru.json | 8 +++++++- frontend/app/locales/zh.json | 8 +++++++- frontend/app/mstore/roleStore.ts | 21 +++++++++++---------- 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/frontend/app/locales/en.json b/frontend/app/locales/en.json index b30358d5a..6ade6ee4d 100644 --- a/frontend/app/locales/en.json +++ b/frontend/app/locales/en.json @@ -1437,5 +1437,11 @@ "Alert updated": "Alert updated", "Failed to create an alert": "Failed to create an alert", "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.": "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.", - "Alert based on": "Alert based on" + "Alert based on": "Alert based on", + "Session Replay": "Session Replay", + "Developer Tools": "Developer Tools", + "Dashboard": "Dashboard", + "Assist (Live)": "Assist (Live)", + "Assist (Call)": "Assist (Call)", + "Change Spot Visibility": "Change Spot Visibility" } diff --git a/frontend/app/locales/es.json b/frontend/app/locales/es.json index 8e5718603..f973d12a0 100644 --- a/frontend/app/locales/es.json +++ b/frontend/app/locales/es.json @@ -1437,5 +1437,11 @@ "Alert updated": "Alerta actualizada", "Failed to create an alert": "Error al crear la alerta", "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.": "Ej. Cuando el umbral supere 1ms en los últimos 15 minutos, notifícame a través de Slack #foss-notifications.", - "Alert based on": "Alerta basada en" + "Alert based on": "Alerta basada en", + "Session Replay": "Reproducción de sesión", + "Developer Tools": "Herramientas de desarrollador", + "Dashboard": "Panel de control", + "Assist (Live)": "Asistencia (En vivo)", + "Assist (Call)": "Asistencia (Llamada)", + "Change Spot Visibility": "Cambiar visibilidad de Spot" } diff --git a/frontend/app/locales/fr.json b/frontend/app/locales/fr.json index ab4530e2f..f1d5a293d 100644 --- a/frontend/app/locales/fr.json +++ b/frontend/app/locales/fr.json @@ -1437,5 +1437,11 @@ "Alert updated": "Alerte mise à jour", "Failed to create an alert": "Échec de la création de l'alerte", "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.": "Ex. Lorsque le seuil dépasse 1ms au cours des 15 dernières minutes, notifiez-moi via Slack #foss-notifications.", - "Alert based on": "Alerte basée sur" + "Alert based on": "Alerte basée sur", + "Session Replay": "Relecture de session", + "Developer Tools": "Outils développeur", + "Dashboard": "Tableau de bord", + "Assist (Live)": "Assistance (En direct)", + "Assist (Call)": "Assistance (Appel)", + "Change Spot Visibility": "Modifier la visibilité du Spot" } diff --git a/frontend/app/locales/ru.json b/frontend/app/locales/ru.json index 7d0ddba26..6b34a01d9 100644 --- a/frontend/app/locales/ru.json +++ b/frontend/app/locales/ru.json @@ -1437,5 +1437,11 @@ "Alert updated": "Уведомление обновлено", "Failed to create an alert": "Не удалось создать уведомление", "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.": "Например: если порог превышает 1 мс за последние 15 минут, уведомить меня через Slack #foss-notifications.", - "Alert based on": "Уведомление на основе" + "Alert based on": "Уведомление на основе", + "Session Replay": "Воспроизведение сессий", + "Developer Tools": "Инструменты разработчика", + "Dashboard": "Дашборд", + "Assist (Live)": "Assist (Live)", + "Assist (Call)": "Assist (Call)", + "Change Spot Visibility": "Изменить видимость Spot" } diff --git a/frontend/app/locales/zh.json b/frontend/app/locales/zh.json index a81c84447..99af0c239 100644 --- a/frontend/app/locales/zh.json +++ b/frontend/app/locales/zh.json @@ -1437,5 +1437,11 @@ "Alert updated": "警报已更新", "Failed to create an alert": "创建警报失败", "Eg. When Threshold is above 1ms over the past 15mins, notify me through Slack #foss-notifications.": "例如:当过去15分钟内阈值超过1毫秒时,通过Slack #foss-notifications通知我。", - "Alert based on": "警报依据" + "Alert based on": "警报依据", + "Session Replay": "会话回放", + "Developer Tools": "开发者工具", + "Dashboard": "仪表板", + "Assist (Live)": "Assist(实时协助)", + "Assist (Call)": "Assist(通话协助)", + "Change Spot Visibility": "更改 Spot 可见性" } diff --git a/frontend/app/mstore/roleStore.ts b/frontend/app/mstore/roleStore.ts index ff79560c6..c1ca7fa84 100644 --- a/frontend/app/mstore/roleStore.ts +++ b/frontend/app/mstore/roleStore.ts @@ -3,16 +3,17 @@ import { makeAutoObservable } from 'mobx'; import { userService } from 'App/services'; import Role from './types/role'; +import i18next, { TFunction } from 'i18next'; -const permissions = [ - { text: 'Session Replay', value: 'SESSION_REPLAY' }, - { text: 'Developer Tools', value: 'DEV_TOOLS' }, - { text: 'Dashboard', value: 'METRICS' }, - { text: 'Assist (Live)', value: 'ASSIST_LIVE' }, - { text: 'Assist (Call)', value: 'ASSIST_CALL' }, - { text: 'Feature Flags', value: 'FEATURE_FLAGS' }, - { text: 'Spots', value: 'SPOT' }, - { text: 'Change Spot Visibility', value: 'SPOT_PUBLIC' }, +const permissions = (t: TFunction) => [ + { text: t('Session Replay'), value: 'SESSION_REPLAY' }, + { text: t('Developer Tools'), value: 'DEV_TOOLS' }, + { text: t('Dashboard'), value: 'METRICS' }, + { text: t('Assist (Live)'), value: 'ASSIST_LIVE' }, + { text: t('Assist (Call)'), value: 'ASSIST_CALL' }, + { text: t('Feature Flags'), value: 'FEATURE_FLAGS' }, + { text: t('Spots'), value: 'SPOT' }, + { text: t('Change Spot Visibility'), value: 'SPOT_PUBLIC' }, ]; export default class UserStore { @@ -20,7 +21,7 @@ export default class UserStore { loading: boolean = false; - permissions = permissions; + permissions = permissions(i18next.t); instance = new Role();