The site language is defined as Hebrew. So I get translated error messages.
It's a terrible thing. It is difficult to understand, it is difficult to search on Google, the directions of the text are confused (because some part of the message is written in English /ltr/ and some in Hebrew /rtl/).

Is there any way to keep the site language as Hebrew, but to force the system to output error messages in English?

  • What kind of error and where do you get the error messages, can you give an example?
    – birgire
    Dec 26, 2018 at 22:42
  • @birgire For example, if I remove footer.php I get: Notice: תבנית ללא footer.php לא קיים מאז גרסה 3.0.0 ואין תחליף חלופי. יש להוסיף את הקובץ footer.php לתבנית. in C:\xampp\htdocs\Projects\Develop\wp\wp-includes\functions.php on line 4019. [And since the site has rtl direction the message looks like this: prntscr.com/m00xzi ]
    – Shimon S
    Dec 27, 2018 at 7:01
  • 1
    The first idea that came to mind was to switch to another locale with switch_to_locale(), within a custom PHP error handler set by set_error_handler() to override the trigger_error(), and then restore the previous one with restore_previous_locale(). But the translation seems to have been already evaluated by then, when it's handed down the custom handler, so that approach might not work here. Maybe backtracing (on dev sites) can help with the context or other hooks?
    – birgire
    Dec 27, 2018 at 8:28
  • If you change the locale in your user profile to English, does that help? Jan 1, 2019 at 23:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.