From b6de93f3b5e1c3b71e8a9cd62119dbd7acaee5f3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 29 Feb 2004 09:43:52 +0000 Subject: [PATCH] Clean up so it works --- languages/LanguageGa.php | 403 +++------------------------------------ 1 file changed, 28 insertions(+), 375 deletions(-) diff --git a/languages/LanguageGa.php b/languages/LanguageGa.php index deadc10f71..919cb61ae6 100755 --- a/languages/LanguageGa.php +++ b/languages/LanguageGa.php @@ -1,36 +1,18 @@ - "-" - -# The names of the namespaces can be set here, but the numbers -# are magical, so don't change or move them! The Namespace class -# encapsulates some of the magic-ness. -# + "Media", -1 => "Speisialta", @@ -110,152 +92,6 @@ define("MAG_NOEDITSECTION", 14); "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1" ); -# Here, when possible, use Irish language names for languages - -/* private */ $wgLanguageNamesGa = array( - "aa" => "Afar", - "ab" => "Abkhazian", - "af" => "Afrikaans", # Afracáinis - "am" => "Amharic", - "ar" => "‮العربية‬ (Araby)", # Araibis - "as" => "Assamese", - "ay" => "Aymara", - "az" => "Azerbaijani", - "ba" => "Bashkir", - "be" => "Беларуски", - "bh" => "Bihara", - "bi" => "Bislama", - "bn" => "Bengali", - "bo" => "Tibetan", # Tibéadis - "br" => "Brezhoneg", - "bs" => "Bosnian", - "ca" => "Català", # Catalóinis - "ch" => "Chamoru", - "co" => "Corsican", - "cs" => "Česká", - "cy" => "Cymraeg", # Breatnais - "da" => "Dansk", # Danmhairgis. Note two different subdomains. - "dk" => "Dansk", # 'da' is correct for the language. - "de" => "Deutsch", # Gearmáinis - "dz" => "Bhutani", - "el" => "Ελληνικά (Ellenika)", - "en" => "English", # Béarla - "eo" => "Esperanto", # Espeirantó - "es" => "Español", # Spáinnis - "et" => "Eesti", - "eu" => "Euskara", - "fa" => "‮فرسى‬ (Farsi)", - "fi" => "Suomi", - "fj" => "Fijian", # Fidsis? Fiji= An Fhidsí. - "fo" => "Faeroese", - "fr" => "Français", # Fraincis - "fy" => "Frysk", - "ga" => "Gaeilge", # Gaeilge - "gl" => "Galician", - "gn" => "Guarani", - "gu" => "ગુજરાતી (Gujarati)", - "ha" => "Hausa", - "he" => "עברית (Ivrit)", - "hi" => "हिन्दी (Hindi)", # Hiondúis - "hr" => "Hrvatski", - "hu" => "Magyar", # Ungáiris - "hy" => "Armenian", # Airméinis - "ia" => "Interlingua", - "id" => "Indonesia", # Indinéisis - "ik" => "Inupiak", - "is" => "Íslenska", - "it" => "Italiano", # Iodáilis - "iu" => "Inuktitut", - "ja" => "日本語 (Nihongo)", # Seapáinis - "jv" => "Javanese", # Iavais? Java = An Iava. - "ka" => "ქართველი (Kartuli)", - "kk" => "Kazakh", - "kl" => "Greenlandic", # Graonlainnis - "km" => "Cambodian", - "kn" => "Kannada", - "ko" => "한국어 (Hangukeo)", - "ks" => "Kashmiri", - "kw" => "Kernewek", - "ky" => "Kirghiz", - "la" => "Latina", # Laidin - "ln" => "Lingala", - "lo" => "Laotian", - "lt" => "Lietuvių", - "lv" => "Latvian", # Laitvis - "mg" => "Malagasy", - "mi" => "Maori", - "mk" => "Macedonian", # Macadóinis - "ml" => "Malayalam", - "mn" => "Mongolian", # Mongóilis - "mo" => "Moldavian", - "mr" => "Marathi", - "ms" => "Bahasa Melayu", - "my" => "Burmese", # Burmais? Burma = Burma - "na" => "Nauru", - "ne" => "नेपाली (Nepali)", # Neipealis - "nl" => "Nederlands", # Ollainnis - "no" => "Norsk", # Ioruais - "oc" => "Occitan", - "om" => "Oromo", - "or" => "Oriya", - "pa" => "Punjabi", - "pl" => "Polski", # Polainnis - "ps" => "Pashto", - "pt" => "Português", # Portaingéilis - "qu" => "Quechua", - "rm" => "Rhaeto-Romance", - "rn" => "Kirundi", - "ro" => "Română", - "ru" => "Русский (Russkij)", # Rúisis - "rw" => "Kinyarwanda", - "sa" => "संस्कृत (Samskrta)", - "sd" => "Sindhi", - "sg" => "Sangro", - "sh" => "Serbocroatian", # ? Serbian = Serbis; Croatian = Cróitis. - "si" => "Sinhalese", - "simple" => "Simple English", # Béarla Simplí - "sk" => "Slovak", # Slóvaicis - "sl" => "Slovensko", - "sm" => "Samoan", - "sn" => "Shona", - "so" => "Soomaali", - "sq" => "Shqiptare", - "sr" => "Srpski", - "ss" => "Siswati", - "st" => "Sesotho", - "su" => "Sundanese", - "sv" => "Svenska", # Sualainnis - "sw" => "Kiswahili", - "ta" => "Tamil", - "te" => "Telugu", - "tg" => "Tajik", - "th" => "Thai", - "ti" => "Tigrinya", - "tk" => "Turkmen", - "tl" => "Tagalog", - "tn" => "Setswana", - "to" => "Tonga", - "tr" => "Türkçe", # Tuircis - "ts" => "Tsonga", - "tt" => "Tatar", - "tw" => "Twi", - "ug" => "Uighur", - "uk" => "Українська (Ukrayins`ka)", - "ur" => "Urdu", - "uz" => "Uzbek", - "vi" => "Vietnamese", # Vítneamis - "vo" => "Volapük", - "wo" => "Wolof", - "xh" => "isiXhosa", - "yi" => "Yiddish", # Giúdais - "yo" => "Yoruba", - "za" => "Zhuang", - "zh" => "中文 (Zhongwen)", # Sínis - "zh-cn" => "中文(简体) (Simplified Chinese)", # Sínis Simplithe - "zh-tw" => "中文(繁体) (Traditional Chinese)", # Sínis Traidisiúnta - "zu" => "Zulu" -); - # Different spellings of days (with Dé) may be needed for some uses /* private */ $wgWeekdayNamesGa = array( @@ -274,7 +110,7 @@ define("MAG_NOEDITSECTION", 14); "Mea", "Dei", "Samh", "Nol" ); -# Are the following safe to translate? +# The following exist for the purpose of being translated: /* private */ $wgMagicWordsGa = array( # ID CASE SYNONYMS @@ -332,7 +168,8 @@ define("MAG_NOEDITSECTION", 14); "Movepage" => "", "Booksources" => "Leabharfhoinsí seachtraí", # "Categories" => "Ranganna leathanaigh", - "Export" => "" + "Export" => "XML Export", + "Version" => "Version", ); /* private */ $wgSysopSpecialPagesGa = array( @@ -1269,11 +1106,9 @@ air, nó is féidir leat é a coinnigh do do siamsa féin.", "allmessagestext" => "Seo é liosta de na teachtaireachtaí go léir atá le fáil san roinn MediaWiki: ." ); -#-------------------------------------------------------------------------- -# Internationalisation code -#-------------------------------------------------------------------------- +include_once( "LanguageUtf8.php" ); -class Language { +class LanguageGa extends LanguageUtf8 { function getDefaultUserOptions () { global $wgDefaultUserOptionsGa ; @@ -1301,11 +1136,8 @@ class Language { foreach ( $wgNamespaceNamesGa as $i => $n ) { if ( 0 == strcasecmp( $n, $text ) ) { return $i; } } - return false; - } - - function specialPage( $name ) { - return $this->getNsText( Namespace::getSpecial() ) . ":" . $name; + /* Fallback to English names for compatibility */ + return Language::getNsIndex( $text ); } function getQuickbarSettings() { @@ -1333,31 +1165,11 @@ class Language { return $wgUserTogglesGa; } - function getLanguageNames() { - global $wgLanguageNamesGa; - return $wgLanguageNamesGa; - } - - function getLanguageName( $code ) { - global $wgLanguageNamesGa; - if ( ! array_key_exists( $code, $wgLanguageNamesGa ) ) { - return ""; - } - return $wgLanguageNamesGa[$code]; - } - function getMonthName( $key ) { global $wgMonthNamesGa; return $wgMonthNamesGa[$key-1]; } - - /* by default we just return base form */ - function getMonthNameGen( $key ) - { - global $wgMonthNamesGa; - return $wgMonthNamesGa[$key-1]; - } function getMonthAbbreviation( $key ) { @@ -1371,75 +1183,6 @@ class Language { return $wgWeekdayNamesGa[$key-1]; } - function userAdjust( $ts ) - { - global $wgUser, $wgLocalTZoffset; - - $diff = $wgUser->getOption( "timecorrection" ); - if ( ! is_numeric( $diff ) ) { - $diff = isset( $wgLocalTZoffset ) ? $wgLocalTZoffset : 0; - } - if ( 0 == $diff ) { return $ts; } - - $t = mktime( ( (int)substr( $ts, 8, 2) ) + $diff, - (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ), - (int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ), - (int)substr( $ts, 0, 4 ) ); - return date( "YmdHis", $t ); - } - - function date( $ts, $adj = false ) - { - global $wgAmericanDates, $wgUser, $wgUseDynamicDates; - - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - if ( $wgUseDynamicDates ) { - $datePreference = $wgUser->getOption( 'date' ); - if ( $datePreference == 0 ) { - $datePreference = $wgAmericanDates ? 1 : 2; - } - } else { - $datePreference = $wgAmericanDates ? 1 : 2; - } - - if ( $datePreference == 1 ) { - # MDY - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )) . ", " . - substr( $ts, 0, 4 ); - } else if ( $datePreference == 2 ) { - #DMY - $d = (0 + substr( $ts, 6, 2 )) . " " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " . - substr( $ts, 0, 4 ); - } else { - #YMD - $d = substr( $ts, 0, 4 ) . " " . $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )); - } - - return $d; - } - - function time( $ts, $adj = false ) - { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 ); - return $t; - } - - function timeanddate( $ts, $adj = false ) - { - return $this->time( $ts, $adj ) . ", " . $this->date( $ts, $adj ); - } - - function rfc1123( $ts ) - { - return date( "D, d M Y H:i:s T", $ts ); - } - function getValidSpecialPages() { global $wgValidSpecialPagesGa; @@ -1470,102 +1213,12 @@ class Language { return $wgAllMessagesGa; } - function iconv( $in, $out, $string ) { - # For most languages, this is a wrapper for iconv - return iconv( $in, $out, $string ); - } - - function ucfirst( $string ) { - # For most languages, this is a wrapper for ucfirst() - return ucfirst( $string ); - } - - function checkTitleEncoding( $s ) { - global $wgInputEncoding; - - # Check for UTF-8 URLs; Internet Explorer produces these if you - # type non-ASCII chars in the URL bar or follow unescaped links. - $ishigh = preg_match( '/[\x80-\xff]/', $s); - $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . - '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true ); - - if( ($wgInputEncoding != "utf-8") and $ishigh and $isutf ) - return iconv( "UTF-8", $wgInputEncoding, $s ); - - if( ($wgInputEncoding == "utf-8") and $ishigh and !$isutf ) - return utf8_encode( $s ); - - # Other languages can safely leave this function, or replace - # it with one to detect and convert another legacy encoding. - return $s; - } - - function stripForSearch( $in ) { - # Some languages have special punctuation to strip out - # or characters which need to be converted for MySQL's - # indexing to grok it correctly. Make such changes here. - return $in; - } - + function getMagicWords() + { + global $wgMagicWordsGa; + return $wgMagicWordsGa; + } - function setAltEncoding() { - # Some languages may have an alternate char encoding option - # (Esperanto X-coding, Japanese furigana conversion, etc) - # If 'altencoding' is checked in user prefs, this gives a - # chance to swap out the default encoding settings. - #global $wgInputEncoding, $wgOutputEncoding, $wgEditEncoding; - } - - function recodeForEdit( $s ) { - # For some languages we'll want to explicitly specify - # which characters make it into the edit box raw - # or are converted in some way or another. - # Note that if wgOutputEncoding is different from - # wgInputEncoding, this text will be further converted - # to wgOutputEncoding. - global $wgInputEncoding, $wgEditEncoding; - if( $wgEditEncoding == "" or - $wgEditEncoding == $wgInputEncoding ) { - return $s; - } else { - return $this->iconv( $wgInputEncoding, $wgEditEncoding, $s ); - } - } - - function recodeInput( $s ) { - # Take the previous into account. - global $wgInputEncoding, $wgOutputEncoding, $wgEditEncoding; - if($wgEditEncoding != "") { - $enc = $wgEditEncoding; - } else { - $enc = $wgOutputEncoding; - } - if( $enc == $wgInputEncoding ) { - return $s; - } else { - return $this->iconv( $enc, $wgInputEncoding, $s ); - } - } - - # For right-to-left language support - function isRTL() { return false; } - - function getMagicWords() - { - global $wgMagicWordsGa; - return $wgMagicWordsGa; - } - - # Fill a MagicWord object with data from here - function getMagic( &$mw ) - { - $raw = $this->getMagicWords(); # don't worry, it's reference counted not deep copy - $rawEntry = $raw[$mw->mId]; - $mw->mCaseSensitive = $rawEntry[0]; - $mw->mSynonyms = array_slice( $rawEntry, 1 ); - } } -include_once( "Language" . ucfirst( $wgLanguageCode ) . ".php" ); - -?> +?> \ No newline at end of file -- 2.20.1