File tree Expand file tree Collapse file tree 2 files changed +64
-267
lines changed
Expand file tree Collapse file tree 2 files changed +64
-267
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Sample Project With Provided Translations
2+
3+ Demonstrates how to provide translations to ApexDocs to customize the language and terminology used in generated documentation.
4+
5+ ## Overview
6+
7+ The translation feature allows you to:
8+
9+ 1 . ** Translate documentation to different languages** (Spanish, French, etc.)
10+ 2 . ** Use custom business terminology** (e.g., "Business Operations" instead of "Methods")
11+ 3 . ** Partially override specific terms** while keeping the rest in English
12+
13+ ## Configuration
14+
15+ Add a ` translations ` property to your ApexDocs configuration:
16+
17+ ``` javascript
18+ import { defineMarkdownConfig } from ' @cparra/apexdocs' ;
19+
20+ export default defineMarkdownConfig ({
21+ sourceDir: ' src' ,
22+ targetDir: ' docs' ,
23+ scope: [' public' , ' global' ],
24+ translations: {
25+ // Your custom translations here
26+ markdown: {
27+ sections: {
28+ methods: ' Métodos' ,
29+ properties: ' Propiedades' ,
30+ fields: ' Campos' ,
31+ },
32+ },
33+ },
34+ });
35+ ```
36+
37+ ## TypeScript Support
38+
39+ If you're using TypeScript, you can import the translation types for better autocomplete and type safety:
40+
41+ ``` typescript
42+ import { defineMarkdownConfig } from ' @cparra/apexdocs' ;
43+ import type { UserTranslations } from ' @cparra/apexdocs' ;
44+
45+ const translations: UserTranslations = {
46+ markdown: {
47+ sections: {
48+ methods: ' Functions' ,
49+ },
50+ },
51+ };
52+
53+ export default defineMarkdownConfig ({
54+ sourceDir: ' src' ,
55+ targetDir: ' docs' ,
56+ scope: [' public' , ' global' ],
57+ translations ,
58+ });
59+ ```
60+
61+ ## Notes
62+
63+ - Only the ** markdown** and ** changelog** generators support translations
64+ - All translations are optional - anything not specified uses the English default
You can’t perform that action at this time.
0 commit comments