@@ -12,6 +12,26 @@ ApexDocs is a non-opinionated documentation generator for Salesforce Apex classe
12
12
It can output documentation in Markdown format, which allows you to use the Static Site Generator of your choice to
13
13
create a documentation site that fits your needs, hosted in any static web hosting service.
14
14
15
+ ## Table of Contents
16
+
17
+ - [ 👀 Examples] ( #-examples )
18
+ - [ 🚀 Features] ( #-features )
19
+ - [ 💿 Installation] ( #-installation )
20
+ - [ ⚡ Quick Start] ( #-quick-start )
21
+ - [ CLI] ( #cli )
22
+ - [ Markdown] ( #markdown )
23
+ - [ OpenApi] ( #openapi )
24
+ - [ Changelog] ( #changelog )
25
+ - [ ▶️ Available Commands] ( #️-available-commands )
26
+ - [ Markdown] ( #markdown-1 )
27
+ - [ OpenApi] ( #openapi-1 )
28
+ - [ Changelog] ( #changelog-1 )
29
+ - [ 🔬 Defining a configuration file] ( #-defining-a-configuration-file )
30
+ - [ 🌐 Translation] ( #-translation )
31
+ - [ ⤵︎ Importing to your project] ( #︎-importing-to-your-project )
32
+ - [ 📖 Documentation Guide] ( #-documentation-guide )
33
+ - [ 📄 Generating OpenApi REST Definitions] ( #-generating-openapi-rest-definitions )
34
+
15
35
## 👀 Examples
16
36
17
37
ApexDocs generates Markdown files, which can be integrated into any Static Site Generation (SSG) engine,
@@ -64,6 +84,7 @@ Here are some live projects using ApexDocs:
64
84
* Support for ignoring files and members from being documented
65
85
* Namespace support
66
86
* Configuration file support
87
+ * Translation support for different languages and custom terminology
67
88
* Single line ApexDoc Blocks
68
89
* Custom tag support
69
90
* And much, much more!
@@ -274,6 +295,12 @@ export default defineMarkdownConfig({
274
295
sourceDir: ' force-app' ,
275
296
targetDir: ' docs' ,
276
297
scope: [' global' , ' public' ],
298
+ translations: {
299
+ sections: {
300
+ methods: ' Methods' ,
301
+ properties: ' Properties' ,
302
+ },
303
+ },
277
304
...
278
305
});
279
306
```
@@ -595,6 +622,74 @@ export default {
595
622
};
596
623
```
597
624
625
+ ## 🌐 Translation
626
+
627
+ ApexDocs supports translations to customize the language and terminology used in the generated documentation.
628
+ This feature allows you to:
629
+
630
+ - ** Translate documentation to different languages** (Spanish, French, etc.)
631
+ - ** Use custom business terminology** (e.g., "Business Operations" instead of "Methods")
632
+ - ** Partially override specific terms** while keeping the rest in English
633
+
634
+ ### How It Works
635
+
636
+ The translation system uses:
637
+
638
+ - ** Default English translations** built into the system
639
+ - ** User-provided overrides** that can be partial or complete
640
+
641
+ ### Configuration
642
+
643
+ Add a ` translations ` property to your ApexDocs configuration (JS or TS file) and pass
644
+ the appropriate translation object, depending on the generator you're using:
645
+
646
+ ``` javascript
647
+ import { defineMarkdownConfig } from ' @cparra/apexdocs' ;
648
+
649
+ export default defineMarkdownConfig ({
650
+ sourceDir: ' src' ,
651
+ targetDir: ' docs' ,
652
+ scope: [' public' , ' global' ],
653
+ translations: {
654
+ sections: {
655
+ methods: ' Métodos' ,
656
+ properties: ' Propiedades' ,
657
+ fields: ' Campos' ,
658
+ },
659
+ },
660
+ });
661
+ ```
662
+
663
+ ### TypeScript Support
664
+
665
+ For TypeScript projects, import the translation types for better autocomplete and type safety:
666
+
667
+ ``` typescript
668
+ import { defineMarkdownConfig } from ' @cparra/apexdocs' ;
669
+ import type { UserTranslations } from ' @cparra/apexdocs' ;
670
+
671
+ const markdownTranslations: UserTranslations [' markdown' ] = {
672
+ sections: {
673
+ methods: ' Functions' ,
674
+ },
675
+ // ...other translation keys as needed
676
+ };
677
+
678
+ export default defineMarkdownConfig ({
679
+ sourceDir: ' src' ,
680
+ targetDir: ' docs' ,
681
+ scope: [' public' , ' global' ],
682
+ translations: markdownTranslations ,
683
+ });
684
+ ```
685
+
686
+ ### Notes
687
+
688
+ - Only the ** markdown** and ** changelog** generators support translations
689
+ - All translations are optional - anything not specified uses the English default
690
+
691
+ For a complete example, see the [ translation example] ( examples/translation/ ) in this repository.
692
+
598
693
## ⤵︎ Importing to your project
599
694
600
695
### Reflection
0 commit comments