The following tutorial will show you how to fix missing translations after a new language installation in an OpenCart template.
If you have added a new language to your OpenCart, but instead of some translations you see just pieces of code like text_follow, that means the used language pack is incomplete.
Let’s show how to add translations manually.
Copy the code of the missing translation from your browser. That is text_follow in our case.
Open the theme fullpackage folder with some file manager software that allows search by text function. We prefer Total Commander.
Click the Alt + F7 hotkeys and activate the Find text option. Paste the code of missing translation into the search bar and click the Start search button.
The software shows the list of files containing this code.
NOTE: Original files with translations are located either in “catalog/language/english” or in “vqmod/xml” folders of your theme package.
In our case, the required file is “vqmod\xml\tm_footer.xml.” Open it with some code editor, for instance, Adobe DreamWeaver or Notepad ++, and look for the missing translation code.
Here we can see the following code:
$_['text_follow'] = 'Follow Us'; $_['text_support'] = 'Online support'; $_['text_fb'] = 'Facebook'; $_['text_twi'] = 'Twitter'; $_['text_rss'] = 'RSS'; $_['text_yt'] = 'You Tube';
These are PHP language commands that define titles for the Follow us footer block in the English version. Copy them all.
If you look a few lines above, you will see the code:
That means the English language file for this block is called footer.php and is located in the catalog/language/english/common folder. We need to add missing translations to the footer.php file of our new language pack.
Enter your hosting server using CPanel File Manager or FTP-client software (Total Commander, FileZilla, etc).
Nagivate to the “catalog/language/your_new_language/common” folder of your OpenCart installation and open the footer.php file with some code editor.
Paste the code you copied from tm_footer.xml within PHP code block (within <?php ?>) and translate English words into the required language.
Save the changes. Check your website front end. We managed to fix the missing translation issue successfully.
Feel free to check the detailed video tutorial below: