diff --git a/x-pack/platform/plugins/private/translations/translations/de-DE.json b/x-pack/platform/plugins/private/translations/translations/de-DE.json index 4e5d60f7349db..b2a3efa80c3e2 100644 --- a/x-pack/platform/plugins/private/translations/translations/de-DE.json +++ b/x-pack/platform/plugins/private/translations/translations/de-DE.json @@ -37533,7 +37533,6 @@ "xpack.searchInferenceEndpoints.actions.deleteSingleEndpoint": "Endpoint löschen", "xpack.searchInferenceEndpoints.actions.viewEndpooint": "Endpoint anzeigen", "xpack.searchInferenceEndpoints.addConnectorButtonLabel": "Endpoint hinzufügen", - "xpack.searchInferenceEndpoints.addEndpoint.endpointCreationFailed": "Erstellen des Endpoints fehlgeschlagen", "xpack.searchInferenceEndpoints.addEndpointModal.cancelButton": "Abbrechen", "xpack.searchInferenceEndpoints.addEndpointModal.closeButton": "Schließen", "xpack.searchInferenceEndpoints.addEndpointModal.copyEndpointIdAriaLabel": "Endpoint-ID kopieren", @@ -37547,14 +37546,9 @@ "xpack.searchInferenceEndpoints.addEndpointModal.taskTypeLabel": "Aufgabentyp", "xpack.searchInferenceEndpoints.addEndpointModal.title": "Endpoint hinzufügen", "xpack.searchInferenceEndpoints.addEndpointModal.viewTitle": "Endpoint anzeigen", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.cancelBtnLabel": "Abbrechen", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.createEndpointTitle": "Inference-Endpoint erstellen", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.saveBtnLabel": "Speichern", "xpack.searchInferenceEndpoints.allInferenceEndpoints.description": "Inference-Endpoints vereinfachen die Bereitstellung und Verwaltung von Machine-Learning-Modellen in Elasticsearch. Richten Sie NLP-Aufgaben mithilfe einzigartiger Endpoints ein und verwalten Sie sie, um eine KI-gestützte Suche zu erstellen.", "xpack.searchInferenceEndpoints.allInferenceEndpoints.table.serviceColumn.serviceIcon.title": "{serviceName} Service-Logo", "xpack.searchInferenceEndpoints.apiDocumentationLink": "API-Dokumentation", - "xpack.searchInferenceEndpoints.breadcrumbs.inferenceEndpoints": "Inferenz-Endpoints", - "xpack.searchInferenceEndpoints.breadcrumbs.relevance": "Relevanz", "xpack.searchInferenceEndpoints.cancel": "Abbrechen", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.confirmQuestion": "Das Löschen eines derzeit genutzten Inferenz-Endpoints wird zu Fehlern bei Ingest- und Abfrageversuchen führen.", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.countUsage": "Es wurden {count} {count, plural, =1 {usage} other {Verwendungen}} gefunden", @@ -37568,7 +37562,6 @@ "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.title": "Inference-Endpoint löschen", "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "Der Endpoint wurde erfolgreich gelöscht.", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "Fehler beim Löschen des Endpoints", - "xpack.searchInferenceEndpoints.eisDocumentationLink": "Elastic Inference Service", "xpack.searchInferenceEndpoints.eisModelCard.supports": "Unterstützt {taskTypes}", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.ariaLabel": "Klicken Sie hier, um zu den Cloud-Nutzungsdetails zu gelangen", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.button": "Cloud-Nutzung anzeigen", @@ -37590,7 +37583,6 @@ "xpack.searchInferenceEndpoints.eisUtils.taskType.sparseEmbedding": "Sparse-Einbettung", "xpack.searchInferenceEndpoints.eisUtils.taskType.textEmbedding": "Texteinbettung", "xpack.searchInferenceEndpoints.elastic.description": "Wird auf GPUs ausgeführt (tokenbasierte Abrechnung)", - "xpack.searchInferenceEndpoints.elasticInferenceServiceTitle": "Elastic Inference", "xpack.searchInferenceEndpoints.elasticsearch.description": "Wird auf ML-Nodes ausgeführt (ressourcenbasierte Abrechnung)", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied": "Kopiert", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard": "Endpoint-ID in die Zwischenablage kopieren", @@ -37713,7 +37705,6 @@ "xpack.searchInferenceEndpoints.tableSearch.euiFieldSearch.searchEndpointsPlaceHolder": "Search", "xpack.searchInferenceEndpoints.taskType": "Typ", "xpack.searchInferenceEndpoints.taskType.ariaLabel": "Optionen für den Aufgabentyp", - "xpack.searchInferenceEndpoints.viewYourModels": "ML-trainierte Modelle", "xpack.searchNavigation.breadcrumbs.home.title": "Elasticsearch", "xpack.searchNavigation.classicNav.applicationsTitle": "Entwickeln", "xpack.searchNavigation.classicNav.gettingStartedTitle": "Erste Schritte", diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 3b9de4eb86222..064e8407a4d25 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -37462,7 +37462,6 @@ "xpack.searchInferenceEndpoints.actions.deleteSingleEndpoint": "Supprimer le point de terminaison", "xpack.searchInferenceEndpoints.actions.viewEndpooint": "Voir le point de terminaison", "xpack.searchInferenceEndpoints.addConnectorButtonLabel": "Ajouter un point de terminaison", - "xpack.searchInferenceEndpoints.addEndpoint.endpointCreationFailed": "La création du point de terminaison a échoué", "xpack.searchInferenceEndpoints.addEndpointModal.cancelButton": "Annuler", "xpack.searchInferenceEndpoints.addEndpointModal.closeButton": "Fermer", "xpack.searchInferenceEndpoints.addEndpointModal.copyEndpointIdAriaLabel": "Copier l'ID du point de terminaison", @@ -37476,14 +37475,9 @@ "xpack.searchInferenceEndpoints.addEndpointModal.taskTypeLabel": "Type de tâche", "xpack.searchInferenceEndpoints.addEndpointModal.title": "Ajouter un point de terminaison", "xpack.searchInferenceEndpoints.addEndpointModal.viewTitle": "Afficher le point de terminaison", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.cancelBtnLabel": "Annuler", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.createEndpointTitle": "Créer un point de terminaison d'inférence", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.saveBtnLabel": "Enregistrer", "xpack.searchInferenceEndpoints.allInferenceEndpoints.description": "Les points de terminaison d'inférence rationalisent le déploiement et la gestion des modèles d'apprentissage automatique dans Elasticsearch. Configurez et gérez des tâches NLP à l'aide de points de terminaison uniques afin de créer une recherche basée sur l'IA.", "xpack.searchInferenceEndpoints.allInferenceEndpoints.table.serviceColumn.serviceIcon.title": "Logo du service {serviceName}", "xpack.searchInferenceEndpoints.apiDocumentationLink": "Documentation sur les API", - "xpack.searchInferenceEndpoints.breadcrumbs.inferenceEndpoints": "Points de terminaison d'inférence", - "xpack.searchInferenceEndpoints.breadcrumbs.relevance": "Pertinence", "xpack.searchInferenceEndpoints.cancel": "Annuler", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.confirmQuestion": "La suppression d'un point de terminaison d'inférence actuellement utilisé entraînera des échecs au niveau des tentatives d'ingestion et de requête.", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.ignoreErrors": "Ignorer les erreurs et forcer la suppression", @@ -37496,7 +37490,6 @@ "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.title": "Supprimer le point de terminaison d'inférence", "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "Le point de terminaison d’inférence a été supprimé avec succès.", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "Échec de la suppression du point de terminaison", - "xpack.searchInferenceEndpoints.eisDocumentationLink": "Service d'inférence Elastic", "xpack.searchInferenceEndpoints.eisModelCard.supports": "Prend en charge {taskTypes}", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.ariaLabel": "Cliquez pour accéder aux détails d'utilisation du cloud", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.button": "Afficher l'utilisation du Cloud", @@ -37518,7 +37511,6 @@ "xpack.searchInferenceEndpoints.eisUtils.taskType.sparseEmbedding": "embeddings épars", "xpack.searchInferenceEndpoints.eisUtils.taskType.textEmbedding": "embeddings de texte", "xpack.searchInferenceEndpoints.elastic.description": "Fonctionne sur GPU (facturation par jetons)", - "xpack.searchInferenceEndpoints.elasticInferenceServiceTitle": "Elastic Inférence", "xpack.searchInferenceEndpoints.elasticsearch.description": "S'exécute sur des nœuds de ML (facturation en fonction des ressources)", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied": "Copié", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard": "Copier l’ID du point de terminaison dans le presse-papiers", @@ -37641,7 +37633,6 @@ "xpack.searchInferenceEndpoints.tableSearch.euiFieldSearch.searchEndpointsPlaceHolder": "Rechercher", "xpack.searchInferenceEndpoints.taskType": "Type", "xpack.searchInferenceEndpoints.taskType.ariaLabel": "Options de type de tâche", - "xpack.searchInferenceEndpoints.viewYourModels": "Modèles ML entraînés", "xpack.searchNavigation.breadcrumbs.home.title": "Elasticsearch", "xpack.searchNavigation.classicNav.applicationsTitle": "Développer", "xpack.searchNavigation.classicNav.gettingStartedTitle": "Commencer", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index bd06aa342546b..41a1f657c0b13 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -37655,7 +37655,6 @@ "xpack.searchInferenceEndpoints.actions.deleteSingleEndpoint": "エンドポイントを削除", "xpack.searchInferenceEndpoints.actions.viewEndpooint": "エンドポイントを表示", "xpack.searchInferenceEndpoints.addConnectorButtonLabel": "エンドポイントを追加", - "xpack.searchInferenceEndpoints.addEndpoint.endpointCreationFailed": "エンドポイントの作成が失敗しました", "xpack.searchInferenceEndpoints.addEndpointModal.cancelButton": "キャンセル", "xpack.searchInferenceEndpoints.addEndpointModal.closeButton": "閉じる", "xpack.searchInferenceEndpoints.addEndpointModal.copyEndpointIdAriaLabel": "エンドポイントIDをコピー", @@ -37669,14 +37668,9 @@ "xpack.searchInferenceEndpoints.addEndpointModal.taskTypeLabel": "タスクタイプ", "xpack.searchInferenceEndpoints.addEndpointModal.title": "エンドポイントを追加", "xpack.searchInferenceEndpoints.addEndpointModal.viewTitle": "エンドポイントを表示", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.cancelBtnLabel": "キャンセル", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.createEndpointTitle": "推論エンドポイントを作成", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.saveBtnLabel": "保存", "xpack.searchInferenceEndpoints.allInferenceEndpoints.description": "推論エンドポイントは、Elasticsearchにおける機械学習モデルのデプロイと管理を合理化します。独自のエンドポイントを使用してNLPタスクを設定および管理し、AIを活用した検索を構築します。", "xpack.searchInferenceEndpoints.allInferenceEndpoints.table.serviceColumn.serviceIcon.title": "{serviceName}サービスロゴ", "xpack.searchInferenceEndpoints.apiDocumentationLink": "APIドキュメント", - "xpack.searchInferenceEndpoints.breadcrumbs.inferenceEndpoints": "推論エンドポイント", - "xpack.searchInferenceEndpoints.breadcrumbs.relevance": "関連性", "xpack.searchInferenceEndpoints.cancel": "キャンセル", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.confirmQuestion": "現在使用中の推論エンドポイントを削除すると、インジェストとクエリの試行が失敗します。", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.countUsage": "{count} {count, plural, =1 {usage} other {件の使用}}が見つかりました", @@ -37690,7 +37684,6 @@ "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.title": "推論エンドポイントを削除", "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "推論エンドポイントは正常に削除されました。", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "エンドポイントの削除が失敗しました", - "xpack.searchInferenceEndpoints.eisDocumentationLink": "Elastic Inference Service", "xpack.searchInferenceEndpoints.eisModelCard.supports": "{taskTypes}をサポート", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.ariaLabel": "クリックしてクラウド使用状況の詳細を表示", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.button": "クラウド使用状況を表示", @@ -37712,7 +37705,6 @@ "xpack.searchInferenceEndpoints.eisUtils.taskType.sparseEmbedding": "低密度埋め込み", "xpack.searchInferenceEndpoints.eisUtils.taskType.textEmbedding": "テキスト埋め込み", "xpack.searchInferenceEndpoints.elastic.description": "GPUで実行(トークンベースの請求)", - "xpack.searchInferenceEndpoints.elasticInferenceServiceTitle": "Elastic Inference", "xpack.searchInferenceEndpoints.elasticsearch.description": "MLノードで実行(リソースベースの請求)", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied": "コピーしました", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard": "エンドポイントIDをクリップボードにコピー", @@ -37835,7 +37827,6 @@ "xpack.searchInferenceEndpoints.tableSearch.euiFieldSearch.searchEndpointsPlaceHolder": "検索", "xpack.searchInferenceEndpoints.taskType": "型", "xpack.searchInferenceEndpoints.taskType.ariaLabel": "タスクタイプオプション", - "xpack.searchInferenceEndpoints.viewYourModels": "ML学習済みモデル", "xpack.searchNavigation.breadcrumbs.home.title": "Elasticsearch", "xpack.searchNavigation.classicNav.applicationsTitle": "ビルド", "xpack.searchNavigation.classicNav.gettingStartedTitle": "開始する", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index df7f18511820c..8351ee61a237a 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -37659,7 +37659,6 @@ "xpack.searchInferenceEndpoints.actions.deleteSingleEndpoint": "删除终端", "xpack.searchInferenceEndpoints.actions.viewEndpooint": "查看终端", "xpack.searchInferenceEndpoints.addConnectorButtonLabel": "添加终端", - "xpack.searchInferenceEndpoints.addEndpoint.endpointCreationFailed": "终端创建失败", "xpack.searchInferenceEndpoints.addEndpointModal.cancelButton": "取消", "xpack.searchInferenceEndpoints.addEndpointModal.closeButton": "关闭", "xpack.searchInferenceEndpoints.addEndpointModal.copyEndpointIdAriaLabel": "复制终端 ID", @@ -37673,14 +37672,9 @@ "xpack.searchInferenceEndpoints.addEndpointModal.taskTypeLabel": "任务类型", "xpack.searchInferenceEndpoints.addEndpointModal.title": "添加终端", "xpack.searchInferenceEndpoints.addEndpointModal.viewTitle": "查看终端", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.cancelBtnLabel": "取消", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.createEndpointTitle": "创建推理终端", - "xpack.searchInferenceEndpoints.addInferenceEndpoint.saveBtnLabel": "保存", "xpack.searchInferenceEndpoints.allInferenceEndpoints.description": "推理终端简化了 Elasticsearch 中的 Machine Learning 模型部署和管理。使用唯一的终端来设置和管理 NLP 任务,以构建 AI 驱动式搜索。", "xpack.searchInferenceEndpoints.allInferenceEndpoints.table.serviceColumn.serviceIcon.title": "{serviceName} 服务徽标", "xpack.searchInferenceEndpoints.apiDocumentationLink": "API 文档", - "xpack.searchInferenceEndpoints.breadcrumbs.inferenceEndpoints": "推理终端", - "xpack.searchInferenceEndpoints.breadcrumbs.relevance": "相关性", "xpack.searchInferenceEndpoints.cancel": "取消", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.confirmQuestion": "删除当前处于使用状态的推理终端会导致采集和查询尝试失败。", "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.countUsage": "找到 {count} 个{count, plural, =1 {usage} other {用法}}", @@ -37694,7 +37688,6 @@ "xpack.searchInferenceEndpoints.confirmDeleteEndpoint.title": "删除推理终端", "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "推理终端已成功删除。", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "终端删除失败", - "xpack.searchInferenceEndpoints.eisDocumentationLink": "Elastic 推理服务", "xpack.searchInferenceEndpoints.eisModelCard.supports": "支持 {taskTypes}", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.ariaLabel": "点击查看云使用详情", "xpack.searchInferenceEndpoints.eisModelsPage.cloudUsage.button": "查看云使用情况", @@ -37716,7 +37709,6 @@ "xpack.searchInferenceEndpoints.eisUtils.taskType.sparseEmbedding": "稀疏嵌入", "xpack.searchInferenceEndpoints.eisUtils.taskType.textEmbedding": "文本嵌入", "xpack.searchInferenceEndpoints.elastic.description": "在GPU上运行(基于令牌的计费)", - "xpack.searchInferenceEndpoints.elasticInferenceServiceTitle": "Elastic 推理", "xpack.searchInferenceEndpoints.elasticsearch.description": "在 ML 节点上运行(基于资源的计费)", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied": "已复制", "xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard": "将终端 ID 复制到剪贴板。", @@ -37838,7 +37830,6 @@ "xpack.searchInferenceEndpoints.tableSearch.euiFieldSearch.searchEndpointsPlaceHolder": "搜索", "xpack.searchInferenceEndpoints.taskType": "类型", "xpack.searchInferenceEndpoints.taskType.ariaLabel": "任务类型选项", - "xpack.searchInferenceEndpoints.viewYourModels": "ML 已训练模型", "xpack.searchNavigation.breadcrumbs.home.title": "Elasticsearch", "xpack.searchNavigation.classicNav.applicationsTitle": "构建", "xpack.searchNavigation.classicNav.gettingStartedTitle": "入门", diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/common/constants.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/common/constants.ts index 46a4627c350c2..02dcab7237afe 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/common/constants.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/common/constants.ts @@ -5,44 +5,14 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; - export const PLUGIN_ID = 'searchInferenceEndpoints'; export const PLUGIN_NAME = 'Inference Endpoints'; export const INFERENCE_ENDPOINTS_APP_ID = 'inference_endpoints'; export const MODEL_SETTINGS_APP_ID = 'model_settings'; export const MANAGEMENT_APP_PATH = `/modelManagement/${MODEL_SETTINGS_APP_ID}`; -export const PLUGIN_TITLE = i18n.translate( - 'xpack.searchInferenceEndpoints.inferenceEndpointsTitle', - { - defaultMessage: 'Inference endpoints', - } -); - -export const EXTERNAL_INFERENCE_TITLE = i18n.translate( - 'xpack.searchInferenceEndpoints.externalInferenceTitle', - { - defaultMessage: 'External Inference', - } -); - -export const MODEL_SETTINGS_SECTION_TITLE = i18n.translate( - 'xpack.searchInferenceEndpoints.modelSettingsTitle', - { - defaultMessage: 'Feature Settings', - } -); - export const ELASTIC_INFERENCE_SERVICE_APP_ID = 'elastic_inference_service'; -export const ELASTIC_INFERENCE_SERVICE_TITLE = i18n.translate( - 'xpack.searchInferenceEndpoints.elasticInferenceServiceTitle', - { - defaultMessage: 'Elastic Inference', - } -); - export const INFERENCE_CONNECTORS_QUERY_KEY = 'inferenceConnectorsQueryKey'; export const INFERENCE_ENDPOINTS_QUERY_KEY = 'inferenceEndpointsQueryKey'; export const INFERENCE_FEATURES_QUERY_KEY = 'inferenceFeaturesQueryKey'; diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/add_inference_endpoints/translations.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/add_inference_endpoints/translations.ts deleted file mode 100644 index c86b429b67dd2..0000000000000 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/add_inference_endpoints/translations.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const SAVE = i18n.translate( - 'xpack.searchInferenceEndpoints.addInferenceEndpoint.saveBtnLabel', - { - defaultMessage: 'Save', - } -); - -export const CANCEL = i18n.translate( - 'xpack.searchInferenceEndpoints.addInferenceEndpoint.cancelBtnLabel', - { - defaultMessage: 'Cancel', - } -); - -export const CREATE_ENDPOINT_TITLE = i18n.translate( - 'xpack.searchInferenceEndpoints.addInferenceEndpoint.createEndpointTitle', - { - defaultMessage: 'Create inference endpoint', - } -); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/constants.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/constants.ts index f361f44a6629e..f28d2dcf4a22d 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/constants.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/constants.ts @@ -6,10 +6,7 @@ */ import { ServiceProviderKeys } from '@kbn/inference-endpoint-ui-common'; -import { - TOKEN_BASED_BILLING_DESCRIPTION, - RESOURCE_BASED_BILLING_DESCRIPTION, -} from '../../../common/translations'; +import { i18n } from '@kbn/i18n'; import type { FilterOptions } from '../../types'; export const DEFAULT_FILTER_OPTIONS: FilterOptions = { @@ -21,6 +18,12 @@ export const PIPELINE_URL = 'ingest/ingest_pipelines'; export const SERVERLESS_INDEX_MANAGEMENT_URL = 'index_details'; export const SERVICE_PROVIDER_DESCRIPTIONS: Record = { - [ServiceProviderKeys.elastic]: TOKEN_BASED_BILLING_DESCRIPTION, - [ServiceProviderKeys.elasticsearch]: RESOURCE_BASED_BILLING_DESCRIPTION, + [ServiceProviderKeys.elastic]: i18n.translate( + 'xpack.searchInferenceEndpoints.elastic.description', + { defaultMessage: 'Runs on GPUs (token-based billing)' } + ), + [ServiceProviderKeys.elasticsearch]: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.description', + { defaultMessage: 'Runs on ML Nodes (resource-based billing)' } + ), }; diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats.tsx index e74a981fb0d2f..61e7825e203b7 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats.tsx @@ -10,8 +10,8 @@ import { css } from '@emotion/react'; import type { UseEuiTheme } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiText, EuiTextColor } from '@elastic/eui'; import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; +import { i18n } from '@kbn/i18n'; import { getModelId } from '../../utils/get_model_id'; -import { MODELS_LABEL, ENDPOINTS_LABEL } from './endpoint_stats_translations'; interface EndpointStatsProps { endpoints: InferenceInferenceEndpointInfo[]; @@ -57,9 +57,17 @@ export const EndpointStats: React.FC = ({ endpoints }) => { }, [endpoints]); const statItems: StatItemProps[] = [ - { label: MODELS_LABEL, count: stats.modelsCount, testSubj: 'endpointStatsModelsCount' }, { - label: ENDPOINTS_LABEL, + label: i18n.translate('xpack.searchInferenceEndpoints.endpointStats.modelsLabel', { + defaultMessage: 'Models:', + }), + count: stats.modelsCount, + testSubj: 'endpointStatsModelsCount', + }, + { + label: i18n.translate('xpack.searchInferenceEndpoints.endpointStats.endpointsLabel', { + defaultMessage: 'Endpoints:', + }), count: stats.endpointsCount, testSubj: 'endpointStatsEndpointsCount', }, diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats_translations.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats_translations.ts deleted file mode 100644 index 1aa51a7438191..0000000000000 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoint_stats_translations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const MODELS_LABEL = i18n.translate( - 'xpack.searchInferenceEndpoints.endpointStats.modelsLabel', - { - defaultMessage: 'Models:', - } -); - -export const ENDPOINTS_LABEL = i18n.translate( - 'xpack.searchInferenceEndpoints.endpointStats.endpointsLabel', - { - defaultMessage: 'Endpoints:', - } -); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoints_table.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoints_table.tsx index 6eabf68eb975a..ee1c6f8adabce 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoints_table.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/endpoints_table.tsx @@ -7,10 +7,9 @@ import React from 'react'; import { type EuiBasicTableColumn, EuiInMemoryTable } from '@elastic/eui'; - +import { i18n } from '@kbn/i18n'; import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; -import { INFERENCE_ENDPOINTS_TABLE_CAPTION } from '../../../common/translations'; import { useFilteredInferenceEndpoints } from '../../hooks/use_filtered_endpoints'; import type { FilterOptions } from '../../types'; import { EndpointStats } from './endpoint_stats'; @@ -48,7 +47,9 @@ export const EndpointsTable = ({ }, }} data-test-subj="inferenceEndpointTable" - tableCaption={INFERENCE_ENDPOINTS_TABLE_CAPTION} + tableCaption={i18n.translate('xpack.searchInferenceEndpoints.table.caption', { + defaultMessage: 'Inference endpoints table', + })} /> ); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/service_provider_filter.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/service_provider_filter.tsx index b7a577dfe36fd..ff5c98ac9f73a 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/service_provider_filter.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/service_provider_filter.tsx @@ -7,12 +7,12 @@ import React, { useMemo } from 'react'; import { EuiFilterGroup } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import type { ServiceProviderKeys } from '@kbn/inference-endpoint-ui-common'; import { SERVICE_PROVIDERS } from '@kbn/inference-endpoint-ui-common'; import type { FilterOptions } from '../../../types'; import type { MultiSelectFilterOption } from '../../filter/multi_select_filter'; import { MultiSelectFilter } from '../../filter/multi_select_filter'; -import * as i18n from './translations'; interface Props { optionKeys: ServiceProviderKeys[]; @@ -44,8 +44,12 @@ export const ServiceProviderFilter: React.FC = ({ return ( option.label} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/task_type_filter.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/task_type_filter.tsx index e109388447771..32b69aa1fcf2c 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/task_type_filter.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/task_type_filter.tsx @@ -8,10 +8,10 @@ import React, { useMemo } from 'react'; import { EuiFilterGroup } from '@elastic/eui'; import type { InferenceTaskType } from '@elastic/elasticsearch/lib/api/types'; +import { i18n } from '@kbn/i18n'; import type { FilterOptions } from '../../../types'; import type { MultiSelectFilterOption } from '../../filter/multi_select_filter'; import { MultiSelectFilter } from '../../filter/multi_select_filter'; -import * as i18n from './translations'; interface Props { optionKeys: InferenceTaskType[]; @@ -39,8 +39,12 @@ export const TaskTypeFilter: React.FC = ({ optionKeys, onChange, uniqueTa return ( option.label} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/translations.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/translations.ts deleted file mode 100644 index 9c2cfb8aa9957..0000000000000 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/filter/translations.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { - SERVICE_PROVIDER, - TASK_TYPE, - SERVICE_PROVIDER_ARIA_LABEL, - TASK_TYPE_ARIA_LABEL, -} from '../../../../common/translations'; diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/group_by_select.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/group_by_select.tsx index c1f5616cd9219..ccaa1db1174c0 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/group_by_select.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/group_by_select.tsx @@ -14,14 +14,8 @@ import { EuiText, type EuiSelectableOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; -import { - EMPTY_FILTER_MESSAGE, - GROUP_BY_NONE, - GROUP_BY_MODELS, - GROUP_BY_SERVICE, -} from '../../../common/translations'; import { GroupByOptions } from '../../types'; import { GroupByFilterButton, GroupBySelectableContainer } from './styles'; @@ -33,15 +27,21 @@ interface GroupBySelectProps { const GROUP_BY_OPTIONS = [ { key: GroupByOptions.None, - label: GROUP_BY_NONE, + label: i18n.translate('xpack.searchInferenceEndpoints.groupBy.options.none.label', { + defaultMessage: 'None', + }), }, { key: GroupByOptions.Model, - label: GROUP_BY_MODELS, + label: i18n.translate('xpack.searchInferenceEndpoints.groupBy.options.models.label', { + defaultMessage: 'Model Author', + }), }, { key: GroupByOptions.Service, - label: GROUP_BY_SERVICE, + label: i18n.translate('xpack.searchInferenceEndpoints.groupBy.options.service.label', { + defaultMessage: 'Service', + }), }, ]; @@ -95,11 +95,10 @@ export const GroupBySelect = ({ value, onChange }: GroupBySelectProps) => { isSelected={isPopoverOpen} > - + {i18n.translate('xpack.searchInferenceEndpoints.groupBy.label', { + defaultMessage: 'Group: {selectedGroup}', + values: { selectedGroup: selectedOptionLabel }, + })} } @@ -111,7 +110,9 @@ export const GroupBySelect = ({ value, onChange }: GroupBySelectProps) => { ( diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/grouped_endpoints/grouped_endpoints_tables.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/grouped_endpoints/grouped_endpoints_tables.tsx index 43e5d3d52eecb..f65763620a4e5 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/grouped_endpoints/grouped_endpoints_tables.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/grouped_endpoints/grouped_endpoints_tables.tsx @@ -19,8 +19,8 @@ import { type EuiTableComputedColumnType, } from '@elastic/eui'; -import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import { i18n } from '@kbn/i18n'; +import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import { isGroupOpen, useGroupsAccordionToggleState, @@ -162,10 +162,7 @@ export const GroupedEndpointsTables = ({ 'xpack.searchInferenceEndpoints.groupedEndpoints.tableCaption', { defaultMessage: 'Inference endpoints list grouped by {groupBy}: {groupId}', - values: { - groupBy, - groupId: groupedData.groupId, - }, + values: { groupBy, groupId: groupedData.groupId }, } )} /> diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/list_usage_results.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/list_usage_results.tsx index 589842407f882..12156d1cf19de 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/list_usage_results.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/list_usage_results.tsx @@ -7,9 +7,9 @@ import React, { useState } from 'react'; import { EuiFieldSearch, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import type { InferenceUsageInfo } from '../../../../types'; -import * as i18n from '../delete/confirm_delete_endpoint/translations'; import { IndexItem } from './index_item'; import { PipelineItem } from './pipeline_item'; @@ -24,11 +24,17 @@ export const ListUsageResults: React.FC = ({ list }) => { setTerm(e.target.value)} isClearable={true} - aria-label={i18n.SEARCH_ARIA_LABEL} + aria-label={i18n.translate( + 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.searchARIALabel', + { defaultMessage: 'Search indices and pipelines' } + )} fullWidth={true} data-test-subj="usageFieldSearch" /> diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/scan_usage_results.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/scan_usage_results.tsx index 9cc9da74f427f..e2f21d36a9243 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/scan_usage_results.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/component/scan_usage_results.tsx @@ -16,11 +16,11 @@ import { useEuiTheme, } from '@elastic/eui'; import React from 'react'; +import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import type { InferenceUsageInfo } from '../../../../types'; import { useKibana } from '../../../../../../hooks/use_kibana'; import { RenderMessageWithIcon } from './render_message_with_icon'; -import * as i18n from '../delete/confirm_delete_endpoint/translations'; import { ListUsageResults } from './list_usage_results'; interface ScanUsageResultsProps { @@ -52,7 +52,10 @@ export const ScanUsageResults: React.FC = ({ @@ -68,7 +71,16 @@ export const ScanUsageResults: React.FC = ({ font-weight: ${euiTheme.font.weight.bold}; `} > -

{i18n.COUNT_USAGE_LABEL(list.length)}

+

+ {i18n.translate( + 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.countUsage', + { + defaultMessage: + 'Found {count} {count, plural, =1 {usage} other {usages}}', + values: { count: list.length }, + } + )} +

@@ -79,10 +91,18 @@ export const ScanUsageResults: React.FC = ({ iconSize="s" flush="both" color="text" - aria-label={i18n.OPEN_INDEX_MANAGEMENT} + aria-label={i18n.translate( + 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.openIndexManagement', + { defaultMessage: 'Open Index Management' } + )} data-test-subj="inferenceManagementOpenIndexManagement" > - {i18n.OPEN_INDEX_MANAGEMENT} + + {i18n.translate( + 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.openIndexManagement', + { defaultMessage: 'Open Index Management' } + )} +
@@ -101,7 +121,10 @@ export const ScanUsageResults: React.FC = ({ onIgnoreWarningCheckboxChange(e.target.checked)} /> diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.test.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.test.tsx index 938fa0bde5430..1f572db58b7db 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.test.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.test.tsx @@ -9,7 +9,6 @@ import { render, fireEvent, screen } from '@testing-library/react'; import { QueryClientProvider, QueryClient } from '@kbn/react-query'; import React from 'react'; import { ConfirmDeleteEndpointModal } from '.'; -import * as i18n from './translations'; import { useScanUsage } from '../../../../../../../hooks/use_scan_usage'; import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; @@ -60,17 +59,21 @@ describe('ConfirmDeleteEndpointModal', () => { it('renders the modal with correct elements', () => { render(); - expect(screen.getByText(i18n.DELETE_TITLE)).toBeInTheDocument(); - expect(screen.getByText(i18n.CONFIRM_DELETE_WARNING)).toBeInTheDocument(); - expect(screen.getByText(i18n.CANCEL)).toBeInTheDocument(); - expect(screen.getByText(i18n.DELETE_ACTION_LABEL)).toBeInTheDocument(); + expect(screen.getByText('Delete inference endpoint')).toBeInTheDocument(); + expect( + screen.getByText( + 'Deleting an inference endpoint currently in use will cause failures in ingest and query attempts.' + ) + ).toBeInTheDocument(); + expect(screen.getByText('Cancel')).toBeInTheDocument(); + expect(screen.getByText('Delete endpoint')).toBeInTheDocument(); expect(screen.getByText('my-hugging-face')).toBeInTheDocument(); }); it('calls onCancel when the cancel button is clicked', () => { render(); - fireEvent.click(screen.getByText(i18n.CANCEL)); + fireEvent.click(screen.getByText('Cancel')); expect(mockOnCancel).toHaveBeenCalled(); }); @@ -91,7 +94,7 @@ describe('ConfirmDeleteEndpointModal', () => { it('renders warning message', () => { render(); - expect(screen.getByText(i18n.POTENTIAL_FAILURE_LABEL)).toBeInTheDocument(); + expect(screen.getByText('Potential Failures')).toBeInTheDocument(); }); it('selecting checkbox enables Delete Endpoint button', () => { @@ -114,7 +117,7 @@ describe('ConfirmDeleteEndpointModal', () => { render(); }); it('renders no usage message', () => { - expect(screen.getByText(i18n.NO_USAGE_FOUND_LABEL)).toBeInTheDocument(); + expect(screen.getByText('No Usage Found')).toBeInTheDocument(); }); it('enables delete endpoint button', () => { @@ -122,7 +125,7 @@ describe('ConfirmDeleteEndpointModal', () => { }); it('calls onConfirm when the delete button is clicked', () => { - fireEvent.click(screen.getByText(i18n.DELETE_ACTION_LABEL)); + fireEvent.click(screen.getByText('Delete endpoint')); expect(mockOnConfirm).toHaveBeenCalled(); }); }); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.tsx index 145a2c1a6f52b..9cb30c613b9cc 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/confirm_delete_endpoint/index.tsx @@ -15,10 +15,10 @@ import { useGeneratedHtmlId, } from '@elastic/eui'; import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; import { euiThemeVars } from '@kbn/ui-theme'; import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; -import * as i18n from './translations'; import { useScanUsage } from '../../../../../../../hooks/use_scan_usage'; import type { InferenceUsageInfo } from '../../../../../types'; import { RenderMessageWithIcon } from '../../component/render_message_with_icon'; @@ -80,17 +80,29 @@ export const ConfirmDeleteEndpointModal: React.FC - {i18n.CONFIRM_DELETE_WARNING} + + {i18n.translate('xpack.searchInferenceEndpoints.confirmDeleteEndpoint.confirmQuestion', { + defaultMessage: + 'Deleting an inference endpoint currently in use will cause failures in ingest and query attempts.', + })} + {}} isLoading > - {i18n.SCANNING_USAGE_LABEL}… + {i18n.translate( + 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.scanningMessage', + { defaultMessage: 'Scanning for usage' } + )} + … ) : listOfUsages.length === 0 ? ( ) : ( - i18n.translate('xpack.searchInferenceEndpoints.confirmDeleteEndpoint.countUsage', { - defaultMessage: 'Found {count} {count, plural, =1 {usage} other {usages}}', - values: { count }, - }); - -export const SEARCH_LABEL = i18n.translate( - 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.searchLabel', - { - defaultMessage: 'Search', - } -); - -export const SEARCH_ARIA_LABEL = i18n.translate( - 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.searchARIALabel', - { - defaultMessage: 'Search indices and pipelines', - } -); - -export const OPEN_INDEX_MANAGEMENT = i18n.translate( - 'xpack.searchInferenceEndpoints.confirmDeleteEndpoint.openIndexManagement', - { - defaultMessage: 'Open Index Management', - } -); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx index b782f1a7b5f98..5ccaadeac2898 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx @@ -17,12 +17,48 @@ import { type UseEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; import React, { useState, useCallback, useEffect, useRef } from 'react'; -import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; +import type { + InferenceInferenceEndpointInfo, + InferenceTaskType, +} from '@elastic/elasticsearch/lib/api/types'; import { isEndpointPreconfigured } from '../../../../utils/preconfigured_endpoint_helper'; -import * as i18n from './translations'; import { isProviderTechPreview } from '../../../../utils/reranker_helper'; +export const TASK_TYPE_TOOLTIPS: Partial> = { + text_embedding: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.textEmbedding', + { + defaultMessage: 'Converts text into dense vector representations for semantic search', + } + ), + sparse_embedding: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.sparseEmbedding', + { + defaultMessage: 'Converts text into sparse vector representations for semantic search', + } + ), + rerank: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.rerank', + { + defaultMessage: 'Re-ranks search results by relevance', + } + ), + completion: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.completion', + { + defaultMessage: 'Generates text completions from a given input', + } + ), + chat_completion: i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.chatCompletion', + { + defaultMessage: 'Generates conversational responses from a chat input', + } + ), +}; + const COPIED_ICON_DISPLAY_DURATION_MS = 1000; const containerStyles = css` @@ -82,7 +118,13 @@ export const EndpointInfo: React.FC = ({ inferenceId, endpoin {inferenceId} - + {(copy) => ( = ({ inferenceId, endpoin ? 'inference-endpoint-copy-id-button-copied' : 'inference-endpoint-copy-id-button' } - aria-label={isCopied ? i18n.COPY_ID_COPIED : i18n.COPY_ID_TO_CLIPBOARD} + aria-label={ + isCopied + ? i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied', + { defaultMessage: 'Copied' } + ) + : i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard', + { defaultMessage: 'Copy endpoint ID to clipboard' } + ) + } /> )} @@ -105,7 +157,7 @@ export const EndpointInfo: React.FC = ({ inferenceId, endpoin {taskType != null && ( - + = ({ inferenceId, endpoin )} {isPreconfigured && ( - + - {i18n.PRECONFIGURED_LABEL} + {i18n.translate( + 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.preconfigured', + { defaultMessage: 'PRECONFIGURED' } + )} )} {isTechPreview && ( > = { - text_embedding: i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.textEmbedding', - { - defaultMessage: 'Converts text into dense vector representations for semantic search', - } - ), - sparse_embedding: i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.sparseEmbedding', - { - defaultMessage: 'Converts text into sparse vector representations for semantic search', - } - ), - rerank: i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.rerank', - { - defaultMessage: 'Re-ranks search results by relevance', - } - ), - completion: i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.completion', - { - defaultMessage: 'Generates text completions from a given input', - } - ), - chat_completion: i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.taskTypeTooltip.chatCompletion', - { - defaultMessage: 'Generates conversational responses from a chat input', - } - ), -}; - -export const COPY_ID_TO_CLIPBOARD = i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdToClipboard', - { - defaultMessage: 'Copy endpoint ID to clipboard', - } -); - -export const COPY_ID_COPIED = i18n.translate( - 'xpack.searchInferenceEndpoints.elasticsearch.endpointInfo.copyIdCopied', - { - defaultMessage: 'Copied', - } -); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/model.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/model.tsx index 0a65be1772f6c..f5f234978c97c 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/model.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/model.tsx @@ -8,10 +8,10 @@ import React from 'react'; import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; import { EuiBadge, EuiText } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { ELASTIC_MODEL_DEFINITIONS } from '@kbn/ml-trained-models-utils'; import { getModelId } from '../../../../utils/get_model_id'; -import * as i18n from './translations'; interface ModelProps { endpointInfo: InferenceInferenceEndpointInfo; @@ -39,7 +39,9 @@ export const Model: React.FC = ({ endpointInfo }) => { target="_blank" data-test-subj="mit-license-badge" > - {i18n.MIT_LICENSE} + {i18n.translate('xpack.searchInferenceEndpoints.model.mitLicense', { + defaultMessage: 'License: MIT', + })} )} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/translations.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/translations.ts deleted file mode 100644 index e812cade0f47a..0000000000000 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_model/translations.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const MIT_LICENSE = i18n.translate('xpack.searchInferenceEndpoints.model.mitLicense', { - defaultMessage: 'License: MIT', -}); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx index e49465c00f351..65bb13ef81aa8 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx @@ -10,6 +10,7 @@ import { css } from '@emotion/react'; import type { EuiBasicTableColumn, UseEuiTheme } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import type { InferenceInferenceEndpointInfo, @@ -17,15 +18,6 @@ import type { } from '@elastic/elasticsearch/lib/api/types'; import type { ServiceProviderKeys } from '@kbn/inference-endpoint-ui-common'; -import { - ENDPOINT, - ENDPOINT_COPY_ID_ACTION_LABEL, - ENDPOINT_DELETE_ACTION_LABEL, - ENDPOINT_VIEW_ACTION_LABEL, - MODEL, - SERVICE_PROVIDER, -} from '../../../common/translations'; - import { useEndpointActions } from '../../hooks/use_endpoint_actions'; import { type FilterOptions, GroupByOptions } from '../../types'; import { getModelId } from '../../utils/get_model_id'; @@ -116,7 +108,9 @@ export const TabularPage: React.FC = ({ { id: 'inference_id-column', field: 'inference_id', - name: ENDPOINT, + name: i18n.translate('xpack.searchInferenceEndpoints.endpoint', { + defaultMessage: 'Endpoint', + }), 'data-test-subj': 'endpointCell', render: ( @@ -134,7 +128,7 @@ export const TabularPage: React.FC = ({ }, { id: 'model-column', - name: MODEL, + name: i18n.translate('xpack.searchInferenceEndpoints.model', { defaultMessage: 'Model' }), 'data-test-subj': 'modelCell', render: (endpointInfo: InferenceInferenceEndpointInfo) => { return ; @@ -145,7 +139,9 @@ export const TabularPage: React.FC = ({ { id: 'service-column', field: 'service', - name: SERVICE_PROVIDER, + name: i18n.translate('xpack.searchInferenceEndpoints.serviceProvider', { + defaultMessage: 'Service', + }), 'data-test-subj': 'providerCell', render: (service: ServiceProviderKeys, endpointInfo: InferenceInferenceEndpointInfo) => { if (service) { @@ -160,24 +156,36 @@ export const TabularPage: React.FC = ({ { actions: [ { - name: ENDPOINT_VIEW_ACTION_LABEL, - description: ENDPOINT_VIEW_ACTION_LABEL, + name: i18n.translate('xpack.searchInferenceEndpoints.actions.viewEndpooint', { + defaultMessage: 'View endpoint', + }), + description: i18n.translate('xpack.searchInferenceEndpoints.actions.viewEndpooint', { + defaultMessage: 'View endpoint', + }), icon: 'eye', type: 'icon', onClick: (item) => displayInferenceFlyout(item), 'data-test-subj': 'inference-endpoints-action-view-endpoint-label', }, { - name: ENDPOINT_COPY_ID_ACTION_LABEL, - description: ENDPOINT_COPY_ID_ACTION_LABEL, + name: i18n.translate('xpack.searchInferenceEndpoints.actions.copyID', { + defaultMessage: 'Copy endpoint ID', + }), + description: i18n.translate('xpack.searchInferenceEndpoints.actions.copyID', { + defaultMessage: 'Copy endpoint ID', + }), icon: 'copy', type: 'icon', onClick: (item) => copyContent(item.inference_id), 'data-test-subj': 'inference-endpoints-action-copy-id-label', }, { - name: ENDPOINT_DELETE_ACTION_LABEL, - description: ENDPOINT_DELETE_ACTION_LABEL, + name: i18n.translate('xpack.searchInferenceEndpoints.actions.deleteEndpoint', { + defaultMessage: 'Delete endpoint', + }), + description: i18n.translate('xpack.searchInferenceEndpoints.actions.deleteEndpoint', { + defaultMessage: 'Delete endpoint', + }), icon: 'trash', type: 'icon', enabled: (item) => !isEndpointPreconfigured(item.inference_id), diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_empty_prompt.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_empty_prompt.tsx index 5c0ddd040e241..e34117cbbbd45 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_empty_prompt.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_empty_prompt.tsx @@ -7,14 +7,9 @@ import React from 'react'; import { EuiButton, EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; -import { - ADD_ENDPOINT_LABEL, - EXTERNAL_INFERENCE_EMPTY_TITLE, - EXTERNAL_INFERENCE_EMPTY_DESCRIPTION, - VIEW_DOCUMENTATION_LINK, -} from '../../common/translations'; import { docLinks } from '../../common/doc_links'; interface ExternalInferenceEmptyPromptProps { @@ -28,11 +23,26 @@ export const ExternalInferenceEmptyPrompt: React.FC{EXTERNAL_INFERENCE_EMPTY_TITLE}} - body={

{EXTERNAL_INFERENCE_EMPTY_DESCRIPTION}

} + title={ +

+ {i18n.translate('xpack.searchInferenceEndpoints.externalInference.emptyTitle', { + defaultMessage: 'Connect to external model providers', + })} +

+ } + body={ +

+ {i18n.translate('xpack.searchInferenceEndpoints.externalInference.emptyDescription', { + defaultMessage: + 'Add model endpoints from your favorite model providers to use them for AI-powered search.', + })} +

+ } actions={ - {ADD_ENDPOINT_LABEL} + {i18n.translate('xpack.searchInferenceEndpoints.addConnectorButtonLabel', { + defaultMessage: 'Add endpoint', + })} } footer={ @@ -42,7 +52,9 @@ export const ExternalInferenceEmptyPrompt: React.FC - {VIEW_DOCUMENTATION_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.providerInference.viewDocumentation', { + defaultMessage: 'View documentation', + })} } /> diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_header.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_header.tsx index 2e6c66a1fcea4..0b4e67f364ebe 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_header.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/external_inference_header.tsx @@ -6,9 +6,8 @@ */ import { EuiPageTemplate, EuiButton, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import React from 'react'; -import * as i18n from '../../common/translations'; -import { EXTERNAL_INFERENCE_TITLE } from '../../common/constants'; import { docLinks } from '../../common/doc_links'; interface ExternalInferenceHeaderProps { @@ -21,8 +20,16 @@ export const ExternalInferenceHeader: React.FC = ( return ( @@ -33,7 +40,9 @@ export const ExternalInferenceHeader: React.FC = ( href={docLinks.createInferenceEndpoint} external > - {i18n.API_DOCUMENTATION_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.apiDocumentationLink', { + defaultMessage: 'API Documentation', + })}
@@ -43,7 +52,9 @@ export const ExternalInferenceHeader: React.FC = ( data-test-subj="add-inference-endpoint-header-button" onClick={onFlyoutOpen} > - {i18n.ADD_ENDPOINT_LABEL} + {i18n.translate('xpack.searchInferenceEndpoints.addConnectorButtonLabel', { + defaultMessage: 'Add endpoint', + })}
, diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/filter/multi_select_filter.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/filter/multi_select_filter.tsx index d24dd744f6e6e..1b7ab7d29c29a 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/filter/multi_select_filter.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/filter/multi_select_filter.tsx @@ -15,10 +15,9 @@ import { EuiTextColor, useEuiTheme, } from '@elastic/eui'; -import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; import _ from 'lodash'; -import { EMPTY_FILTER_MESSAGE } from '../../../common/translations'; import { optionCountStyles } from './styles'; export interface MultiSelectFilterOption { @@ -89,7 +88,9 @@ export const MultiSelectFilter: React.FC = ({ searchProps={{ placeholder: buttonLabel, }} - emptyMessage={EMPTY_FILTER_MESSAGE} + emptyMessage={i18n.translate('xpack.searchInferenceEndpoints.filter.emptyMessage', { + defaultMessage: 'No options', + })} onChange={onChange} singleSelection={false} renderOption={renderOption} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/inference_endpoints_header.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/inference_endpoints_header.tsx index 167ff530d6d03..b91164c6cc476 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/inference_endpoints_header.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/inference_endpoints_header.tsx @@ -7,8 +7,7 @@ import { EuiPageTemplate, EuiButton, EuiLink } from '@elastic/eui'; import React from 'react'; -import * as i18n from '../../common/translations'; -import { PLUGIN_TITLE } from '../../common/constants'; +import { i18n } from '@kbn/i18n'; import { docLinks } from '../../common/doc_links'; import { useKibana } from '../hooks/use_kibana'; @@ -25,8 +24,16 @@ export const InferenceEndpointsHeader: React.FC = return ( = data-test-subj="add-inference-endpoint-header-button" onClick={onFlyoutOpen} > - {i18n.ADD_ENDPOINT_LABEL} + {i18n.translate('xpack.searchInferenceEndpoints.addConnectorButtonLabel', { + defaultMessage: 'Add endpoint', + })} , - {i18n.API_DOCUMENTATION_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.apiDocumentationLink', { + defaultMessage: 'API Documentation', + })} , application.navigateToApp('ml', { path: 'trained_models' })} data-test-subj="view-your-models" > - {i18n.VIEW_YOUR_MODELS_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.viewYourModels', { + defaultMessage: 'ML Trained Models', + })} , - {i18n.EIS_DOCUMENTATION_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.eisDocumentationLink', { + defaultMessage: 'Elastic Inference Service', + })} , ]} /> diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/model_detail_flyout/model_detail_flyout.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/model_detail_flyout/model_detail_flyout.tsx index 39dff6f521b84..7a0b407164be5 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/model_detail_flyout/model_detail_flyout.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/model_detail_flyout/model_detail_flyout.tsx @@ -31,7 +31,7 @@ import { isInferenceEndpointWithDisplayNameMetadata, isInferenceEndpointWithDisplayCreatorMetadata, } from '../../../common/type_guards'; -import { TASK_TYPE_TOOLTIPS } from '../all_inference_endpoints/render_table_columns/render_endpoint/translations'; +import { TASK_TYPE_TOOLTIPS } from '../all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info'; import { getModelId } from '../../utils/get_model_id'; import { AddEndpointModal } from './add_endpoint_modal'; import { ModelEndpointRow } from './model_endpoint_row'; diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/add_model_popover.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/add_model_popover.tsx index f5e603c34e1c7..a20e9dd82aa03 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/add_model_popover.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/add_model_popover.tsx @@ -9,11 +9,9 @@ import React, { useCallback, useMemo, useState } from 'react'; import { css } from '@emotion/react'; import { EuiButtonEmpty, EuiIcon, EuiPopover, EuiSelectable } from '@elastic/eui'; import type { EuiSelectableOption } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useConnectors } from '../../hooks/use_connectors'; import { getConnectorIcon } from '../../utils/connector_display'; - interface AddModelPopoverProps { existingEndpointIds: string[]; onAdd: (endpointId: string) => void; @@ -69,10 +67,9 @@ export const AddModelPopover: React.FC = ({ data-test-subj="add-model-button" color="text" > - + {i18n.translate('xpack.searchInferenceEndpoints.settings.addModel', { + defaultMessage: 'Add a model', + })} } isOpen={isOpen} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/default_model_section.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/default_model_section.tsx index f12dc265d854a..04eb81b732b30 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/default_model_section.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/default_model_section.tsx @@ -18,9 +18,9 @@ import { EuiTitle, } from '@elastic/eui'; import React, { useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; import type { InferenceConnector } from '@kbn/inference-common'; import { NO_DEFAULT_MODEL } from '../../../common/constants'; -import * as i18n from '../../../common/translations'; import { useConnectors } from '../../hooks/use_connectors'; import { useConnectorExists } from '../../hooks/use_connector_exists'; import type { UseDefaultModelSettingsReturn } from '../../hooks/use_default_model_settings'; @@ -30,7 +30,9 @@ interface Props { } const NoDefaultOption: EuiComboBoxOptionOption = { - label: i18n.DEFAULT_MODEL_NO_DEFAULT_OPTION, + label: i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.noDefault', { + defaultMessage: 'No default model', + }), value: NO_DEFAULT_MODEL, }; @@ -48,12 +50,19 @@ const getOptions = (connectors?: InferenceConnector[]): EuiComboBoxOptionOption< return [ NoDefaultOption, { - label: i18n.DEFAULT_MODEL_PRECONFIGURED_GROUP, + label: i18n.translate( + 'xpack.searchInferenceEndpoints.settings.defaultModel.preconfiguredGroup', + { + defaultMessage: 'Pre-configured', + } + ), value: 'preconfigured', options: preconfigured, }, { - label: i18n.DEFAULT_MODEL_CUSTOM_GROUP, + label: i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.customGroup', { + defaultMessage: 'Custom connectors', + }), value: 'custom', options: custom, }, @@ -90,10 +99,25 @@ export const DefaultModelSection: React.FC = ({ defaultModelSettings }) = const validationErrors = useMemo(() => { const errors: string[] = []; if (!connectorExists && !connectorExistsLoading && state.defaultModelId !== NO_DEFAULT_MODEL) { - errors.push(i18n.DEFAULT_MODEL_CONNECTOR_NOT_EXIST_ERROR); + errors.push( + i18n.translate( + 'xpack.searchInferenceEndpoints.settings.defaultModel.error.connectorNotExist', + { + defaultMessage: + 'The model previously selected is not available. Please select a different option.', + } + ) + ); } if (state.disallowOtherModels && state.defaultModelId === NO_DEFAULT_MODEL) { - errors.push(i18n.DEFAULT_MODEL_DISALLOW_NO_DEFAULT_ERROR); + errors.push( + i18n.translate( + 'xpack.searchInferenceEndpoints.settings.defaultModel.error.disallowNoDefault', + { + defaultMessage: 'When disallowing all other models, a default model must be selected.', + } + ) + ); } return errors; }, [connectorExists, connectorExistsLoading, state.defaultModelId, state.disallowOtherModels]); @@ -118,22 +142,40 @@ export const DefaultModelSection: React.FC = ({ defaultModelSettings }) = -

{i18n.DEFAULT_MODEL_TITLE}

+

+ {i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.title', { + defaultMessage: 'Default model', + })} +

} - description={

{i18n.DEFAULT_MODEL_DESCRIPTION}

} + description={ +

+ {i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.description', { + defaultMessage: + 'Choose a default model for all AI features. Individual features can override this with their own model.', + })} +

+ } > 0} error={validationErrors} > = ({ defaultModelSettings }) = onChangeDisallow(e.target.checked)} /> @@ -167,8 +214,19 @@ export const DefaultModelSection: React.FC = ({ defaultModelSettings }) = {state.disallowOtherModels - ? i18n.DISALLOW_OTHER_MODELS_DESCRIPTION - : i18n.ALLOW_OTHER_MODELS_DESCRIPTION} + ? i18n.translate( + 'xpack.searchInferenceEndpoints.settings.defaultModel.disallowOtherModels.description', + { + defaultMessage: + 'Model selection is hidden and only the default model will be used.', + } + ) + : i18n.translate( + 'xpack.searchInferenceEndpoints.settings.defaultModel.allowOtherModels.description', + { + defaultMessage: 'Users can choose between multiple models for each feature.', + } + )} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/feature_section.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/feature_section.tsx index e369e8c7c694c..ef12f6ad8824b 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/feature_section.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/feature_section.tsx @@ -18,7 +18,6 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import * as translations from '../../../common/translations'; import type { InferenceFeatureResponse as InferenceFeatureConfig } from '../../../common/types'; import { SubFeatureCard } from './sub_feature_card'; @@ -95,7 +94,9 @@ export const FeatureSection: React.FC = ({ {features.length > 0 && ( - {translations.SETTINGS_RESET_DEFAULTS} + {i18n.translate('xpack.searchInferenceEndpoints.settings.resetDefaults', { + defaultMessage: 'Reset all to defaults', + })} )} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/model_settings.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/model_settings.tsx index bb413c578bcfb..a7b918d5989e2 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/model_settings.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/model_settings.tsx @@ -18,7 +18,6 @@ import { import { i18n } from '@kbn/i18n'; import type { Location } from 'history'; import { useHistory } from 'react-router-dom'; -import * as translations from '../../../common/translations'; import { docLinks } from '../../../common/doc_links'; import { FeatureSection } from './feature_section'; import { DefaultModelSection } from './default_model_section'; @@ -132,7 +131,9 @@ export const ModelSettings: React.FC = () => { <> { isDisabled={!isDirty} data-test-subj="save-settings-button" > - {translations.SETTINGS_SAVE_BUTTON} + {i18n.translate('xpack.searchInferenceEndpoints.settings.saveButton', { + defaultMessage: 'Save settings', + })} , { data-test-subj="settings-api-documentation" href={docLinks.featureSettings} > - {translations.API_DOCUMENTATION_LINK} + {i18n.translate('xpack.searchInferenceEndpoints.apiDocumentationLink', { + defaultMessage: 'API Documentation', + })} , ]} /> @@ -204,8 +209,24 @@ export const ModelSettings: React.FC = () => { {sections.length === 0 ? ( {translations.SETTINGS_NO_FEATURES_TITLE}} - body={

{translations.SETTINGS_NO_FEATURES_DESCRIPTION}

} + title={ +

+ {i18n.translate('xpack.searchInferenceEndpoints.settings.noFeatures.title', { + defaultMessage: 'No features registered', + })} +

+ } + body={ +

+ {i18n.translate( + 'xpack.searchInferenceEndpoints.settings.noFeatures.description', + { + defaultMessage: + 'No features have been registered for inference settings in this project.', + } + )} +

+ } data-test-subj="settings-no-features" /> ) : ( diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/no_models_empty_prompt.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/no_models_empty_prompt.tsx index ea37de748f930..5616a9248bc30 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/no_models_empty_prompt.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/components/settings/no_models_empty_prompt.tsx @@ -14,7 +14,7 @@ import { EuiPageTemplate, } from '@elastic/eui'; import { MANAGEMENT_APP_ID, CLOUD_CONNECT_NAV_ID } from '@kbn/deeplinks-management/constants'; -import * as i18n from '../../../common/translations'; +import { i18n } from '@kbn/i18n'; import { INFERENCE_ENDPOINTS_APP_ID } from '../../../common/constants'; import { useKibana } from '../../hooks/use_kibana'; @@ -36,12 +36,27 @@ export const NoModelsEmptyPrompt: React.FC = () => { {i18n.SETTINGS_NO_MODELS_TITLE}} + title={ +

+ {i18n.translate('xpack.searchInferenceEndpoints.settings.noModels.title', { + defaultMessage: 'No models available', + })} +

+ } body={

{isCloudEnabled - ? i18n.SETTINGS_NO_MODELS_DESCRIPTION - : i18n.SETTINGS_NO_MODELS_NO_CLOUD_DESCRIPTION} + ? i18n.translate('xpack.searchInferenceEndpoints.settings.noModels.description', { + defaultMessage: + 'There are no inference models configured. Add models to get started.', + }) + : i18n.translate( + 'xpack.searchInferenceEndpoints.settings.noModels.noCloudDescription', + { + defaultMessage: + 'There are no inference models configured. Add models or connect your deployment to the Elastic Inference Service to get started.', + } + )}

} data-test-subj="settings-no-models" @@ -54,7 +69,9 @@ export const NoModelsEmptyPrompt: React.FC = () => { onClick={() => application.navigateToApp(CLOUD_CONNECT_NAV_ID)} data-test-subj="settings-no-models-connect-eis" > - {i18n.SETTINGS_NO_MODELS_CONNECT_EIS} + {i18n.translate('xpack.searchInferenceEndpoints.settings.noModels.connectEis', { + defaultMessage: 'Connect Elastic Inference Service', + })} )} @@ -68,7 +85,9 @@ export const NoModelsEmptyPrompt: React.FC = () => { } data-test-subj="settings-no-models-add-models" > - {i18n.SETTINGS_NO_MODELS_ADD_MODELS} + {i18n.translate('xpack.searchInferenceEndpoints.settings.noModels.addModels', { + defaultMessage: 'Add models', + })} diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/translations.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/translations.ts deleted file mode 100644 index d0b9eb66cdd93..0000000000000 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/translations.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -export * from '../../common/translations'; - -export const ENDPOINT_DELETION_FAILED = i18n.translate( - 'xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed', - { - defaultMessage: 'Endpoint deletion failed', - } -); - -export const DELETE_SUCCESS = i18n.translate( - 'xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess', - { - defaultMessage: 'The inference endpoint has been deleted sucessfully.', - } -); - -export const ENDPOINT_CREATION_FAILED = i18n.translate( - 'xpack.searchInferenceEndpoints.addEndpoint.endpointCreationFailed', - { - defaultMessage: 'Endpoint creation failed', - } -); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_default_model_settings.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_default_model_settings.ts index 97a16689f38ae..23e97df0fce79 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_default_model_settings.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_default_model_settings.ts @@ -10,8 +10,8 @@ import { GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR, GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY, } from '@kbn/management-settings-ids'; +import { i18n } from '@kbn/i18n'; import { NO_DEFAULT_MODEL } from '../../common/constants'; -import { DEFAULT_MODEL_SAVE_SUCCESS, DEFAULT_MODEL_SAVE_ERROR } from '../../common/translations'; import { useKibana } from './use_kibana'; export interface DefaultModelSettingsState { @@ -93,10 +93,16 @@ export const useDefaultModelSettings = (): UseDefaultModelSettingsReturn => { const newSaved = getSavedState(); setSavedState(newSaved); setState(newSaved); - notifications.toasts.addSuccess({ title: DEFAULT_MODEL_SAVE_SUCCESS }); + notifications.toasts.addSuccess({ + title: i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.saveSuccess', { + defaultMessage: 'Default model settings saved', + }), + }); } catch (e) { notifications.toasts.addDanger({ - title: DEFAULT_MODEL_SAVE_ERROR, + title: i18n.translate('xpack.searchInferenceEndpoints.settings.defaultModel.saveError', { + defaultMessage: 'Failed to save default model settings', + }), text: (e as Error)?.message ?? 'Unknown error', }); } diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.test.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.test.tsx index ff612eef3e09a..21f707e61d0bf 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.test.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.test.tsx @@ -9,7 +9,6 @@ import { waitFor, renderHook } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@kbn/react-query'; import { useKibana } from './use_kibana'; import { useDeleteEndpoint } from './use_delete_endpoint'; -import * as i18n from './translations'; import React from 'react'; jest.mock('./use_kibana'); @@ -53,7 +52,7 @@ describe('useDeleteEndpoint', () => { ) ); expect(mockAddSuccess).toHaveBeenCalledWith({ - title: i18n.DELETE_SUCCESS, + title: 'The inference endpoint has been deleted sucessfully.', }); }); diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.tsx b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.tsx index 62115e3f5d074..35d2302668809 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.tsx +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_delete_endpoint.tsx @@ -7,8 +7,8 @@ import { useMutation, useQueryClient } from '@kbn/react-query'; import type { KibanaServerError } from '@kbn/kibana-utils-plugin/common'; +import { i18n } from '@kbn/i18n'; import { useKibana } from './use_kibana'; -import * as i18n from './translations'; import { INFERENCE_ENDPOINTS_QUERY_KEY } from '../../common/constants'; @@ -30,7 +30,9 @@ export const useDeleteEndpoint = (onSuccess?: () => void) => { onSuccess: () => { queryClient.invalidateQueries([INFERENCE_ENDPOINTS_QUERY_KEY]); toasts?.addSuccess({ - title: i18n.DELETE_SUCCESS, + title: i18n.translate('xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess', { + defaultMessage: 'The inference endpoint has been deleted sucessfully.', + }), }); if (onSuccess) { onSuccess(); @@ -38,7 +40,12 @@ export const useDeleteEndpoint = (onSuccess?: () => void) => { }, onError: (error: { body: KibanaServerError }) => { toasts?.addError(new Error(error.body.message), { - title: i18n.ENDPOINT_DELETION_FAILED, + title: i18n.translate( + 'xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed', + { + defaultMessage: 'Endpoint deletion failed', + } + ), toastMessage: error.body.message, }); }, diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_endpoint_actions.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_endpoint_actions.ts index 68c6e6664ed9b..bd824214428dd 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_endpoint_actions.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/hooks/use_endpoint_actions.ts @@ -7,7 +7,7 @@ import { useCallback, useState } from 'react'; import type { InferenceInferenceEndpointInfo } from '@elastic/elasticsearch/lib/api/types'; -import { ENDPOINT_COPY_SUCCESS } from '../../common/translations'; +import { i18n } from '@kbn/i18n'; import { useKibana } from './use_kibana'; export const useEndpointActions = () => { @@ -21,7 +21,10 @@ export const useEndpointActions = () => { const copyContent = useCallback( (inferenceId: string) => { - const message = ENDPOINT_COPY_SUCCESS(inferenceId); + const message = i18n.translate('xpack.searchInferenceEndpoints.actions.copyIDSuccess', { + defaultMessage: 'Inference endpoint ID {inferenceId} copied', + values: { inferenceId }, + }); navigator.clipboard.writeText(inferenceId).then( () => { toasts?.addSuccess({ diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/plugin.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/plugin.ts index 1b6790b29c782..eb00ccb136419 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/plugin.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/plugin.ts @@ -8,15 +8,12 @@ import type { Subscription } from 'rxjs'; import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; import type { ManagementApp, ManagementAppMountParams } from '@kbn/management-plugin/public'; import { ELASTIC_INFERENCE_SERVICE_APP_ID, - ELASTIC_INFERENCE_SERVICE_TITLE, - EXTERNAL_INFERENCE_TITLE, INFERENCE_ENDPOINTS_APP_ID, MODEL_SETTINGS_APP_ID, - MODEL_SETTINGS_SECTION_TITLE, - PLUGIN_TITLE, } from '../common/constants'; import { docLinks } from '../common/doc_links'; import type { @@ -54,7 +51,13 @@ export class SearchInferenceEndpointsPlugin this.registerInferenceEndpoints = plugins.management.sections.section.modelManagement.registerApp({ id: INFERENCE_ENDPOINTS_APP_ID, - title: eisEnabled ? EXTERNAL_INFERENCE_TITLE : PLUGIN_TITLE, + title: eisEnabled + ? i18n.translate('xpack.searchInferenceEndpoints.externalInferenceTitle', { + defaultMessage: 'External Inference', + }) + : i18n.translate('xpack.searchInferenceEndpoints.inferenceEndpointsTitle', { + defaultMessage: 'Inference endpoints', + }), order: 2, async mount({ element, history }: ManagementAppMountParams) { const { renderInferenceEndpointsMgmtApp } = await import('./application'); @@ -71,8 +74,11 @@ export class SearchInferenceEndpointsPlugin if (isModelSettingsEnabled(core.uiSettings)) { this.registerModelSettings = plugins.management.sections.section.modelManagement.registerApp({ id: MODEL_SETTINGS_APP_ID, - title: MODEL_SETTINGS_SECTION_TITLE, + title: i18n.translate('xpack.searchInferenceEndpoints.modelSettingsTitle', { + defaultMessage: 'Feature Settings', + }), order: 3, + async mount({ element, history }: ManagementAppMountParams) { const { renderSettingsMgmtApp } = await import('./application'); const [coreStart, depsStart] = await core.getStartServices(); @@ -90,7 +96,9 @@ export class SearchInferenceEndpointsPlugin this.registerElasticInferenceService = plugins.management.sections.section.modelManagement.registerApp({ id: ELASTIC_INFERENCE_SERVICE_APP_ID, - title: ELASTIC_INFERENCE_SERVICE_TITLE, + title: i18n.translate('xpack.searchInferenceEndpoints.elasticInferenceServiceTitle', { + defaultMessage: 'Elastic Inference', + }), order: 1, async mount({ element, history }: ManagementAppMountParams) { const { renderElasticInferenceServiceApp } = await import( diff --git a/x-pack/platform/plugins/shared/search_inference_endpoints/public/utils/group_by.ts b/x-pack/platform/plugins/shared/search_inference_endpoints/public/utils/group_by.ts index 510f2d8231cde..4b28b8ba3e4f4 100644 --- a/x-pack/platform/plugins/shared/search_inference_endpoints/public/utils/group_by.ts +++ b/x-pack/platform/plugins/shared/search_inference_endpoints/public/utils/group_by.ts @@ -6,8 +6,8 @@ */ import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; -import { i18n } from '@kbn/i18n'; import { SERVICE_PROVIDERS, ServiceProviderKeys } from '@kbn/inference-endpoint-ui-common'; +import { i18n } from '@kbn/i18n'; import { isInferenceEndpointWithDisplayCreatorMetadata } from '../../common/type_guards'; import { @@ -20,12 +20,6 @@ import { getModelId } from './get_model_id'; import { KNOWN_MODEL_GROUPS, ELASTIC_GROUP_ID } from './known_models'; export const UNKNOWN_MODEL_ID_FALLBACK = 'unknown_model'; -const UNKNOWN_MODEL_LABEL_FALLBACK = i18n.translate( - 'xpack.searchInferenceEndpoints.groupedEndpoints.unknownModelLabel', - { - defaultMessage: 'Unknown Model', - } -); export const GroupByModelReducer = ( acc: Record, @@ -65,7 +59,12 @@ export const GroupByModelReducer = ( } else { acc[modelId] = { groupId: modelId, - groupLabel: modelId === UNKNOWN_MODEL_ID_FALLBACK ? UNKNOWN_MODEL_LABEL_FALLBACK : modelId, + groupLabel: + modelId === UNKNOWN_MODEL_ID_FALLBACK + ? i18n.translate('xpack.searchInferenceEndpoints.groupedEndpoints.unknownModelLabel', { + defaultMessage: 'Unknown Model', + }) + : modelId, endpoints: [endpoint], }; }