r91528 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91527‎ | r91528 | r91529 >
Date:05:47, 6 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Make the reply count in the URL ("reply_(X)") use $wgContLang->formatNum(), so it uses e.g. Persian numbers when the content language is Persian. Reported by user Ebraminio on Translatewiki.net.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Threads.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Threads.php
@@ -271,6 +271,7 @@
272272
273273 /** Keep trying titles starting with $basename until one is unoccupied. */
274274 public static function incrementedTitle( $basename, $namespace ) {
 275+ global $wgContLang;
275276 $i = 2;
276277
277278 // Try to make the title valid.
@@ -284,7 +285,8 @@
285286 throw new MWException( "Error in creating title for basename $basename" );
286287 }
287288
288 - $t = Title::makeTitleSafe( $namespace, $basename . ' (' . $i . ')' );
 289+ $n = $wgContLang->formatNum( $i );
 290+ $t = Title::makeTitleSafe( $namespace, $basename . ' (' . $n . ')' );
289291 $i++;
290292 }
291293 return $t;

Comments

#Comment by Nikerabbit (talk | contribs)   07:54, 6 July 2011

Will existing discussions keep working?

#Comment by Werdna (talk | contribs)   08:08, 6 July 2011

Yes

#Comment by SPQRobin (talk | contribs)   08:08, 6 July 2011

It starts counting again, so "reply", "reply (2)", "reply (3)", then "reply", "reply (٢)", but everything still works.

Status & tagging log