r35953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35952‎ | r35953 | r35954 >
Date:21:44, 5 June 2008
Author:kim
Status:old
Tags:
Comment:
added two functions, + a very short test that shows the output of both
functions.

Is this about right?
Modified paths:
  • /trunk/extensions/Babel/codes/ISO_639_1.php (modified) (history)
  • /trunk/extensions/Babel/codes/testconvert.php (added) (history)

Diff [purge]

Index: trunk/extensions/Babel/codes/ISO_639_1.php
@@ -564,4 +564,21 @@
565565 'zu' => array(
566566 ISO_639_3 => 'zul',
567567 ),
568 -);
\ No newline at end of file
 568+);
 569+
 570+
 571+function get1to3() {
 572+ global $codes;
 573+ return $codes;
 574+}
 575+
 576+function get3to1() {
 577+ global $codes;
 578+ $codes3to1=array();
 579+ foreach ($codes as $code1=>$codes3) {
 580+ foreach($codes3 as $code3) {
 581+ $codes3to1[$code3]=$code1;
 582+ }
 583+ }
 584+ return $codes3to1;
 585+}
Index: trunk/extensions/Babel/codes/testconvert.php
@@ -0,0 +1,6 @@
 2+<?php
 3+require_once("ISO_639_1.php");
 4+var_dump(get3to1());
 5+var_dump(get1to3());
 6+
 7+?>

Status & tagging log