Last modified: 2009-05-18 20:21:39 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 T20389, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18389 - EXIF data lacking localization
EXIF data lacking localization
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 15:36 UTC by Marcus Buck
Modified: 2009-05-18 20:21 UTC (History)
2 users (show)

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


Attachments
patch (576 bytes, patch)
2009-04-16 11:21 UTC, Ahmad Sherif
Details

Description Marcus Buck 2009-04-07 15:36:33 UTC
Numbers in the EXIF data block on image description pages are always rendered in English format instead of the format of the user's preferred language.

The relevant code seems to be function formatNum on line 1082 of Exif.php, which is

01082         function formatNum( $num ) {
01083                 $m = array();
01084                 if ( preg_match( '/^(\d+)\/(\d+)$/', $num, $m ) )
01085                         return $m[2] != 0 ? $m[1] / $m[2] : $num;
01086                 else
01087                         return $num;
01088         }

It rather should be

01082         function formatNum( $num ) {
01083                 global $wgLang;
01084                 $m = array();
01085                 if ( preg_match( '/^(\d+)\/(\d+)$/', $num, $m ) )
01086                         return $wgLang->formatNum( $m[2] != 0 ? $m[1] / $m[2] : $num );
01087                 else
01088                         return $wgLang->formatNum( $num );
01089         }

Thanks
Comment 1 Siebrand Mazeland 2009-04-09 23:35:54 UTC
Please provide a patch for SVN trunk.
Comment 2 Marcus Buck 2009-04-16 11:00:14 UTC
A patch? I'm not a MediaWiki programmer. I don't know how a patch has to look like. I provided the code that fixed the issue for my local installation above.
Comment 3 Ahmad Sherif 2009-04-16 11:21:17 UTC
Created attachment 6030 [details]
patch

A patch per comment#0. The patch however doesn't work for "Exif version" field and the fraction (x/xxx) in "Exposure time" field.
Comment 4 Siebrand Mazeland 2009-05-17 14:34:48 UTC
Applied in r50689. Thanks.
Comment 5 Brion Vibber 2009-05-18 20:21:39 UTC
r50748 fixes the exposure time fraction.

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


Navigation
Links