1859 extensibility improve application settings section (#16786)

## After
<img width="934" height="750" alt="image"
src="https://github.com/user-attachments/assets/f2d7f743-fa4f-4e7d-a060-033f6087e4b6"
/>
<img width="1008" height="652" alt="image"
src="https://github.com/user-attachments/assets/3d36bfae-aa30-4946-88f2-e99bf074f768"
/>
This commit is contained in:
martmull
2025-12-24 14:35:36 +01:00
committed by GitHub
parent 2eb8cf9e81
commit 158a7a89d5
27 changed files with 387 additions and 397 deletions
@@ -4,17 +4,23 @@ const DOCUMENTATION_PATH = '/user-guide/introduction';
// Locales that have documentation translations available
const SUPPORTED_DOC_LOCALES = ['fr', 'pt', 'de', 'es', 'it', 'ja', 'ko', 'zh'];
export const getDocumentationUrl = (locale?: string | null): string => {
export const getDocumentationUrl = ({
locale,
path = DOCUMENTATION_PATH,
}: {
locale?: string | null;
path?: string;
}): string => {
if (!locale) {
return `${DOCUMENTATION_BASE_URL}${DOCUMENTATION_PATH}`;
return `${DOCUMENTATION_BASE_URL}${path}`;
}
// Extract language code from locale (e.g., 'fr' from 'fr-FR')
const langCode = locale.split('-')[0].toLowerCase();
if (SUPPORTED_DOC_LOCALES.includes(langCode)) {
return `${DOCUMENTATION_BASE_URL}/l/${langCode}${DOCUMENTATION_PATH}`;
return `${DOCUMENTATION_BASE_URL}/l/${langCode}${path}`;
}
return `${DOCUMENTATION_BASE_URL}${DOCUMENTATION_PATH}`;
return `${DOCUMENTATION_BASE_URL}${path}`;
};