I need to add a new translated strings in Sngine like website title, marketplace categories, pages categories or any new strings I want to add to the design. Is that possible with Sngine?

Absolutely YES and it’s very easy job too.

Let’s start with example so you can follow to get the whole picture.

First of all Sngine using Gettext technology for translation

Check the benefits of Gettext vs Array from here:

Now let’s say you want add this string and it’s translation to Arabic

“Sngine” => “سنجن”

I will go to “messages.po” file related to Arabic language that you find at “content\languages\locale\ar_sa\LC_MESSAGES“, Open it with any code editor like Notepad++ or Sublime Text.

You can at the bottom of the file any new string with this syntax.

msgid "";
msgstr "";

msgid => represent the English text (Always English as this the base language for Sngine)

msgstr => represent the translation for this text (In this example will be in Arabic)

We are done and need to compile this PO file to MO file and to do this we need to use PoEdit (https://poedit.net/)

Close the code editor and reopen the file using the PoEdit and will find the your text, Just click “Save

Now you have both “messages.po” and “messages.mo” files upload them to your live server at the same place and replace the old files with new files.

Now you can Use this code in the PHP files like

__("Sngine")

Or in the template files like this

{__("Sngine")}

For example I used this string in the index.tpl

Now when someone use my website in Arabic will see this

That’s it.

Happy Sngine 🙂

Buy Sngine or Extend your support: https://bit.ly/BuySngine