Here's a problem: administrative log messages are displayed in the language of the user that generated them, rather than the language of the administrator viewing them.

Comments

Wesley Tanaka’s picture

Component: locale.module » watchdog.module
chx’s picture

Status: Active » Closed (won't fix)

Fixing this would be almost impossible. t() is used to translate static or quasi static messages. While some of the messages we send into watchdog are of this kind, the error handler also dumps stuff into the table.

Wesley Tanaka’s picture

Status: Closed (won't fix) » Active

Wouldn't it be as simple as storing the parameters for t() in the database, instead of the output?

Zen’s picture

Category: bug » feature
Priority: Critical » Normal

This is a (very valid) feature request. Not a bug.

Thanks
-K

Wesley Tanaka’s picture

Category: feature » bug

Without some kind of specification, the distinction between "bug" and "feature" is rather academic.

I think it would be reasonable to assume that, if Drupal had a specification, one of the things that might be specified was that drupal administration pages should not be producing content in (say) Swahili if the administrator cannot read that language.

Perhaps it would be worded something like this:

"Administration pages should be presented in a language comprehensible to the administrator."

...but more pleasant sounding.

As it is, it's possible for an administrator to not understand the errors in their log.

If your operating system started producing some of its system log messages in ancient greek, I'd consider that to be a "bug", and not "expected behavior."

chx’s picture

Category: bug » feature

Again. The PHP error handler also dumps stuff into this table. That knows nada about t. If your Apache / PHP emits English error messages then that's what you get. Also the watchdog overview would be a bit slow if we would need to unserialize every Drupal-made watchdog entry.

Finally. It's a bug if existing functionality is broken. It's a feature if it's non-existing functionality. THis is clearly the second.

Wesley Tanaka’s picture

Title: Admin Log Message localization happens at the wrong time » Drupal-generated admin log errors get translated into languages that the admin possibly doesn't understand
Category: feature » bug

If your Apache / PHP emits English error messages then that's what you get.

Károly, that's a red herring. The messages that show up in other languages are the ones that explicitly translated by drupal. I'm not talking about PHP and Apache errors. Those "can't" be translated (and as you point out they aren't translated currently). I'm talking about the messages that *do* get translated -- translated into a language I as an admin of a Drupal site can't read.

But this does point out that the title isn't as specific as it could be, so I'm changing it.

Also the watchdog overview would be a bit slow if we would need to unserialize every Drupal-made watchdog entry.

Consider how many watchdog listings a drupal site will serve compared to any other page view. I bet you on most sites, there are an average of 0 (zero) views of that log page per day. Drupal (I believe) already does a lot of (de)serialization anyway. If I remember correctly, there's a serialized column in the user table that gets loaded on every logged in user page view.

Finally. It's a bug if existing functionality is broken.

Yes. I feel that it's a bug if I can't read my admin logs. If PHP produced errors once in a while in some language you didn't understand, wouldn't you consider that a bug?

mr700’s picture

The current behavior is inconsistent:

  • Create new drupal site and the first user. Set it up, select Bulgarian language and add another user. In this case you get two messages - "New user: root ..." and "Нов потребител: mr700 ..."
  • php messages are always in English

I think this is a bug because if my linux box (syslogd) starts logging anything but English (in /var/log/messages) it would be a bug and all programs that parse them will break.

Shouldn't all watchdog messages be (at least stored) in English? If the user wants to see the logs in another language (his account's language) this can still be done easy just by excluding php error messages (by type). Benefits of this behavior:

  • all messages will be in one language except php ones when others are translated, but there shouldn't be php errors in drupal, right ;)
  • allow one to write logwatch-like module - you can't/shouldn't have to analyze translated messages
  • speed up most sites - most users never look at their logs unless they *have to*, so less t()s
magico’s picture

Title: Drupal-generated admin log errors get translated into languages that the admin possibly doesn't understand » Watchdog messages should be stored only in english

1. Create a drupal site
2. Add another localization language (eg. portuguese)
3. Create an user (eg. OtherUser) , and change their language to portuguese
4. Navigate, modify, create content with that "OtherUser"
5. In the watchdog log your messages will be in english, "OtherUser" messages will be in portuguese

We can:
1. Maintain the watchdog showing messages as they are inserted
2. We can only insert messages in english
3. We can insert messages in the several languages provided by the locale module
4. We can create a system that allows dynamic translation of the messages whenever they will be show in the log

I think the option 2 is the most simple and obvious.

mr700’s picture

Version: x.y.z » 6.x-dev

In the future someone might want to write watchdog parser/analyzer...

magico’s picture

Status: Active » Closed (duplicate)

Duplicate of #76588.