Page MenuHomePhabricator

Un-hardcode (or at least internationalize) database error message
Closed, ResolvedPublic

Description

Author: jaroslaw.lipszyc

Description:
Message "Wikipedia has a problem Sorry! This site is experiencing technical
difficulties. Try waiting a few minutes and reloading. (Can't contact the
database server: Unknown error (10.0.0.101))" is in english only. This is major
bug: this message shows regardless of which wikipedia you want to see: spanish,
french, german, polish... Error message in language our users don't understand
is not helpfull at all. It must be localised, or - if this is impossible -
given in all major wikipedia languages (as on wikipedia.org web page)


Version: unspecified
Severity: minor

Details

Reference
bz7480

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:26 PM
bzimport set Reference to bz7480.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

The problem is apparently that if you localize the message, you have to get the
localized message from the database. But you can't access the database, which
is why you get the error message. According to an anonymous developer in
Database.php lines 96-7:

I give up, Brion is right. Getting the message cache to work when there is no

DB is tricky.

Hard coding strings instead.

Of course, this could probably be worked around somehow, but there's a reason
for it. Still, as an interim matter it would certainly make sense to hardcode
in translations for the major languages.

dto wrote:

Isn't that what wfMsgNoDB is for?

jaroslaw.lipszyc wrote:

maybe this will be helpfull: in the same time wikipedia logo appearing with this
message IS localised (ie. it's polish wikipedia logo if you attempted to see
polish wikipedia)

jimmy.collins wrote:

(In reply to comment #1)

The problem is apparently that if you localize the message, you have to get the
localized message from the database.

Only the default language of the wiki is read from the database. If you change
your language in preferences the translation is (mostly) read from
languages/messages/Messages**.php (except of additional customizings by the admins).

rotemliss wrote:

(In reply to comment #2)

Isn't that what wfMsgNoDB is for?

Right, I think it should be used. (Maybe wfMsgNoDBForContent instead.)

(In reply to comment #3)

maybe this will be helpfull: in the same time wikipedia logo appearing with this
message IS localised (ie. it's polish wikipedia logo if you attempted to see
polish wikipedia)

The logo is set by $wgLogo in LocalSettings.php, and is used from the servers,
without using the DB; the messages are used from the DB.

robchur wrote:

(In reply to comment #1)

is why you get the error message. According to an anonymous developer in
Database.php lines 96-7:

It was Tim. :)

I18n (not customisation) possible after r46653.