-
Notifications
You must be signed in to change notification settings - Fork 56
Add Checkout Settings and Form Fields Translation Documentation #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bc-terra
merged 6 commits into
main
from
CSS-1934-add-checkout-settings-form-fields-translations
Jan 8, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f684e7a
Add documentation for Checkout Settings and Form Fields translations
kristinapototska a5c19a3
Reorder navigation: Address Form Fields, Customer Form Fields, Checko…
kristinapototska 4258c59
Remove temporary CSS-1934.md file
kristinapototska bd16f82
chore: trigger lint
kristinapototska 96c13da
Fix merge markers in translations index
kristinapototska 711c2ee
Merge branch 'main' into CSS-1934-add-checkout-settings-form-fields-t…
bc-terra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
357 changes: 357 additions & 0 deletions
357
docs/store-operations/translations/address-form-fields.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,357 @@ | ||
| # Translations for Address Form Fields (Beta) | ||
|
|
||
| <Callout type='info'> | ||
| The Translations Admin GraphQL API is currently available on Catalyst | ||
| storefronts only. | ||
| </Callout> | ||
|
|
||
| The following entities are translatable for address form fields: | ||
|
|
||
| - Label as `label` - The display label for the form field | ||
| - Option values as `option_{base64string}` - Option values where the base64 string encodes the original option text | ||
|
|
||
| ## Resource fields | ||
|
|
||
| The entities listed above are referenced differently based on resource type and must use the following values in the queries outlined below: | ||
| | Entity Type | `resourceType` | `resourceId` Format | | ||
| | --- | --- | --- | | ||
| | Address Form Field | `ADDRESS_FORM_FIELDS` | `bc/store/addressFormField/{field_id}` | | ||
chris-nowicki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Field Name Format for Options | ||
|
|
||
| - `label` - The display label for the form field | ||
| - `option_{base64string}` - Option values where the base64 string encodes the original option text | ||
kristinapototska marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Example: `option_UmVzaWRlbnRpYWw=` (where `UmVzaWRlbnRpYWw=` is base64 for "Residential") | ||
kristinapototska marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Example: `option_Q29tbWVyY2lhbA==` (where `Q29tbWVyY2lhbA==` is base64 for "Commercial") | ||
kristinapototska marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Examples | ||
|
|
||
| Below are examples of GraphQL queries and mutations for retrieving and managing translation settings for address form fields. | ||
|
|
||
| ### Query a List of Translations | ||
|
|
||
| This query returns a paginated list of translations by resourceType, channel, and locale with a maximum of 50 results per request. | ||
bc-terra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| The request below uses several variables for reusability. Replace `{{channel_id}}` and `{{locale_code}}` with the appropriate values for your use case. | ||
bc-terra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example query: Query a list of translations" showLineNumbers copy | ||
| GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql | ||
| X-Auth-Token: {{token}} | ||
|
|
||
| query { | ||
| store { | ||
| translations( | ||
| filters: { | ||
| channelId: "bc/store/channel/{{channel_id}}", | ||
| localeId: "bc/store/locale/{{locale_code}}", | ||
| resourceType: ADDRESS_FORM_FIELDS | ||
| } | ||
| first: 50 | ||
| ) { | ||
| pageInfo { | ||
| startCursor | ||
| endCursor | ||
| hasNextPage | ||
| hasPreviousPage | ||
| } | ||
| edges { | ||
| cursor | ||
| node { | ||
| resourceId | ||
| fields { | ||
| fieldName | ||
| original | ||
| translation | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example query: Query a list of translations" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "store": { | ||
| "translations": { | ||
| "pageInfo": { | ||
| "startCursor": "YXJyYXljb25uZWN0aW9uOjA=", | ||
| "endCursor": "YXJyYXljb25uZWN0aW9uOjA=", | ||
| "hasNextPage": false, | ||
| "hasPreviousPage": false | ||
| }, | ||
| "edges": [ | ||
| { | ||
| "cursor": "YXJyYXljb25uZWN0aW9uOjA=", | ||
| "node": { | ||
| "resourceId": "bc/store/addressFormField/18", | ||
| "fields": [ | ||
| { | ||
| "fieldName": "label", | ||
| "original": "Street Address", | ||
| "translation": "Dirección" | ||
| }, | ||
| { | ||
| "fieldName": "option_UmVzaWRlbnRpYWw=", | ||
| "original": "Residential", | ||
| "translation": "Residencial" | ||
| }, | ||
| { | ||
| "fieldName": "option_Q29tbWVyY2lhbA==", | ||
| "original": "Commercial", | ||
| "translation": "Comercial" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Query a Translation by Resource ID | ||
|
|
||
| This query returns translation(s) by resourceId. | ||
bc-terra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| The request below uses several variables for reusability. Replace `{{resourceId}}`, `{{channel_id}}`, and `{{locale_code}}` with appropriate values for your use case. Make sure `resourceId` follows the format from the [Resource fields](#resource-fields) table. | ||
bc-terra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example query: Query a translation by resource id" showLineNumbers copy | ||
| GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql | ||
| X-Auth-Token: {{token}} | ||
|
|
||
| query { | ||
| store { | ||
| translations( | ||
| filters: { | ||
| channelId: "bc/store/channel/{{channel_id}}", | ||
| localeId: "bc/store/locale/{{locale_code}}", | ||
| resourceType: ADDRESS_FORM_FIELDS, | ||
| resourceIds: ["bc/store/addressFormField/18"] | ||
| } | ||
| ) { | ||
| edges { | ||
| cursor | ||
| node { | ||
| resourceId | ||
| fields { | ||
| fieldName | ||
| original | ||
| translation | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example query: Query a translation by resource id" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "store": { | ||
| "translations": { | ||
| "edges": [ | ||
| { | ||
| "cursor": "YXJyYXljb25uZWN0aW9uOjA=", | ||
| "node": { | ||
| "resourceId": "bc/store/addressFormField/18", | ||
| "fields": [ | ||
| { | ||
| "fieldName": "label", | ||
| "original": "Street Address", | ||
| "translation": "Dirección" | ||
| }, | ||
| { | ||
| "fieldName": "option_UmVzaWRlbnRpYWw=", | ||
| "original": "Residential", | ||
| "translation": "Residencial" | ||
| }, | ||
| { | ||
| "fieldName": "option_Q29tbWVyY2lhbA==", | ||
| "original": "Commercial", | ||
| "translation": "Comercial" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Update a Translation | ||
|
|
||
| This mutation updates a translation. | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example mutation: Update a translation" showLineNumbers copy | ||
| GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql | ||
| X-Auth-Token: {{token}} | ||
|
|
||
| mutation { | ||
| translation { | ||
| updateTranslations( | ||
| input: { | ||
| resourceType: ADDRESS_FORM_FIELDS, | ||
| channelId: "bc/store/channel/{{channel_id}}", | ||
| localeId: "bc/store/locale/{{locale_code}}", | ||
| entities: [ | ||
| { | ||
| resourceId: "bc/store/addressFormField/18", | ||
| fields: [ | ||
| { fieldName: "label", value: "Dirección de la calle" }, | ||
| { fieldName: "option_UmVzaWRlbnRpYWw=", value: "Residencial" }, | ||
| { fieldName: "option_Q29tbWVyY2lhbA==", value: "Comercial" } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ) { | ||
| __typename | ||
| errors { | ||
| __typename | ||
| ... on Error { | ||
| message | ||
| } | ||
| ... on InvalidTranslationEntityFieldsError { | ||
| id | ||
| fields | ||
| message | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example mutation: Update a translation" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "translation": { | ||
| "updateTranslations": { | ||
| "__typename": "UpdateTranslationsResult", | ||
| "errors": [] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| <Callout type='info'> | ||
| The mutation example above shows a successful response. If invalid fields are provided, the API will return an error response. See the [Error Handling Reference](/docs/store-operations/translations/errors) for more details on error responses. | ||
|
|
||
| Example error response for invalid fields: | ||
| ```json | ||
| { | ||
| "data": { | ||
| "translation": { | ||
| "updateTranslations": { | ||
| "__typename": "UpdateTranslationsResult", | ||
| "errors": [ | ||
| { | ||
| "__typename": "InvalidTranslationEntityFieldsError", | ||
| "id": "bc/store/addressFormField/18", | ||
| "fields": ["option_SW52YWxpZA=="], | ||
| "message": "Invalid fields for entity bc/store/addressFormField/18: option_SW52YWxpZA==" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| </Callout> | ||
|
|
||
| ### Delete a Translation | ||
|
|
||
| The following mutation deletes a translation. | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example mutation: Delete a translation" showLineNumbers copy | ||
| GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql | ||
| X-Auth-Token: {{token}} | ||
|
|
||
| mutation { | ||
| translation { | ||
| deleteTranslations( | ||
| input: { | ||
| channelId: "bc/store/channel/{{channel_id}}", | ||
| localeId: "bc/store/locale/{{locale_code}}", | ||
| resourceType: ADDRESS_FORM_FIELDS, | ||
| resources: [ | ||
| { | ||
| resourceId: "bc/store/addressFormField/18", | ||
| fields: ["label", "option_UmVzaWRlbnRpYWw=", "option_Q29tbWVyY2lhbA=="] | ||
| } | ||
| ] | ||
| } | ||
| ) { | ||
| __typename | ||
| errors { | ||
| __typename | ||
| ... on Error { | ||
| message | ||
| } | ||
| ... on InvalidTranslationEntityFieldsError { | ||
| id | ||
| fields | ||
| message | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example mutation: Delete a translation" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "translation": { | ||
| "deleteTranslations": { | ||
| "__typename": "DeleteTranslationsResult", | ||
| "errors": [] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.