OpenAPI specifications are the backbone of modern API documentation. Localizing them in multiple languages helps developers worldwide understand and integrate with your API. But translating OpenAPI specs isn't straightforward — you need to preserve structure while localizing human-readable content.
OpenAPI (formerly Swagger) is a standard format for describing REST APIs. It includes endpoints, request/response schemas, parameters, authentication methods, and detailed descriptions. These specifications power tools like Swagger UI, Redoc, Scalar, and code generators — making them critical for developer experience.
OpenAPI specifications are complex JSON or YAML files with a precise structure. Simple machine translation tools will break them because they don't understand what should and shouldn't be translated.
l10n.dev automatically detects OpenAPI specifications and handles them with special care:
Before translation (English):
{
"paths": {
"/users/{userId}/profile": {
"parameters": [
{
"name": "userId",
"in": "path",
"description": "The unique identifier of the user",
"schema": { "type": "string" }
}
]
}
},
"components": {
"schemas": {
"UserStatus": {
"type": "string",
"enum": ["active", "inactive", "pending"],
"description": "The current status of the user account"
}
}
}
}After translation to Japanese:
{
"paths": {
"/users/{userId}/profile": {
"parameters": [
{
"name": "userId",
"in": "path",
"description": "ユーザーの一意の識別子",
"schema": { "type": "string" }
}
]
}
},
"components": {
"schemas": {
"UserStatus": {
"type": "string",
"enum": ["active", "inactive", "pending"],
"description": "ユーザーアカウントの現在のステータス"
}
}
}
}One critical aspect of OpenAPI localization is maintaining JSON data types. The service ensures that:
For example, this schema with various data types:
{
"components": {
"schemas": {
"Product": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 123
},
"price": {
"type": "number",
"example": 29.99
},
"inStock": {
"type": "boolean",
"example": true
},
"discount": {
"type": "number",
"nullable": true,
"example": null
}
}
}
}
}
}The translated spec will preserve all these types exactly — ensuring the specification remains valid and can be used safely in production without breaking API clients or documentation generators.
Translating OpenAPI specs works seamlessly through the VS Code extension, allowing you to localize your API documentation directly in your development environment.
Here's a live example of translating an English OpenAPI spec to Japanese inside VS Code:

Localizing your OpenAPI specifications is especially valuable for:
If you're building a public API for global developers, providing documentation in multiple languages dramatically improves adoption. Developers are more likely to integrate with APIs when documentation is in their native language.
Localized API specs make onboarding faster for international teams. New developers can understand endpoints, parameters, and schemas without language barriers.
If your development team spans multiple countries, having API documentation in each team member's language improves collaboration and reduces miscommunication.
Ready to localize your OpenAPI specifications? You have two options:
Thank you for using l10n.dev to localize your OpenAPI specifications! 🚀
If this guide helped you, share it with your team and other developers who need to localize their API documentation.
Together, we can make APIs more accessible and developer-friendly worldwide.