2014-04-07


Language Support

If you are using a single language, your site should work and display button images in that language without any special  changes.

If you only need one language, make sure you don't select any others in the "required languages" selector.


Multiple language support.

The CSS provided will use the appropriate national language image based on the current "lang" attribute in any containing html tag.


If you include more than one language, you may find the wrong language is displayed. This is probably because the language is being set by a lang="xx" attribute on an outer html tag. The lang attribute is often on documents main html tag e.g. lang="en" and if you have included images for this language, they will be used regardless of browser or Ecwid language settings.


So, you should set the lang attribute on the html tag, or wrap the product browser widget in a div something like  this:


<div lang="fr"> ...widget code... </div>


You could also set the attribute using JavaScript.
For example, this code can be added to set the lang attribute of the product browser div to the same language code that Ecwid is using: 

<script>
Ecwid.OnPageLoaded.add(function() {
  // Ecwid API is available, set the lang attribute for e-shop designer images
  var attrs = document.body.attributes;
  var attributes = [];
  for(var i=0; i<attrs.length; i++) {
    if(attrs[i].nodeName == 'class'){
      var patt=/ecwid-lang-([\w\d]+)/;
      var match = patt.exec(attrs[i].nodeValue);
      if(match != null){
        var pb1 = document.getElementById('ProductBrowser-1');
        if(pb1 != null) pb1.setAttribute("lang", match[1]);
        var eic = document.getElementById('ecwid-inline-catalog-1');
        if(eic != null) eic.setAttribute("lang", match[1]);
      }
    }
  }
});
</script>

 

These are the current Ecwid language codes supported by e-shop designer: 

be, Belorussian
pt_BR, Brazilian Portuguese
bg, Bulgarian
ca, Catalan
zh, Chinese
hr, Croatian
cs, Czech
da, Danish
nl, Dutch
en, English
et, Estonian
fi, Finnish
fr, French
de, German
el, Greek
he, Hebrew
hu, Hungarian
is, Icelandic
id, Indonesian
it, Italian
ja, Japanese
ko, Korean
lv, Latvian
lt, Lithuanian
mk, Macedonian
mr, Marathi
no, Norwegian
fa, Persian
pl, Polish
pt, Portuguese
ro, Romanian
ru, Russian
sr, Serbian
sk, Slovak
sl, Slovenian
es, Spanish
es_419, Spanish (Latin America)
sv, Swedish
th, Thai
tr, Turkish
uk, Ukrainian
vi, Vietnamese
cy, Welsh


 Note. Themes may be copied in to your Tweak account if you use it where they can be modified, but Tweak only supports one language for custom button images that are different from those included with the theme. So, if you need multiple language support, don't upload custom button images in Tweak, as they will only apply to the default language of your shop.