Yeehaw! This week, Osclass Market has reached more than 1 Million downloads of plugins and themes! All of these have helped thousands of users to boost their Osclass site.
Did you know that you can translate them into your own language? If you have recently downloaded a plugin or theme from our Market, here we tell you how you can translate it.
Do you have a GlotPress account? Many plugins and themes are available for translation at GlotPress. Just choose the plugin/theme you want to translate, then select your language and complete it as much as you want!
Still don’t have a GlotPress account? Contact us and we will create you an account in a few seconds!
The downloaded theme/plugin is not on GlotPress? Then keep reading and follow these steps.
In some cases, you may not find a plugin or theme on GlotPress. So far, only plugins and themes developed by Osclass team are available for translation on GlotPress. However, you can translate any Osclass plugin or theme you want just by following these simple steps.
Typically each plugin/theme will have its own language file, located in the folder languages (ex: /oc-content/themes/modern/languages/… for themes or oc-content/plugins/google_analytics/languages for plugins). There will be at least two files, theme.po and theme.mo, these are the main ones, for themes, and messages.po and messages.mo for plugins.
.po – this is a ASCII file (readable text). It’s responsible for most of the text displayed on the website. This is the file that will be edited.
.mo – this is a binary file (machine readable). This is the actual file used by Osclass and is compiled from the .po file.
If the languages folder does not exist in the theme or plugin folder, then follow these instructions.
Step 1: Download Poedit
While there are several .po file editors out there, a highly recommended one is Poedit. It’s a free cross-platform gettext catalogs (.po files) editor.
- Download Poedit and install it.
Step 2: Download your theme.po/messages.po file
To edit your .po file, you must first download a copy of it to your computer.
Step 3: Run Poedit
Run Poedit and then click File and open theme.po or messages.po.
You should now see a list of strings, along with two separate horizontal window panes down at the bottom of the program, like this:
Step 4: Edit
To edit a string, within Pane 1, click on the string you wish to edit. You’ll then see the string appear in Pane 2. You should not edit the string in Pane 2 (this would also require editing your theme’s php files). Instead, click onPane 3 and type the text you’d like to appear instead.
You may continue to edit strings by repeating the above procedure. Once you’re done editing, click File >Save.
By saving, the program will automatically create a new file called theme.mo or messages.mo. This file will appear in the same location on your computer as theme.po or messages.po.
Step 5: Upload to website
Lastly, you must upload your updated .mo file to your theme’ or plugin languages folder, replacing the ‘old’ theme.mo or messages.mo file. You do NOT need to upload the .po file, but you may if you’d like. Only the .mo file is actually used by Osclass.
That’s it! Visit your website and hit “reload” to see the changes.