diff --git a/plugins/aks-desktop/locales/cs/translation.json b/plugins/aks-desktop/locales/cs/translation.json index 82870c9c4..24b08ccd3 100644 --- a/plugins/aks-desktop/locales/cs/translation.json +++ b/plugins/aks-desktop/locales/cs/translation.json @@ -655,6 +655,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/de/translation.json b/plugins/aks-desktop/locales/de/translation.json index 098cdeef3..74e42c4b3 100644 --- a/plugins/aks-desktop/locales/de/translation.json +++ b/plugins/aks-desktop/locales/de/translation.json @@ -633,6 +633,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/en/translation.json b/plugins/aks-desktop/locales/en/translation.json index 21e076b4b..a2a8c9c6a 100644 --- a/plugins/aks-desktop/locales/en/translation.json +++ b/plugins/aks-desktop/locales/en/translation.json @@ -633,6 +633,18 @@ "No deployments found": "No deployments found", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.", "Failed to load Azure context": "Failed to load Azure context", + "Documentation": "Documentation", + "Open an Issue": "Open an Issue", + "Azure Login": "Azure Login", + "Azure Profile": "Azure Profile", + "Create a new AKS project": "Create a new AKS project", + "Use Existing Namespace(s)": "Use Existing Namespace(s)", + "Select namespaces to use as a project": "Select namespaces to use as a project", + "New namespace with resources as a project": "New namespace with resources as a project", + "Create New AKS Managed Namespace": "Create New AKS Managed Namespace", + "Create new AKS managed namespace and use as a project": "Create new AKS managed namespace and use as a project", + "Azure Kubernetes Service": "Azure Kubernetes Service", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.", "just now": "just now", "{{seconds}}s ago": "{{seconds}}s ago", "{{minutes}} min ago": "{{minutes}} min ago", diff --git a/plugins/aks-desktop/locales/es/translation.json b/plugins/aks-desktop/locales/es/translation.json index ed7b646ea..8738ab771 100644 --- a/plugins/aks-desktop/locales/es/translation.json +++ b/plugins/aks-desktop/locales/es/translation.json @@ -644,6 +644,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/fr/translation.json b/plugins/aks-desktop/locales/fr/translation.json index ed7b646ea..8738ab771 100644 --- a/plugins/aks-desktop/locales/fr/translation.json +++ b/plugins/aks-desktop/locales/fr/translation.json @@ -644,6 +644,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/hu/translation.json b/plugins/aks-desktop/locales/hu/translation.json index 098cdeef3..74e42c4b3 100644 --- a/plugins/aks-desktop/locales/hu/translation.json +++ b/plugins/aks-desktop/locales/hu/translation.json @@ -633,6 +633,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/id/translation.json b/plugins/aks-desktop/locales/id/translation.json index ec9553bec..74f0b98f0 100644 --- a/plugins/aks-desktop/locales/id/translation.json +++ b/plugins/aks-desktop/locales/id/translation.json @@ -622,6 +622,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/it/translation.json b/plugins/aks-desktop/locales/it/translation.json index ed7b646ea..8738ab771 100644 --- a/plugins/aks-desktop/locales/it/translation.json +++ b/plugins/aks-desktop/locales/it/translation.json @@ -644,6 +644,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/ja/translation.json b/plugins/aks-desktop/locales/ja/translation.json index ec9553bec..74f0b98f0 100644 --- a/plugins/aks-desktop/locales/ja/translation.json +++ b/plugins/aks-desktop/locales/ja/translation.json @@ -622,6 +622,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/ko/translation.json b/plugins/aks-desktop/locales/ko/translation.json index ec9553bec..74f0b98f0 100644 --- a/plugins/aks-desktop/locales/ko/translation.json +++ b/plugins/aks-desktop/locales/ko/translation.json @@ -622,6 +622,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/nl/translation.json b/plugins/aks-desktop/locales/nl/translation.json index 098cdeef3..74e42c4b3 100644 --- a/plugins/aks-desktop/locales/nl/translation.json +++ b/plugins/aks-desktop/locales/nl/translation.json @@ -633,6 +633,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/pl/translation.json b/plugins/aks-desktop/locales/pl/translation.json index 82870c9c4..24b08ccd3 100644 --- a/plugins/aks-desktop/locales/pl/translation.json +++ b/plugins/aks-desktop/locales/pl/translation.json @@ -655,6 +655,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/pt-BR/translation.json b/plugins/aks-desktop/locales/pt-BR/translation.json index ed7b646ea..8738ab771 100644 --- a/plugins/aks-desktop/locales/pt-BR/translation.json +++ b/plugins/aks-desktop/locales/pt-BR/translation.json @@ -644,6 +644,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/pt-PT/translation.json b/plugins/aks-desktop/locales/pt-PT/translation.json index ed7b646ea..8738ab771 100644 --- a/plugins/aks-desktop/locales/pt-PT/translation.json +++ b/plugins/aks-desktop/locales/pt-PT/translation.json @@ -644,6 +644,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/ru/translation.json b/plugins/aks-desktop/locales/ru/translation.json index 82870c9c4..24b08ccd3 100644 --- a/plugins/aks-desktop/locales/ru/translation.json +++ b/plugins/aks-desktop/locales/ru/translation.json @@ -655,6 +655,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/sv/translation.json b/plugins/aks-desktop/locales/sv/translation.json index 098cdeef3..74e42c4b3 100644 --- a/plugins/aks-desktop/locales/sv/translation.json +++ b/plugins/aks-desktop/locales/sv/translation.json @@ -633,6 +633,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/tr/translation.json b/plugins/aks-desktop/locales/tr/translation.json index 098cdeef3..74e42c4b3 100644 --- a/plugins/aks-desktop/locales/tr/translation.json +++ b/plugins/aks-desktop/locales/tr/translation.json @@ -633,6 +633,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/zh-Hans/translation.json b/plugins/aks-desktop/locales/zh-Hans/translation.json index ec9553bec..74f0b98f0 100644 --- a/plugins/aks-desktop/locales/zh-Hans/translation.json +++ b/plugins/aks-desktop/locales/zh-Hans/translation.json @@ -622,6 +622,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/locales/zh-Hant/translation.json b/plugins/aks-desktop/locales/zh-Hant/translation.json index ec9553bec..74f0b98f0 100644 --- a/plugins/aks-desktop/locales/zh-Hant/translation.json +++ b/plugins/aks-desktop/locales/zh-Hant/translation.json @@ -622,6 +622,18 @@ "No deployments found": "", "Missing required Azure context. Please ensure you are logged in and the cluster is associated with a valid subscription, resource group, and tenant.": "", "Failed to load Azure context": "", + "Documentation": "", + "Open an Issue": "", + "Azure Login": "", + "Azure Profile": "", + "Create a new AKS project": "", + "Use Existing Namespace(s)": "", + "Select namespaces to use as a project": "", + "New namespace with resources as a project": "", + "Create New AKS Managed Namespace": "", + "Create new AKS managed namespace and use as a project": "", + "Azure Kubernetes Service": "", + "Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.": "", "just now": "", "{{seconds}}s ago": "", "{{minutes}} min ago": "", diff --git a/plugins/aks-desktop/src/index.tsx b/plugins/aks-desktop/src/index.tsx index ed09c441a..a605e40dd 100644 --- a/plugins/aks-desktop/src/index.tsx +++ b/plugins/aks-desktop/src/index.tsx @@ -4,6 +4,7 @@ import { Headlamp, registerAddClusterProvider, + registerAppBarAction, registerAppLogo, registerAppTheme, registerCustomCreateProject, @@ -15,6 +16,7 @@ import { registerProjectOverviewSection, registerRoute, registerSidebarEntry, + useTranslation, } from '@kinvolk/headlamp-plugin/lib'; import React from 'react'; import { Redirect } from 'react-router-dom'; @@ -44,6 +46,148 @@ import { getLoginStatus } from './utils/azure/az-cli'; import { isAksProject } from './utils/shared/isAksProject'; import { azureTheme } from './utils/shared/theme'; +/** Stores the latest t() for use outside React component scope (e.g. event handlers). */ +let tFunc: ((key: string) => string) | null = null; + +function TranslatedLabel({ children }: { children: string }) { + const { t } = useTranslation(); + return <>{t(children)}; +} + +/** Re-registers entries with translated strings when the UI language changes. */ +function TranslatedRegistrations() { + const { t, i18n } = useTranslation(); + + React.useEffect(() => { + tFunc = t; + + Headlamp.setAppMenu(menus => { + const helpMenu = menus?.find(menu => menu.id === 'original-help'); + if (helpMenu && helpMenu.submenu) { + const docIndex = helpMenu.submenu.findIndex(item => item.id === 'original-documentation'); + if (docIndex !== -1) { + helpMenu.submenu[docIndex] = { + label: t('Documentation'), + id: 'aks-documentation', + url: 'https://aka.ms/aks/aks-desktop', + }; + } + const issueIndex = helpMenu.submenu.findIndex(item => item.id === 'original-open-issue'); + if (issueIndex !== -1) { + helpMenu.submenu[issueIndex] = { + label: t('Open an Issue'), + id: 'aks-open-issue', + url: 'https://github.com/Azure/aks-desktop/issues', + }; + } + } + return menus; + }); + + registerRoute({ + path: '/azure/login', + // @ts-ignore todo: fix component type + component: AzureLoginPage, + name: t('Azure Login'), + exact: true, + sidebar: { item: 'azure-profile', sidebar: 'HOME' }, + noAuthRequired: true, + useClusterURL: false, + }); + + registerRoute({ + path: '/azure/profile', + component: AzureProfilePage, + name: t('Azure Profile'), + sidebar: { sidebar: 'HOME', item: 'azure-profile' }, + exact: true, + noAuthRequired: true, + useClusterURL: false, + }); + + registerRoute({ + path: '/projects/create-aks-project', + component: CreateAKSProject, + name: t('Create a new AKS project'), + sidebar: { sidebar: 'HOME', item: 'projects' }, + exact: true, + noAuthRequired: true, + useClusterURL: false, + }); + + registerRoute({ + path: '/projects/import-aks-projects', + component: ImportAKSProjects, + name: t('Import AKS Projects'), + sidebar: { sidebar: 'HOME', item: 'projects' }, + exact: true, + noAuthRequired: true, + useClusterURL: false, + }); + + registerCustomCreateProject({ + id: 'use-existing-namespace', + name: t('Use Existing Namespace(s)'), + description: t('Select namespaces to use as a project'), + component: () => , + icon: 'mdi:import', + }); + + registerRoute({ + path: '/projects/create-namespace', + component: CreateNamespace, + name: t('Create New Namespace'), + sidebar: { sidebar: 'HOME', item: 'projects' }, + exact: true, + noAuthRequired: true, + useClusterURL: false, + }); + + registerCustomCreateProject({ + id: 'create-namespace', + name: t('Create New Namespace'), + description: t('New namespace with resources as a project'), + component: () => , + icon: 'mdi:folder-add', + }); + + registerCustomCreateProject({ + id: 'create-aks-managed-namespace', + name: t('Create New AKS Managed Namespace'), + description: t('Create new AKS managed namespace and use as a project'), + component: () => , + icon: 'logos:microsoft-azure', + }); + + registerAddClusterProvider({ + title: t('Azure Kubernetes Service'), + // @ts-ignore todo fix registerAddClusterProvider icon to take string + icon: 'logos:microsoft-azure', + description: t( + 'Connect to an existing AKS (Azure Kubernetes Service) cluster from your Azure subscription. Requires Azure CLI authentication.' + ), + url: '/add-cluster-aks', + }); + + registerRoute({ + path: '/add-cluster-aks', + component: RegisterAKSClusterPage, + name: t('Register AKS Cluster'), + sidebar: null, + exact: true, + useClusterURL: false, + noAuthRequired: true, + }); + + // Re-use the existing azure-auth-update event to trigger + // updateAzureAccountLabel, which will re-register the sidebar entry with + // the translated 'Azure Account' label (via tFunc) when not logged in. + window.dispatchEvent(new Event('azure-auth-update')); + }, [i18n.language, t]); + + return null; +} + Headlamp.setAppMenu(menus => { // Find the Help menu const helpMenu = menus?.find(menu => menu.id === 'original-help'); @@ -141,7 +285,7 @@ if (Headlamp.isRunningAsApp()) { url: '/azure/profile', icon: 'mdi:account-circle', parent: null, - label: 'Azure Account', + label: tFunc ? tFunc('Azure Account') : 'Azure Account', useClusterURL: false, sidebar: 'HOME', }); @@ -292,6 +436,9 @@ if (Headlamp.isRunningAsApp()) { useClusterURL: false, noAuthRequired: true, }); + + // Re-register translatable entries when UI language changes + registerAppBarAction(TranslatedRegistrations); } registerPluginSettings('aks-desktop', PreviewFeaturesSettings, false); @@ -334,14 +481,14 @@ registerProjectOverviewSection({ registerProjectDetailsTab({ id: 'info', - label: 'Info', + label: Info, icon: 'mdi:information', component: ({ project }) => , }); registerProjectDetailsTab({ id: 'deploy', - label: 'Deploy', + label: Deploy, icon: 'mdi:cloud-upload', isEnabled: isAksProject, component: ({ project }) => ( @@ -353,14 +500,14 @@ registerProjectDetailsTab({ registerProjectDetailsTab({ id: 'logs', - label: 'Logs', + label: Logs, icon: 'mdi:text-box-multiple-outline', component: LogsTab, }); registerProjectDetailsTab({ id: 'metrics', - label: 'Metrics', + label: Metrics, icon: 'mdi:chart-line', isEnabled: isAksProject, component: ({ project }) => , @@ -368,7 +515,7 @@ registerProjectDetailsTab({ registerProjectDetailsTab({ id: 'scaling', - label: 'Scaling', + label: Scaling, icon: 'mdi:chart-timeline-variant', isEnabled: isAksProject, component: ({ project }) => ,