This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Having been developing for concrete5 for a while, you probably already know that you can pretty easily translate the interface into any language as this guide shows. What you might not know is that you can also apply this to site specific translations.

Note: You need to have the Internationalization add-on installed for this to work.

Many times with multilingual sites you need to use static texts in your blocks or pages that you don't allow people to edit. These texts might be for example "read more", "add to friends", "show preview", etc. or maybe you want to translate a static text inside a block you created with designer content. In these cases it's pretty handy to use the concrete5 built-in site-specific translation architecture.

What you need to do is to create this folder in your languages folder:

{root}/languages/site/

In that folder you can add your site-specific translation files as .po/.mo files. The file names must include the used language code, such as fi_FI.po and fi_FI.mo. So for example I might have a site that is served in English (default), Finnish (fi_FI), and Swedish (sv_SE) and my site-specific translation folder might look something like this:

{root}/languages/site/fi_FI.mo
{root}/languages/site/fi_FI.po
{root}/languages/site/sv_SE.mo
{root}/languages/site/sv_SE.po

For creating these files, Poedit is a really great free software. What you need to do in Poedit is the following:

  1. Open up the software
  2. Click file => new catalog
  3. Give project details as you want to
  4. For paths, make the root path your site project path, e.g. /dev/my_concrete_site/, under that, add at least these sub-paths: blocks, themes
  5. Then go to the last "Keywords" tab and add at least these keywords there: "_" and "t"
  6. After that, save settings by clicking "OK" and saving the file to /dev/my_concrete_site/languages/site/fi_FI.po (for example for Finnish)
  7. Finally, parse through your site-specific code by clicking Catalog => Update from sources

After that you've created your own site-specific translation file you can start translating. Repeat this for every language you need to translate for your site-specific static texts.

Now, your site-specific static texts are automatically translated depending on the multilingual section your site users are browsing. If you experience some texts not translating, try clearing out your site cache.

There is also concrete5-integrated solution to manage translations called Translations Manager. If you want to do this all automatically and more easily through your dashboard, you should look into that one.

Loading Conversation