How do I translate the language 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',
at_most: 'at most',
at_least: 'at least',
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',
};
</script>

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

Add the translated code after our app’s two lines of code 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 customers browser. If the customes 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.
Was this article helpful?
Dislike

Pin It on Pinterest