Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Sync a catalog

Reads the source files and the committed translations into the catalog, then translates what is new or stale.

Reads the source files and the committed translations into the catalog, then translates what is new or stale. Each call is idempotent and works within a bounded time; call again until pending is 0.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/catalogs/catalog:sync
  • Scope localization:write
  • Effect write — a successful call changes state.
  • Collection catalogs

#Request

FieldTypeWhat it is
namestringThe name of the catalog. Required.
formatFormatThe format of the files. Required. One of sylphx_json, icu_json, gettext_po, xliff2.
sourcesCatalogFile[]The source-locale files; 1 to 500. Required.
translationsCatalogFile[]The committed target-locale files; at most 10000. A text that differs from the service's last export is recorded as a pinned human override.
validate_onlyboolValidate the files and return the counts without writing or translating.

#CatalogFile

FieldTypeWhat it is
pathstringThe file's path. The service does not interpret it and echoes it back, for example a namespace file name. Required.
localestringThe file's locale, a BCP 47 tag. Required.
contentstringThe file's text, UTF-8; at most 4 MiB. Required.

#Response

FieldTypeWhat it is
catalogCatalogThe catalog after this call.
addedint32Entries new in the source.
changedint32Entries whose source changed.
obsoletedint32Entries no longer in the source.
adoptedint32Existing translations taken from the committed files.
pinnedint32Committed edits recorded as human overrides.
translatedint32Translations made by this call.
pendingint32Translations still to make; call again until it is 0.
failedint32Translations still failing QA after repair.
usageUsageWhat this call used.

#Catalog

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/catalogs/{catalog}.
uidstringcat_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
specCatalogSpecDesired state. Required.
statusCatalogStatusObserved state. Output only.

#Usage

FieldTypeWhat it is
translated_charactersint64Source characters translated by this call, per target locale; the billed quantity.
memory_matchesint32Translations reused from the translation memory, which are free.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#CatalogSpec

FieldTypeWhat it is
source_localestringThe locale the source texts are written in, a BCP 47 tag such as en. Required.
target_localesstring[]The locales to translate into, BCP 47 tags. zh-Hant-HK and zh-Hant-TW are separate locales. At most 60, each once.
pseudo_localesPseudoLocale[]Pseudo-locales to generate at export. They are never stored or translated. One of accented, bidi, wide.
tonestringThe brand voice every translation follows, at most 2000 characters.
locale_guidancemap<string, string>Extra instructions per target locale, for example the vocabulary of a region. Keys are target locales; at most 60 entries, each at most 2000 characters.
glossariesstring[]The glossaries this catalog applies, as Glossary names; at most 10.

#CatalogStatus

FieldTypeWhat it is
observed_generationint64The generation this status was computed from. Output only.
conditionsCondition[]Ready, Reconciling, Stalled. Output only.
entry_countint32The number of active entries. Output only.
localesLocaleProgress[]Progress per target locale. Output only.
last_sync_timetimestampWhen :sync last completed. Output only.

#Condition

FieldTypeWhat it is
typestringThe condition type, for example Ready.
statusConditionStatusWhether the condition holds. One of true, false, unknown.
observed_generationint64The generation this observation was made against.
reasonstringA machine-readable UpperCamelCase reason.
messagestringA customer-safe human-readable message.
severitySeverityHow severe a FALSE condition is. One of info, warning, error.
transition_timetimestampWhen status last changed.

#LocaleProgress

FieldTypeWhat it is
localestringThe target locale. Output only.
translatedint32Entries with a translation that passed QA. Output only.
pendingint32Entries still to translate. Output only.
failedint32Entries whose translation still fails QA after repair. Output only.
pinnedint32Entries with a human-pinned translation. Output only.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/catalogs/catalog:sync" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"sylphx_json","sources":[{"content":"…","locale":"…","path":"…"}]}'