diff --git a/doc/compiled.json b/doc/compiled.json index f1d1d0f3..5c7e5488 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -197,6 +197,9 @@ { "name": "Style guides" }, + { + "name": "Supported Languages" + }, { "name": "Tags" }, @@ -2278,6 +2281,19 @@ "includes_locale_information": false } }, + "languages": { + "type": "object", + "title": "languages", + "description": "Map of all languages supported by Phrase Strings, keyed by their language/locale code. Each value is the human-readable display name for that code.", + "additionalProperties": { + "type": "string" + }, + "example": { + "de": "German", + "en": "English", + "fr": "French" + } + }, "project": { "type": "object", "title": "project", @@ -6249,6 +6265,57 @@ "x-cli-version": "2.5" } }, + "/languages": { + "get": { + "summary": "List supported languages", + "description": "Returns all languages/locale codes that Phrase Strings recognizes, mapped to their\nhuman-readable display name. This endpoint does not require authentication.\n", + "operationId": "languages/list", + "tags": [ + "Supported Languages" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/languages" + }, + "examples": { + "default": { + "value": { + "de": "German", + "en": "English", + "fr": "French" + } + } + } + } + }, + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + } + }, + "400": { + "$ref": "#/components/responses/400" + } + }, + "x-code-samples": [ + { + "lang": "Curl", + "source": "curl \"https://api.phrase.com/v2/languages\" \\\n -u USERNAME_OR_ACCESS_TOKEN" + } + ] + } + }, "/projects/{project_id}/documents": { "get": { "summary": "List documents", diff --git a/main.yaml b/main.yaml index 4d14c27b..7cf82728 100644 --- a/main.yaml +++ b/main.yaml @@ -247,6 +247,7 @@ tags: - name: Screenshots - name: Spaces - name: Style guides + - name: Supported Languages - name: Tags - name: Teams - name: Translations diff --git a/paths.yaml b/paths.yaml index e480dfa3..fecaffde 100644 --- a/paths.yaml +++ b/paths.yaml @@ -4,6 +4,9 @@ "/formats": get: "$ref": "./paths/formats/index.yaml" +"/languages": + get: + "$ref": "./paths/languages/index.yaml" "/projects/{project_id}/documents": get: "$ref": "./paths/documents/index.yaml" diff --git a/paths/languages/index.yaml b/paths/languages/index.yaml new file mode 100644 index 00000000..ac2433c5 --- /dev/null +++ b/paths/languages/index.yaml @@ -0,0 +1,35 @@ +--- +summary: List supported languages +description: | + Returns all languages/locale codes that Phrase Strings recognizes, mapped to their + human-readable display name. This endpoint does not require authentication. +operationId: languages/list +tags: +- Supported Languages +responses: + '200': + description: OK + content: + application/json: + schema: + "$ref": "../../schemas/language.yaml#/languages" + examples: + default: + value: + de: German + en: English + fr: French + headers: + X-Rate-Limit-Limit: + "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" + X-Rate-Limit-Remaining: + "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" + X-Rate-Limit-Reset: + "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" + '400': + "$ref": "../../responses.yaml#/400" +x-code-samples: +- lang: Curl + source: |- + curl "https://api.phrase.com/v2/languages" \ + -u USERNAME_OR_ACCESS_TOKEN diff --git a/schemas.yaml b/schemas.yaml index 79e5a306..10dd2a2b 100644 --- a/schemas.yaml +++ b/schemas.yaml @@ -72,6 +72,8 @@ schemas: "$ref": schemas/upload.yaml#/upload format: "$ref": schemas/format.yaml#/format + languages: + "$ref": schemas/language.yaml#/languages project: "$ref": schemas/project.yaml#/project project_details: diff --git a/schemas/language.yaml b/schemas/language.yaml new file mode 100644 index 00000000..5b988c7a --- /dev/null +++ b/schemas/language.yaml @@ -0,0 +1,14 @@ +--- +languages: + type: object + title: languages + description: >- + Map of all languages supported by Phrase Strings, keyed by their + language/locale code. Each value is the human-readable display name + for that code. + additionalProperties: + type: string + example: + de: German + en: English + fr: French