Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions guides/internationalization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
keywords: ["internationalization", "i18n", "multi-language", "translations", "localization", "language switcher"]
---

Internationalization (i18n) is the process of designing software or content to work for different languages and locales. This guide explains how to structure files, configure navigation, and maintain translations effectively so that you can help users access your documentation in their preferred language and improve global reach.

Check warning on line 7 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L7

Use parentheses judiciously.

## File structure

Expand All @@ -15,8 +15,8 @@
<Expandable title="supported language codes">
- `ar` - Arabic
- `cs` - Czech
- `cn` or `zh-Hans` - Chinese (Simplified)

Check warning on line 18 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L18

Use parentheses judiciously.
- `zh-Hant` - Chinese (Traditional)

Check warning on line 19 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L19

Use parentheses judiciously.
- `de` - German
- `en` - English
- `es` - Spanish
Expand Down Expand Up @@ -211,6 +211,114 @@

For automated translation solutions, [contact the Mintlify sales team](mailto:gtm@mintlify.com).

### External translation providers

If you work with your own translation vendors or regional translators, you can integrate their workflow with your Mintlify documentation using GitHub Actions or similar CI/CD tools.

#### Workflow overview

1. **Export source content** - Extract MDX files that need translation.
2. **Send to translators** - Provide files to your translation provider.
3. **Receive translations** - Get translated MDX files back.
4. **Import and deploy** - Add translated files to language directories and update navigation.

#### GitHub Actions example

Check warning on line 225 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L225

'GitHub Actions example' should use sentence-style capitalization.

This workflow automatically exports changed English content for translation when PRs merge to main:

```yaml .github/workflows/export-for-translation.yml
name: Export content for translation

on:
push:
branches: [main]
paths:
- '*.mdx'
- '!es/**'
- '!fr/**'
- '!zh/**'

jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get changed files
id: changed
run: |
echo "files=$(git diff --name-only HEAD~1 HEAD -- '*.mdx' ':!es/' ':!fr/' ':!zh/' | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: Create translation package
if: steps.changed.outputs.files != ''
run: |
mkdir -p translation-export
for file in ${{ steps.changed.outputs.files }}; do
cp "$file" translation-export/
done

- name: Upload translation package
if: steps.changed.outputs.files != ''
uses: actions/upload-artifact@v4
with:
name: translation-export-${{ github.sha }}
path: translation-export/
```

#### Import translations workflow

This workflow validates and imports translated content when added via PR:

```yaml .github/workflows/import-translations.yml
name: Import translations

on:
pull_request:
paths:
- 'es/**'
- 'fr/**'
- 'zh/**'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate frontmatter
run: |
for file in $(git diff --name-only origin/main...HEAD -- '*.mdx'); do
if ! head -1 "$file" | grep -q '^---$'; then
echo "Error: $file missing frontmatter"
exit 1
fi
done

- name: Check file structure
run: |
# Verify translated files match source structure
for lang in es fr zh; do
if [ -d "$lang" ]; then
for file in $(find $lang -name '*.mdx'); do
source_file="${file#*/}"
if [ ! -f "$source_file" ]; then
echo "Warning: $file has no English source at $source_file"
fi
done
fi
done
```

#### Best practices for external translation workflows

- **Preserve frontmatter** - Ensure translators keep YAML frontmatter intact, translating only `title` and `description` values.
- **Protect code blocks** - Mark code blocks as "do not translate" for your vendors.
- **Use translation memory** - Provide glossaries with technical terms that should remain in English or have specific translations.
- **Automate validation** - Use CI checks to verify MDX syntax and frontmatter before merging translations.
- **Version control** - Track the source version for each translation to identify outdated content.

### Images and media

Store translated images in language-specific directories.
Expand Down Expand Up @@ -252,7 +360,7 @@

Consider locale-specific formatting for dates and numbers.

- Date formats: MM/DD/YYYY vs DD/MM/YYYY

Check warning on line 363 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L363

Spell out 'YYYY', if it's unfamiliar to the audience.

Check warning on line 363 in guides/internationalization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/internationalization.mdx#L363

Spell out 'YYYY', if it's unfamiliar to the audience.
- Number formats: 1,000.00 vs 1.000,00
- Currency symbols: $100.00 vs 100,00€

Expand Down