@f5-sales-demo/docs-theme 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/assets/f5-distributed-cloud.svg +1 -0
- package/assets/f5-logo.svg +1 -0
- package/assets/github-avatar.png +0 -0
- package/astro.config.mjs +3 -0
- package/bin/translate.mjs +113 -0
- package/components/Banner.astro +51 -0
- package/components/EditLink.astro +3 -0
- package/components/Footer.astro +47 -0
- package/components/Icon.astro +100 -0
- package/components/LinkCard.astro +110 -0
- package/components/MarkdownContent.astro +7 -0
- package/components/Screenshot.astro +31 -0
- package/components/SiteTitle.astro +56 -0
- package/config.ts +816 -0
- package/fonts/font-face.css +79 -0
- package/fonts/neusaNextProWide-300.woff2 +0 -0
- package/fonts/neusaNextProWide-400.woff2 +0 -0
- package/fonts/neusaNextProWide-400i.woff2 +0 -0
- package/fonts/neusaNextProWide-500.woff2 +0 -0
- package/fonts/neusaNextProWide-700.woff2 +0 -0
- package/fonts/neusaNextProWide-700i.woff2 +0 -0
- package/fonts/proximaNova-400.woff2 +0 -0
- package/fonts/proximaNova-500.woff2 +0 -0
- package/fonts/proximaNova-600.woff2 +0 -0
- package/fonts/proximaNova-700.woff2 +0 -0
- package/index.ts +36 -0
- package/package.json +135 -0
- package/route-middleware.ts +73 -0
- package/src/content.config.ts +10 -0
- package/src/i18n/glossary.ts +18 -0
- package/src/i18n/locales.test.ts +56 -0
- package/src/i18n/locales.ts +7 -0
- package/src/i18n/mega-menu-translations.ts +1363 -0
- package/src/i18n/prompt.ts +30 -0
- package/src/i18n/translations.ts +733 -0
- package/src/i18n/translator.ts +120 -0
- package/src/plugins/remark-mermaid.mjs +24 -0
- package/src/types/icon.ts +6 -0
- package/src/utils/localize-ecosystem-href.test.ts +65 -0
- package/src/utils/localize-ecosystem-href.ts +34 -0
- package/src/utils/resolve-icon.ts +70 -0
- package/src/utils/subcategory-sidebar.test.ts +25 -0
- package/src/utils/subcategory-sidebar.ts +316 -0
- package/styles/custom.css +807 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function buildTranslationPrompt(
|
|
2
|
+
targetLang: string,
|
|
3
|
+
targetCode: string,
|
|
4
|
+
glossary?: Record<string, string>,
|
|
5
|
+
): string {
|
|
6
|
+
let glossaryBlock = '';
|
|
7
|
+
if (glossary && Object.keys(glossary).length > 0) {
|
|
8
|
+
const entries = Object.entries(glossary)
|
|
9
|
+
.map(([en, translated]) => ` "${en}" → "${translated}"`)
|
|
10
|
+
.join('\n');
|
|
11
|
+
glossaryBlock = `
|
|
12
|
+
|
|
13
|
+
Mandatory terminology — use these exact translations whenever the English term appears in prose (headings, paragraphs, list items). Do NOT paraphrase or leave them in English:
|
|
14
|
+
${entries}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return `You are a professional technical documentation translator. Translate the following MDX documentation content from English to ${targetLang} (${targetCode}).
|
|
18
|
+
|
|
19
|
+
Rules:
|
|
20
|
+
- Translate ALL prose text, including headings, paragraphs, list items, blockquotes, and admonition content
|
|
21
|
+
- Translate ALL frontmatter string values for these keys: title, description, sidebar.label, hero.title, hero.tagline, and hero.actions[].text — ALWAYS translate these even if they contain technical terms
|
|
22
|
+
- Do NOT translate frontmatter keys themselves, URLs, file paths, or image paths
|
|
23
|
+
- Do NOT translate or modify: code blocks, inline code, URLs, file paths, variable names, component names, HTML tags, MDX component syntax (e.g., <Screenshot>, <LinkCard>)
|
|
24
|
+
- Preserve ALL markdown formatting exactly: headings (##), bold (**), italic (*), links, lists, tables
|
|
25
|
+
- Preserve ALL MDX import statements and component props unchanged
|
|
26
|
+
- Use formal register appropriate for technical documentation in ${targetLang}
|
|
27
|
+
- ALWAYS translate the title and sidebar.label to ${targetLang} — never keep them in English, even for technical terms like "Trigger Detection", "FAQ", "Console", "Diagnostics"
|
|
28
|
+
- Do NOT add, remove, or reorder any content — the output must be structurally identical to the input
|
|
29
|
+
- Return ONLY the translated document with no commentary, no markdown fences wrapping the output${glossaryBlock}`;
|
|
30
|
+
}
|