From 62d8b470ad8b662d1ddb327243816afd8a721fa0 Mon Sep 17 00:00:00 2001 From: Traci Porter Date: Tue, 16 Jan 2024 13:26:01 -0600 Subject: [PATCH] DEVDOCS-5111 : [update] add localization information (#16) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [DEVDOCS-5111] ## What changed? Provide information and a reference to how to localize the files. ## Release notes draft * ## Anything else? ping {names} [DEVDOCS-5111]: https://bigcommercecloud.atlassian.net/browse/DEVDOCS-5111?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: bc-andreadao <96258747+bc-andreadao@users.noreply.github.com> --- .../custom-order-confirmation.mdx | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/stencil-docs/customizing-checkout/custom-order-confirmation.mdx b/docs/stencil-docs/customizing-checkout/custom-order-confirmation.mdx index f59c6120c..8875fee0c 100644 --- a/docs/stencil-docs/customizing-checkout/custom-order-confirmation.mdx +++ b/docs/stencil-docs/customizing-checkout/custom-order-confirmation.mdx @@ -92,6 +92,27 @@ To install a custom order confirmation page on a store, follow these steps: ### Install using the V3 Checkout API To install a custom checkout on a store, use the [Update Checkout Settings](/docs/rest-management/checkouts/checkout-settings#update-checkout-settings) endpoint to install the loader file. + +#### Implementing localization +You can customize your checkout page and customer order confirmation page to display in any one language of your choice. To localize your checkout, download and extract your Stencil theme. Navigate to the `/lang` subfolder, which includes the [`en.json`](https://github.com/bigcommerce/checkout-js/blob/master/packages/locale/src/translations/en.json) English language file. Create a new translation file (i.e., `es.json`) and copy the translation files across from [checkout.js](https://github.com/bigcommerce/checkout-js) into Cornerstone. Use `{{lang checkout.my-string}}` or `{{lang order-confirmation.my-string}}` and enter the key-value pairs. The example below shows English and Spanish strings. + +In `en.json`, add `checkout` key and corresponding information for the value. + +```json showLineNumbers copy +"checkout": { + "title": "Checkout" + } +``` +In `es.json`, add the same `checkout` key and the Spanish translation of the value. + +```json showLineNumbers copy +"checkout": { + "title": "Pago" + } +``` + +For more details on how to add translation keys to a language file, see the [Localization Tutorial] (https://developer.bigcommerce.com/docs/storefront/stencil/themes/localization/tutorial). + ## Related resources