github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/locales/create.yaml (about)

     1  ---
     2  summary: Create a locale
     3  description: Create a new locale.
     4  operationId: locale/create
     5  tags:
     6  - Locales
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/project_id"
    10  responses:
    11    '201':
    12      description: Created
    13      content:
    14        application/json:
    15          schema:
    16            "$ref": "../../schemas/locale_details.yaml#/locale_details"
    17      headers:
    18        X-Rate-Limit-Limit:
    19          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    20        X-Rate-Limit-Remaining:
    21          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    22        X-Rate-Limit-Reset:
    23          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    24    '400':
    25      "$ref": "../../responses.yaml#/400"
    26    '404':
    27      "$ref": "../../responses.yaml#/404"
    28    '429':
    29      "$ref": "../../responses.yaml#/429"
    30  x-code-samples:
    31  - lang: Curl
    32    source: |-
    33      curl "https://api.phrase.com/v2/projects/:project_id/locales" \
    34        -u USERNAME_OR_ACCESS_TOKEN \
    35        -X POST \
    36        -d '{"branch":"my-feature-branch","name":"de","code":"de-DE","source_locale_id":"abcd1234abcd1234abcd1234abcd1234", "fallback_locale_id":"abcd1234abcd1234abcd1234abcd1234"}' \
    37        -H 'Content-Type: application/json'
    38  - lang: CLI v2
    39    source: |-
    40      phrase locales create \
    41      --project_id <project_id> \
    42      --data '{"branch":"my-feature-branch", "name":"de", "code":"de-DE", "source_locale_id":"abcd1234abcd1234abcd1234abcd1234", "fallback_locale_id":"abcd1234abcd1234abcd1234abcd1234"}' \
    43      --access_token <token>
    44  requestBody:
    45    required: true
    46    content:
    47      application/json:
    48        schema:
    49          type: object
    50          title: locale/create/parameters
    51          required:
    52            - name
    53            - code
    54          properties:
    55            branch:
    56              description: specify the branch to use
    57              type: string
    58              example: my-feature-branch
    59            name:
    60              description: Locale name
    61              type: string
    62              example: de
    63            code:
    64              description: Locale ISO code
    65              type: string
    66              example: de-DE
    67            default:
    68              description: Indicates whether locale is the default locale. If set to true, the previous default locale the project is no longer the default locale.
    69              type: boolean
    70              example:
    71            main:
    72              description: Indicates whether locale is a main locale. Main locales are part of the <a href="https://support.phrase.com/hc/en-us/articles/5784094755484" target="_blank">Verification System</a> feature.
    73              type: boolean
    74              example:
    75            rtl:
    76              description: Indicates whether locale is a RTL (Right-to-Left) locale.
    77              type: boolean
    78              example:
    79            source_locale_id:
    80              description: Source locale. Can be the name or id of the locale. Preferred is id.
    81              type: string
    82              example: abcd1234abcd1234abcd1234abcd1234
    83            fallback_locale_id:
    84              description: Fallback locale for empty translations. Can be a locale name or id.
    85              type: string
    86              example: abcd1234abcd1234abcd1234abcd1234
    87            unverify_new_translations:
    88              description: Indicates that new translations for this locale should be marked as unverified. Part of the <a href="https://support.phrase.com/hc/en-us/articles/5784094755484" target="_blank">Advanced Workflows</a> feature.
    89              type: boolean
    90              example:
    91            unverify_updated_translations:
    92              description: Indicates that updated translations for this locale should be marked as unverified. Part of the <a href="https://support.phrase.com/hc/en-us/articles/5784094755484" target="_blank">Advanced Workflows</a> feature.
    93              type: boolean
    94              example:
    95            autotranslate:
    96              description: If set, translations for this locale will be fetched automatically, right after creation.
    97              type: boolean
    98              example:
    99  x-cli-version: '2.5'