r9104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9103‎ | r9104 | r9105 >
Date:17:46, 19 May 2005
Author:avar
Status:old
Tags:
Comment:
* Adding support for a one way language conversion between regular is and iz.
Modified paths:
  • /trunk/phase3/languages/LanguageIs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageIs.php
@@ -728,14 +728,39 @@
729729 'yourpasswordagain' => "Lykilorð (aftur)",
730730 'yourrealname' => "Fullt nafn þitt*",
731731 'yourtext' => "Þinn texti",
 732+
 733+'variantname-is' => 'Íslenska',
 734+'variantname-iz' => 'Íslenzka',
 735+'yourvariant' => 'Ritkerfi'
732736 );
733737
734738 #--------------------------------------------------------------------------
735739 # Internationalisation code
736740 #--------------------------------------------------------------------------
737741
 742+require_once( 'LanguageConverter.php' );
 743+class IsConverter extends LanguageConverter {
 744+ function loadDefaultTables() {
 745+ $this->mTables = array();
 746+ $this->mTables['iz'] = array();
 747+ $this->mTables['is'] = array();
 748+ $this->mUcfirst = true;
 749+ }
 750+}
 751+
738752 class LanguageIs extends LanguageUtf8 {
739 -
 753+ function LanguageIs() {
 754+ global $wgHooks;
 755+ $this->mConverter = new IsConverter($this, 'is',
 756+ array('is', 'iz'),
 757+ array(
 758+ 'is' => 'iz',
 759+ 'iz' => 'is'
 760+ )
 761+ );
 762+ $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
 763+ }
 764+
740765 function getNamespaces() {
741766 global $wgNamespaceNamesIs;
742767 return $wgNamespaceNamesIs;
@@ -850,4 +875,6 @@
851876 }
852877 }
853878
 879+class LanguageIz extends LanguageIs {}
 880+
854881 ?>

Status & tagging log