Skip to content

docs(API): document key and locale query qualifiers for translations #STRINGS-3829 - #1331

Open
jablan wants to merge 3 commits into
mainfrom
docs/translation-search-qualifiers
Open

jablan wants to merge 3 commits into
mainfrom
docs/translation-search-qualifiers

Conversation

@jablan

@jablan jablan commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The q parameter of translations index/search and the batch actions already supports key.id, key.name, locale.id and locale.name (comma-separated lists), but only id (translation ids), tags, unverified, excluded and the date qualifiers were documented. The only documented way to act on the translations of specific keys was to look up translation ids first (one request per key) and then pass them on.

With these qualifiers a single request is enough, for example:

PATCH /v2/projects/:project_id/translations/unverify
{"branch": "my-feature-branch", "q": "key.id:KEY_ID_1,KEY_ID_2 locale.id:LOCALE_ID"}

Changes

  • Document key.id, key.name, locale.id and locale.name in the q description, and clarify that id: takes translation ids.
  • Define that description once instead of repeating it in ten path files:
    • parameters.yaml#/translations_q: query parameter of translations index on the project route.
    • parameters.yaml#/translations_locale_q and #/translations_key_q: the same for the locale and key routes, without the qualifiers those routes already fix (locale.* and key.* respectively).
    • schemas/translation_query.yaml (registered in schemas.yaml): q property of the request body of translations search and the batch actions (verify, unverify, review, unreview, exclude, include).
  • The examples now use valid qualifiers (the batch examples used verified:true).
  • Add a key.id example to the batch unverify description.
  • Regenerate doc/compiled.json.

Description-only change, no schema change.

Testing

  • make lint passes.
  • Behavior verified against a test environment: key.id and locale.id lists on search and on batch unverify (project and locale routes), and key.name / locale.name lists on search.

🤖 Generated with Claude Code

…#STRINGS-3829

The `q` parameter of translations index/search and the batch actions
supports `key.id`, `key.name`, `locale.id` and `locale.name`, but only
`id` (translation ids), `tags`, `unverified`, `excluded` and the date
qualifiers were documented. The only documented way to act on the
translations of specific keys was therefore to look up translation ids
first.

- Add the four qualifiers to the `q` descriptions (omitting the one
  that is redundant on the key and locale routes)
- Clarify that `id:` takes translation ids
- Add a `key.id` example to batch unverify

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

Doc-only edits (descriptions, examples) do not appear here.

No changes to report, but the specs are different.
Run 'oasdiff diff' to see structural differences.

jablan and others added 2 commits October 19, 2026 15:06
…S-3829

Define the `q` description once as the `translations_q` query parameter
(translations index on the project, locale and key routes) and once as
the `translation_query` schema (request body of translations search and
the batch actions) instead of repeating it in ten path files.

All qualifiers work on every translations route, so the per-route
omissions are dropped, and the examples now use valid qualifiers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tes #STRINGS-3829

The locale route already fixes the locale and the key route already
fixes the key, so `locale.*` and `key.*` respectively can only narrow
the result to nothing. Document them only where they are meaningful, via
`translations_locale_q` and `translations_key_q`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The shared example selects translations already in the target state for batch unverify and exclude.

1 open issue
What changed in this PR

Documents existing key and locale query qualifiers in the translation API and consolidates reusable query documentation.

Changes:

  • Adds key/locale qualifiers and clarifies translation IDs.
  • Shares query definitions across listing, search, and batch endpoints.
  • Updates examples and regenerates the compiled specification.
File Description
schemas/​translation_query.yaml Defines the shared request-body query schema.
schemas.yaml Registers the query schema.
paths/​translations/​search.yaml References the shared query schema.
paths/​translations/​index.yaml References the project query parameter.
paths/​translations/​index_locale.yaml References the locale-scoped query parameter.
paths/​translations/​index_keys.yaml References the key-scoped query parameter.
paths/​translations/​batch_verify.yaml Reuses the shared query schema.
paths/​translations/​batch_unverify.yaml Reuses the schema and adds a key-filter example.
paths/​translations/​batch_unreview.yaml Reuses the shared query schema.
paths/​translations/​batch_review.yaml Reuses the shared query schema.
paths/​translations/​batch_include.yaml Reuses the shared query schema.
paths/​translations/​batch_exclude.yaml Reuses the shared query schema.
parameters.yaml Adds three route-specific query parameters.
doc/​compiled.json Includes regenerated definitions and references.

Review effort: Balanced

* `reviewed_after:2013-02-21T00:00:00Z` for fetching translations that were reviewed after the given timestamp

Find more examples [here](/en/api/strings/usage-examples).
example: PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jablan I think this is valid, adjust the example so its "valid" for each of the usages

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants