Skip to content

Commit 6f248a0

Browse files
committed
Add Spanish translations and example metadata for documentation generation
1 parent 531c9a0 commit 6f248a0

File tree

2 files changed

+64
-267
lines changed

2 files changed

+64
-267
lines changed

examples/translation-example/README.md

Lines changed: 0 additions & 267 deletions
This file was deleted.

examples/translation/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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

0 commit comments

Comments
 (0)