Osclass Themes and Osclass Plugins

How to translate themes and plugins

Manage translations in backoffice

Osclass 8.1.0 came with great update that allows to manage translations from backoffice, without need to locate .po and .mo files, or use external service or tool like POedit. Anyway for large catalogs it still can be easier to use external service/program.

Backoffice osclass classifieds translations

Below section describe details how to translate Osclass, theme and plugins in "old-fashioned" way, by downloading .PO file, performing translation in external program and then uploading it back to server.

Before you start

First please understand, that osclass translations are not handled by themes or plugins, but are managed by osclass core. Means, that if translation does not work, it is not problem of product you are trying to translate, but problem with translation itself.

Very common mistakes:

  • using .po and .mo files of different products
  • incorrect naming convention of language folder (it must be en_US, es_ES, ...)
  • updating .po or .mo file directly on hosting - it must be done via PO Editor
  • uploading just .po file on hosting (require .mo file as well)

 

Introduction

To completely translate your osclass classifieds, you need to translate following parts:

  1. osclass core (oc-content/languages)
  2. current theme (oc-content/themes/{current_theme_name}/languages)
  3. all plugins installed (oc-content/plugins/{plugin_name}/languages)

 

If you do not translate all of these, you still can see english words on your site. For osclass core translation, you can find translation files in different languages on https://docs.osclasspoint.com/import-languages-translations .

Never use translation files of one osclass theme or osclass plugin for translation of different theme or plugin. It cannot work as each product has different words used, so it might look like functional, but some words will not be translated. 

Now you need program to be able to modify .po file. Note that both .po and .mo files must be translated and updated. If you manually modify just .po file, translation will not work, use PO Edit each time.

Download & install PO Edit - free program to handle translations:
https://poedit.net/download

 

Start translation

Translation of plugins and themes is same, both has files in same subfolder.

To make it easy to understand and to avoid using shortcuts, suppose we are going to translate Zara Osclass Theme. It's shortname is zara, that means theme files are located in folder oc-content/themes/zara/ and translation files are located in oc-content/themes/zara/languages.

All products are delivered in English by default, language short name is en_US. We are going to translate theme from English to German, language shortname is de_DE.

  1. Download content of oc-content/themes/zara/languages/en_US to your desktop
  2. Open .po file with PO Edit
  3. Translate all strings in this file and save it.
  4. Go to folder oc-content/themes/zara/languages and create folder de_DE
  5. Into this folder upload modified .po and .mo files
  6. Now you can see .po and .mo file in oc-content/themes/zara/languages/de_DE
  7. Install German language on your osclass instalation (oc-admin > settings > languages)
  8. Theme is translated and ready to use in German language

 

For more details please follow osclass documentation, support to translations is provided just on our forums.

 

Possible translation issues

There are several common cases when translations are not working as expected, make sure to check all of them before reporting it as bug:

  • translation file has been copied from different product and does not contains all the strings.
    Solution: update translation file from source (using PO Editor).

  • language code does not match to language folder. As example, language has code in osclass jp_JP, but you have created folder ja_JP.
    Solution: check table t_locale and make sure language code (pk_c_code) match to folder name.

  • MO file has not been generated properly. This is ugly error and you are not notified about that. This error can be identified simply comparing size of .mo and .po file, those should be more-less same once all translations are completed. In case of problems, .mo file will have about 1kb.
    Solution: Start translation again from original .po file delivered with theme/plugin and try to upload existing translations from corrupted file.

 

13959 views