We recently encountered a seemingly unsolved problem while building a multilingual site with The7 WordPress theme.
The problem: The way the text on the header search widget is set, it is not registered as a string, and cannot be translated using WPML string translation. See this thread for more details.
Our client absolutely wanted to keep the same functionality in all languages, so hiding the text was not an option.
We came up with a simple script as a solution.
Since our clients’ primary site is in French, and the string is defined in french in the theme options, this code is designed to run when the detected site language is english. It can be adapted to work for any language, by changing the ICL language paramater in the if statement.
Before starting, please make sure to have a full back up of all your website files AND database. This script should not affect anything, however we are not responsible for any data loss, and recommend being able to quickly revert back.
Secondly, please make sure you are running the7 theme on WordPress, with a child theme.
Make sure you:
1 – Have a full backup of your websites files and database
2 – Are running the7 theme with an active child theme