Localization
Pavel Kuzmin edited this page Apr 21, 2023
·
2 revisions
Localization works together with the i18n plugin
- Add info - x-locales
info:
# ...
x-locales:
en: English
ru: Русский
- Add locale text
/pet:
post:
# ...
summary: Add a new pet to the store
x-summary-ru: Добавить нового питомца в магазин
- add locale to i18n
//...
en: {
welcome: 'Welcome',
openapidoc: {
"api_documentation": "API documentation",
"select_route": "Select a route from the list below:",
"info": "Info",
"components": "Components",
"callbacks": "Callbacks",
"examples": "Examples",
"media_type": "Media Type",
"summary": "Summary",
"content": "Content",
"title": "Title",
"servers": "ServersServers",
"code_simple": "Code simple",
"type": "Type",
"enum": "Enum",
"pattern": "Pattern",
"items": "Items",
"properties": "Properties",
"name": "Name",
"security": "Security",
"security_schemes": "Security Schemes",
"one_of": "One Of",
"all_of": "All Of",
"additional_properties": "Additional Properties",
"default": "Default",
"format": "Format",
"deprecated": "Deprecated!",
"value": "Value",
"parameter_name": "Parameter Name",
"description": "Description",
"required": "Required",
"schema": "Schema",
"example": "Example",
"request_bodies": "Request Bodies",
"request_body": "Request Body",
"responses": "Responses",
"status": "Status",
"in": "In",
"minimum": "Minimum string length",
"maximum": "Maximum number of items",
"maximum_props": "Maximum number of properties",
"minimum_props": "Minimum number of properties",
"not": "Not",
"bearer_format": "Bearer format",
"authorization_url": "Authorization URL",
"token_url": "Token URL",
"refresh_url": "Refresh URL",
"scopes": "Scopes",
"content_type": "Content Type",
"variables": "Variables"
}
},
Example: playground2/docs/openapi/localization.yaml
and playground2/nuxt.config.js