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:
@@ -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}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user