Default translate function failing with TranslatePress
-
In a WordPress 6.5.5 with TranslatePress 2.8.1 (+ Business Edition 1.4.0) we try to translate a text inside a custom extension which calls a gettext function like:
$test = __('Publishing', 'my-lang-domain');
When we add this to the frontend and use it for example for a url get parameter and debug this parameter with a normal
var_dump();
we get the expectedstring(10) "Publishing"
. Also the translation to (in this case German) works fine and also return with the right valuestring(12) "Verlagswesen"
.Here is our problem: When we try to match the get parameter with the $test variable from above inside a normal
if(){}
php condition we never get a true becausevar_dump($text);
returns with:string(94) "Publishing"
. Why is it 94 chars long even showing only 10 chars? And yes i’ve checked that in the source code as well.I thought it could be a higher unicode character because it was copied from MS Excel but even with another manually translated value the same problem appears. In German however which is the default language you got both the $test and the get parameter with the right length.
Does someone experienced similar problems? Do I miss something in the settings or the documentation of TablePress? Could there be a relation to the fact we use German instead of English as default language?
- The topic ‘Default translate function failing with TranslatePress’ is closed to new replies.