Make WordPress Core

Opened 13 years ago

Closed 9 years ago

#21204 closed defect (bug) (worksforme)

Encoding problem with errors and warnings

Reported by: pavelevap's profile pavelevap Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: I18N Keywords:
Focuses: Cc:

Description

There are several functions for debugging and their messages are also localized. For example _deprecated_argument(), _doing_it_wrong(), etc. But when these functions are fired, encoding of the whole administration (not only error messages) is damaged (see attached screenshot).

It is not very good because even if debugging is turned off, some errors can be still triggered - for example trigger_error() in ms_subdomain_constants() function, etc.

Attachments (1)

Debugging_encoding.jpg (20.8 KB) - added by pavelevap 13 years ago.

Download all attachments as: .zip

Change History (14)

#1 follow-up: @nacin
13 years ago

Would it make more sense if we just never translated these kinds of developer error messages?

#2 @pavelevap
13 years ago

Hard to say... In some cases it would be better, developers usually understand basic error in English and they can find solution easily in English. But in some cases are errors descriptive and can help users understand current problem...

But problem is not only in error messages. Encoding is broken for the whole administration - navigation bar, menu, etc.

#3 @nacin
13 years ago

But problem is not only in error messages. Encoding is broken for the whole administration - navigation bar, menu, etc.

Sure, but perhaps we are tripping up your error handler, causing encoding issues throughout the admin. If the errors were rendered in English (say, if you remove __ from them), do you still have broken encoding for the entire admin?

Looks like you are using XDebug — could this be particular to your setup, not even general PHP?

#4 in reply to: ↑ 1 @azaozz
13 years ago

Replying to nacin:

Would it make more sense if we just never translated these kinds of developer error messages?

+1. It would also be easier to find more information about the errors (web search?) if they are not translated.

#5 @pavelevap
13 years ago

nacin: Thank you and sorry for bothering you. It was really related to XDebug, after disabling XDebug everything works well. You can close the ticket or let it open with different meaning "translate or not to translate error messages".

Pros:

  • Better (web)search possibilities for English strings.
  • Translators are not developers - they can translate strings with different meaning.
  • Less strings to translate, less memory used, etc.

Cons:

  • Translated strings can help users (non-developers) to identify problem (if translation is really good and descriptive).

Maybe messages can be available for translation, but with note for translators "Information for developers, translate only when really needed".

#6 @pavelevap
13 years ago

Strange, there are encoding problems only for some messages...

1) Function ms_subdomain_constants() use trigger_error() and _deprecated_argument(). Everything works, encoding is OK for messages and the whole administration.

2) But using for example deprecated plugin header (Site Wide Only: true) leads to encoding problems with messages and the whole administration on Plugins page. This problem can be seen even if localized version is deactivated, because there is for example website name in non-english language.

#7 @nacin
11 years ago

  • Component changed from General to I18N

#8 @DrewAPicture
10 years ago

@pavelevap: Are you still interested in pursuing this?

#9 @pavelevap
10 years ago

I will try to test it once again, maybe something changed after years...

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


9 years ago

#11 @ocean90
9 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


9 years ago

#13 @ocean90
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from reviewing to closed

Closing as workforme due to no further feedback.

Note: See TracTickets for help on using tickets.