Last modified: 2013-11-12 08:16:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49209, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47209 - Exceptions are not internationalizable?
Exceptions are not internationalizable?
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-14 06:34 UTC by Adam Wight
Modified: 2013-11-12 08:16 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Adam Wight 2013-04-14 06:34:54 UTC
I would like to display exceptions to the end user, but since exceptions cannot be associated with i18n message ids, this is impossible.  I assume that this is by design?

Otherwise, if it is sometimes appropriate to display messages, they should behave something like:

class Surprise extends MWException {
  function __construct( $arg1, $arg2 ) {
    $this->mwMessage = wfMessage( 'msgname', $arg1, $arg2 );
  }

  function getMessage() {
    return $this->mwMessage->text();
  }
}
Comment 1 db [inactive,noenotif] 2013-04-20 08:17:13 UTC
You should extends ErrorPageError, if you need i18n.
See examples in Exception.php like ReadOnlyError or ThrottledError.
Comment 2 Siebrand Mazeland 2013-11-12 08:16:21 UTC
Marking this resolved per comment 1.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links