PPanel Edge

i18n

由 openapi.json 自动生成的 3 个端点及其请求、响应和权限元数据。

此参考由已发布 API 契约生成。字段、请求头和权限要求如下。

下载完整 OpenAPI 文档 · SHA-256: ccaa20cec11fad96e369b88073ce3608a5b071ce55d6dc03fa31df7b0f08c525

标识符和数据结构与公开契约一致,说明直接给出调用规则。共享模型见 数据模型.

POST /api/v1/admin/i18n/providers/{id}/test

POST /api/v1/admin/i18n/providers/{id}/test

Test one translation provider with a sample (synchronous; counts toward its monthly characters)

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "example": "workers_ai",
        "maxLength": 32,
        "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/TranslationProviderTest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TranslationProviderTestResult"
          }
        }
      },
      "description": "Translated sample"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "No provider with this id"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "i18n.locale_not_enabled or validation failed"
    },
    "502": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "i18n.translation_provider_failed (details.reason)"
    }
  },
  "summary": "Test one translation provider with a sample (synchronous; counts toward its monthly characters)",
  "tags": [
    "i18n"
  ],
  "x-audit": "i18n.provider_test",
  "x-body": "json",
  "x-body-limit": 65536,
  "x-idempotency": "none",
  "x-permission": "system.i18n.manage",
  "effectiveSecurity": []
}

GET /api/v1/admin/i18n/status

GET /api/v1/admin/i18n/status

Translation status: overview, or one resource (?type=&id=) with every locale and its latest job

{
  "parameters": [
    {
      "in": "query",
      "name": "type",
      "required": false,
      "schema": {
        "example": "catalog.product",
        "maxLength": 64,
        "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$",
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "id",
      "required": false,
      "schema": {
        "example": "0192f0c4-0000-7000-8000-00000000abcd",
        "maxLength": 80,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_./:-]+$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TranslationStatus"
          }
        }
      },
      "description": "Overview or resource status"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Unknown resource type or resource"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "type and id must be given together"
    }
  },
  "summary": "Translation status: overview, or one resource (?type=&id=) with every locale and its latest job",
  "tags": [
    "i18n"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "system.i18n.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/i18n/translate

POST /api/v1/admin/i18n/translate

Translate missing locales of a resource, or retranslate (overwrite) after confirmation

{
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/TranslateRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TranslateResult"
          }
        }
      },
      "description": "Queued translations"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Unknown resource type or resource"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Idempotency-Key conflict"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "i18n.locale_not_enabled or validation failed"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Idempotency-Key missing"
    }
  },
  "summary": "Translate missing locales of a resource, or retranslate (overwrite) after confirmation",
  "tags": [
    "i18n"
  ],
  "x-audit": "i18n.translate",
  "x-body": "json",
  "x-body-limit": 65536,
  "x-idempotency": "required",
  "x-permission": "system.i18n.manage",
  "effectiveSecurity": []
}