* (bug 2629) Automatically capitalize usernames again instead of
rejecting lowercase with a useless error message
* (bug 2661) Fix link generation in contribs
-
+* (bugs 2633, 2672) Fix Estonian, Portuguese and Finnish numeric formatting
=== Caveats ===
return $wgSkinNamesEt;
}
- function getValidSpecialPages()
- {
+ function getValidSpecialPages() {
global $wgValidSpecialPagesEt;
return $wgValidSpecialPagesEt;
}
- function getSysopSpecialPages()
- {
+ function getSysopSpecialPages() {
global $wgSysopSpecialPagesEt;
return $wgSysopSpecialPagesEt;
}
- function getDeveloperSpecialPages()
- {
+ function getDeveloperSpecialPages() {
global $wgDeveloperSpecialPagesEt;
return $wgDeveloperSpecialPagesEt;
}
}
}
+ /**
+ * Estonian numeric formatting is 123 456,78.
+ * Notice that the space is non-breaking.
+ */
+ function formatNum( $number, $year = false ) {
+ return $year ? $number : strtr($this->commafy($number), '.,', ", " );
+ }
+
+ /**
+ * Avoid grouping whole numbers between 0 to 9999
+ */
+ function commafy($_) {
+ if (!preg_match('/^\d{1,4}$/',$_)) {
+ return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
+ } else {
+ return $_;
+ }
+ }
+
}
?>
return $wgSkinNamesFi;
}
- function date( $ts, $adj = false )
- {
+ function date( $ts, $adj = false ) {
if ( $adj ) { $ts = $this->userAdjust( $ts ); }
$d = (0 + substr( $ts, 6, 2 )) . '. ' .
return $d;
}
- function time( $ts, $adj = false, $seconds = true )
- {
+ function time( $ts, $adj = false, $seconds = true ) {
if ( $adj ) { $ts = $this->userAdjust( $ts ); }
$t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
return $t;
}
- function timeanddate( $ts, $adj = false )
- {
+ function timeanddate( $ts, $adj = false ) {
return $this->date( $ts, $adj ) . ' kello ' . $this->time( $ts, $adj );
}
- function getMessage( $key )
- {
+ function getMessage( $key ) {
global $wgAllMessagesFi;
if( isset( $wgAllMessagesFi[$key] ) ) {
return $wgAllMessagesFi[$key];
}
}
- var $digitTransTable = array(
- ',' => ' ',
- '.' => ','
- );
+ /**
+ * Finnish numeric formatting is 123 456,78.
+ * Notice that the space is non-breaking.
+ */
+ function formatNum( $number, $year = false ) {
+ return $year ? $number : strtr($this->commafy($number), '.,', ", " );
+ }
- function formatNum( $number ) {
- return strtr($number, $this->digitTransTable );
+ /**
+ * Avoid grouping whole numbers between 0 to 9999
+ */
+ function commafy($_) {
+ if (!preg_match('/^\d{1,4}$/',$_)) {
+ return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
+ } else {
+ return $_;
+ }
}
# Convert from the nominative form of a noun to some other case
return $wgDateFormatsPt;
}
- function timeanddate( $ts, $adj = false )
- {
+ function timeanddate( $ts, $adj = false ) {
return $this->time( $ts, $adj ) . ", " . $this->date( $ts, $adj );
}
- function getValidSpecialPages()
- {
+ function getValidSpecialPages() {
global $wgValidSpecialPagesPt;
return $wgValidSpecialPagesPt;
}
- function getSysopSpecialPages()
- {
+ function getSysopSpecialPages() {
global $wgSysopSpecialPagesPt;
return $wgSysopSpecialPagesPt;
}
- function getDeveloperSpecialPages()
- {
+ function getDeveloperSpecialPages() {
global $wgDeveloperSpecialPagesPt;
return $wgDeveloperSpecialPagesPt;
}
- function getMessage( $key )
- {
- global $wgAllMessagesPt;
- if( isset( $wgAllMessagesPt[$key] ) ) {
- return $wgAllMessagesPt[$key];
- } else {
- return parent::getMessage( $key );
- }
+ function getMessage( $key ) {
+ global $wgAllMessagesPt;
+ if( isset( $wgAllMessagesPt[$key] ) ) {
+ return $wgAllMessagesPt[$key];
+ } else {
+ return parent::getMessage( $key );
+ }
}
+
+ /**
+ * Portuguese numeric format is 123.456,78
+ */
+ function formatNum( $number, $year = false ) {
+ return $year ? $number : strtr($this->commafy($number), '.,', ',.' );
+ }
+
}
?>