How translate theme or plugin for Osclass
How translate theme or plugin for Osclass

How translate theme or plugin for Osclass

Translation or modification of an existing translation of templates and plugins in Osclass.


Osclass supports multi languages.


As a rule, all themes and plugins in the source code contain English text.

This text is then translated into the desired languages ​​using translation files.

By default, each theme has its own translation files, which are located in the languages ​​folder (/ oc-content / themes / template_name / languages ​​/ ...).

Example, ​​folder / oc-content / themes / template_name / languages ​​/en_US / with English translation files.

Which can be used to create a translation into any other language.

These are two theme.po and theme.mo files in folder.

Plugins also have their own translation files (/ oc-content / plugins / plugin_name / languages ​​/ ....), but the plugin translation files have the names messages.po and messages.mo.

theme.po (messages.po) - ASCII file (text). This file is responsible for the text displayed on the site. It needs to be edited.

theme.mo (messages.mo) - a binary file (machine). This is a file compiled from a .po file and used by Osclass.


1.Poedit

Poedit is a free cross-platform (Windows, MAC) .po file editor.

There are other file editors, but we strongly recommend using Poedit.

Download and install the editor on your computer.

You can download the program here: Poedit


2. Download the translation

Download the theme.po and theme.mo translation files (messages.po and messages.mo) from your website onto your computer.


3. Launch Poedit and edit the translation

Launch the Poedit program.

Click the Open menu item and open the theme.po (or messages.po) file.



Then edit the lines you need and save the file.


4. Upload the translation to the site

Replace old translation files with new ones, if you just edited the translation.

You need to replace both theme.po and theme.mo files in the template (messages.po and messages.mo in the plugin).

And that is all. Refresh the site page and look at the changes.


If you created a new translation, for example, in Spanish.

Then you need to create a new folder es_ES  in folder  (/ oc-content / themes / template_name / languages ​​/) or (/ oc-content / plugins / plugin_name / languages ​​/ ....).

The full path of the new folder will look like this  for theme

/ oc-content / themes / template_name / languages ​​/es_ES/

or like this for plugin

/ oc-content / plugins / plugin_name / languages/ ​es_ES/

And upload new files to a new folder.