Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Language support in themes: translate theme texts with t-tags

How to mark texts in your Shoporama theme with t-tags, so they can be edited in the admin and translated into the language of each of the store's countries.

Reading time: about 8 minutes
Developer

Shoporama has a built-in translation feature for themes. You mark text with Smarty <{t}> tags, and the text can then be edited in the admin and translated into the language of each of the store's countries.

How to mark text for translation

Wrap text that needs translating in <{t}> tags, or use |t when the text is a value:

<{t}>Add to cart<{/t}>
<{t}>See more<{/t}>
<{t}>Price<{/t}>

<{include file="components/alert.html" text="Your profile has been updated."|t}>

If a value needs to appear in the text, pass it as a parameter and use it as {x}. If a variable is placed directly inside the text, every value becomes a separate text that has to be translated on its own:

<{if $customer}>
    <{t x=$customer->getActivePoints()}>You have {x} active points.<{/t}>
<{/if}>
The code editor in the Shoporama admin with the theme's file list on the left and the Smarty code from the after_purchase.html email template open on the right
The code editor under Design shows the theme's files in the list on the left and the content of the selected template on the right. This is where developers work directly in the theme's template files and mark text for translation.

The text between the tags is the key. If you change the text in the theme, even a space or a line break inside the text, it becomes a new text that has to be edited and translated again. Also remember the email templates, attributes such as placeholder and title, and messages in the checkout.

Edit the theme's texts

You edit the store's own texts in the store's language under Design → Texts:

  1. Go to Design → Texts in your admin
  2. All texts marked with <{t}> tags are listed here, with the theme's original on the left
  3. Enter your own text in the Translation field
  4. Click Save translations

More languages with Countries

You choose the store's own language under Webshop → General in the Language field (Danish, English, German, Swedish, Norwegian, or Dutch). Among other things, it determines the date format, month names, and default texts.

If you want to sell in several languages, you add countries under Webshop → Countries. Each country gets its own language (one of 22 European languages), its own currency, and its own address, such as yourstore.dk/se or yourstore.se. The theme's texts are then translated into each language under Webshop → Translations → Theme texts:

  • With automatic translation (turned on by default), new and changed texts are translated within a few minutes.
  • Anything you or the store owner edits manually is never overwritten by the automatic translation.
  • Shoporama reads through the theme's files, so the texts can be translated before a customer has seen them.
  • If a translation is missing, the store's own text is shown.

How to set up the countries is described in Sell in multiple countries with Countries, and how to translate the texts in Translate your online store.

Product translations

Products, categories, pages, menus, and other content are translated under Webshop → Translations or via the Translations link at the top of, for example, the product page. You don't need to change the theme to show them: $product->getName(), $product->getUrl(), and the other methods return the country's text and address. Shoporama also adds hreflang tags for the countries automatically. See Hreflang and alternate tags for multilingual online stores.

Get the theme ready for countries

If you have your own theme, there are a few more things the theme needs to handle before the store can sell in other countries:

  • Add "countries": true to the theme's theme_settings.json when the theme is ready, and "text_language" if the texts in <{t}> are not written in Danish (for example "en").
  • Show the currency with $webshop->getCurrency() and amounts from orders with $order->getCurrency(), not "kr." (Danish kroner) written directly in the template.
  • Format numbers with the country's separators: |number_format:2:$webshop->getDecimalSeparator():$webshop->getThousandSeparator().
  • Add a language switcher with $webshop->getCountrySites().
  • Show the delivery countries with $webshop->getDeliveryCountries(), and show a message when $get.delivery_country is set.

All the steps with code examples and a checklist are in Get your theme ready for multiple languages and countries. Shoporama's own themes, such as Montana and Delaware, are already ready.

Tip

Use <{t}> tags consistently in your theme. Text without tags cannot be edited in the admin or translated, and it is shown in the same language in every country.

Frequently asked questions

What is the difference between Design → Texts and Webshop → Translations?

Under Design → Texts, you edit the theme's texts in the store's own language. Under Webshop → Translations, you translate them into the language of each country. The translations are based on the store's own texts.

Can I include translations with the theme?

For the store's own language, the theme can include a langs/ folder that fills in Design → Texts when the theme is activated. The countries' languages are translated under Webshop → Translations, automatically, manually, or with a CSV file.

Why is a text still in Danish in one of the countries?

Usually because it is not wrapped in <{t}>, has a variable inside the text, or has not been translated yet. You can fix it yourself under Webshop → Translations → Theme texts.

Need help? Contact us at support@shoporama.dk.