How do I translate the alerts and tooltips displayed by the app?

When our app needs to display text, it will use the values from the bcpoStrings JavaScript object.

You can change the default values with the code below. replacing the text between the single quotes:

<script>
var bcpoStrings = {
choose_one: 'Choose one',
quantity: 'Quantity',
please_select: 'Please select',
and: 'and',
or: 'or',
sold_out: 'sold out',
unavailable: 'unavailable',
add_to_cart: 'Add to Cart',
multiselect_message: 'Please choose at least one value for',
file_message: 'Please select a file.',
at_most: 'at most',
at_least: 'at least',
item: 'item',
items: 'items',
selection: 'Selection will add',
selection2: 'to the price',
you_save: 'You Save',
item_added: 'Item added to the cart',
keep_shopping: 'Keep shopping',
view_cart: 'View cart',
theme2_message: 'Please finish customizing your product',
rate_limit: 'We\'re getting too many orders right now. Try clicking the checkout button in a few seconds.',
upload_message: 'If you have trouble uploading, click ••• then "Open in browser"',
};
</script>

<script>
window.bcpoSelections = 'Selections';
window.bcpoVariant = 'Variant';
</script>

Add the translated code after <head> tag in the theme.liquid file. (see screenshot below)

Click the link below for more information on how to add code to the theme.liquid file.

How to edit code in your theme.liquid file

The text for the file upload, and “Please select” warnings are controlled by the language setting in the customer’s browser. If the customer has English selected as their default language then English will show. If they have Chinese selected for their language Chinese will show etc.

To translate the other text in the app (product option titles & values) you can use one of these translation apps recommended in this article.

How to edit code in your theme.liquid file

Was this article helpful?
Dislike