Commit graph

62 commits

Author SHA1 Message Date
Santhosh Thottingal
bbbcf089db CLDR Plural rules based plural form calculation
* Use the plurals.xml of CLDR for the plural rules of languages
* Use plurals-mediawiki.xml to override or extend the rules inside MW
* Remove the convertPlural method in each LanguageXX.php
* Parse and load the xml files in LocalisationCache
* Use the CLDRPluralRuleEvaluator.php for parsing the cldr plural rules
  (This is taken from Translate extension and might require a replacement
   parser without using eval)
* Add getPluralRules() to make the CLDR plural rules available to JS.

PS3: More method documentation, cleanup

Change-Id: I58a9cdfe60c7b9027bf031c91370472054f04ae2
2012-08-16 11:45:17 +10:00
Alexandre Emsenhuber
a682b7335a Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I0db3461139284edcb6ac02923eb83d54e6756ffb
2012-05-12 22:33:51 +02:00
Alexandre Emsenhuber
96a8b6b979 Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() 2012-02-24 14:47:49 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Siebrand Mazeland
a63b207fff Bye, bye $wgExtensionAliasesFiles (deprecated in 1.16). 2011-12-25 23:09:26 +00:00
Roan Kattouw
3938e515ac Followup r101507: don't automatically use APC for the localization cache if it is available. I've expressed reservations in my CR comments (issues abound wherever maintenance scripts, server farms or manualRecache are involved), but the real reason is that three people (Siebrand on CR, Antoine/hashar in person and Rusty Burchfield on bug 32602) have reported problems with the APC LC, and had to set $wgLocalisationCacheConf['store'] = 'files'; explicitly to get LC to work again. 2011-11-23 13:12:22 +00:00
Chad Horohoe
de20376cc1 (bug 29747) eAccelerator shared memory caching has been removed since it is now disabled by default and is buggy. APC, XCache and WinCache are not affected.
As Brion points out in <https://bugzilla.wikimedia.org/show_bug.cgi?id=29747#c7>, the shared memory functions are very buggy. In fact, eAccelerator has disabled the shared memory functions by default for awhile now. I didn't touch APC, XCache or WinCache, but I imagine they suffer from the same problems.
2011-11-22 22:56:00 +00:00
Antoine Musso
4d03992a67 revert r103694 r103687
Need to find a better way to fix that cache issue :(
2011-11-19 17:00:57 +00:00
Antoine Musso
4802134f10 closing a store is only available for CDB type
follow up r103684
2011-11-19 16:31:42 +00:00
Antoine Musso
7fa9b4cf40 add possibility to close a LCStore_CDB
also close an LCStore_CDB after checking for expiry
2011-11-19 16:23:52 +00:00
Siebrand Mazeland
490bc418cf Revert r102650, r102640. Caused breakage on translatewiki.net:
No localisation cache found for English. Please run maintenance/rebuildLocalisationCache.php.

Backtrace:

#0 /www/w/includes/LocalisationCache.php(288): LocalisationCache->initLanguage('en')
#1 /www/w/includes/LocalisationCache.php(223): LocalisationCache->loadItem('en', 'specialPageAlia...')
#2 /www/w/languages/Language.php(2630): LocalisationCache->getItem('en', 'specialPageAlia...')
#3 /www/w/includes/SpecialPageFactory.php(211): Language->getSpecialPageAliases()
#4 /www/w/includes/SpecialPageFactory.php(247): SpecialPageFactory::getAliasList()
#5 /www/w/includes/Title.php(4186): SpecialPageFactory::resolveAlias('LanguageStats/n...')
#6 /www/w/includes/Wiki.php(154): Title->isSpecial('Badtitle')
#7 /www/w/includes/Wiki.php(605): MediaWiki->performRequest()
#8 /www/w/includes/Wiki.php(524): MediaWiki->main()
#9 /www/w/index.php(58): MediaWiki->run()
#10 {main}
2011-11-10 19:01:41 +00:00
Antoine Musso
8fd6abd408 correct variable name
This is caused by r102640, I have moved some code to a new function
and forgot to rename the internal variable name to match the function
parameter.
2011-11-10 13:14:52 +00:00
Antoine Musso
7e9f50387f move store writing out of recache()
Writing to cache is now handled in a new method. That makes recache() a bit
shorter and easier to read. Since there is no point in writing data to
/dev/null , return early in such a case (ie if store is LCStore_Null).
2011-11-10 11:56:52 +00:00
Aaron Schulz
5199bd7f84 Fixed misleading getItem() comments...things like arrays or FileDependency objects and what not can be returned 2011-11-09 22:35:31 +00:00
Mark A. Hershberger
2d1ccd9ba1 re Bug #29283, r101507: Apply Vitaliy Filippov's followup fix:
.... I've found another bug with the implementation - it also
    relies on the presence of key '...:preload' and doesn't check it
    when checking for the expired cache, which can lead to "Invalid or
    missing localisation cache" exceptions.
2011-11-07 17:50:54 +00:00
Sam Reed
b23b2b0d24 Fix fixme on r101177 2011-11-03 20:55:57 +00:00
Mark A. Hershberger
e0963b7ecc followup r101490, remove extra tabs after talking to Nikerabbit. 2011-11-03 13:57:25 +00:00
Mark A. Hershberger
3f65609b13 follow up r101496 — ^demon's comments re style 2011-11-01 18:49:38 +00:00
Mark A. Hershberger
beb8906557 Re-apply Vitaliy Filippov's patch from Bug #29283 with a modification
to make it work when no ACCEL cache is available.
2011-11-01 18:31:04 +00:00
Roan Kattouw
1fd659cc5b Revert r101492, broken, see CR. Also revert followup r101496. 2011-11-01 16:51:31 +00:00
Mark A. Hershberger
1e82e0ff29 followup 101492 — make it actually work. 2011-11-01 16:29:49 +00:00
Mark A. Hershberger
461b7885d8 Apply Vitaliy Filippov's patch from Bug #29283 with some small style mods 2011-11-01 16:10:44 +00:00
Mark A. Hershberger
1323554417 Style fixups 2011-11-01 16:07:09 +00:00
Sam Reed
962644437c Followup r101161 having array() doesn't work so well with isset, changing to null 2011-10-28 19:17:44 +00:00
Sam Reed
450814de00 More documentation updates 2011-10-28 18:11:47 +00:00
Santhosh Thottingal
88bdda41b1 Add support for Number grouping(commafy) based on CLDR number grouping patterns like ##,##,###.
Testcases for Malayalam and Dutch
Number grouping Patterns added to Ml and Hi Message classes.
Reference: Bug 29495
2011-09-22 05:01:19 +00:00
Robin Pepermans
3dfb64f9d7 Replace localisation cache check removed in r91432 with another check 2011-09-09 12:49:40 +00:00
Siebrand Mazeland
7622f51870 Whitespace and formatting updates. 2011-08-25 14:45:38 +00:00
Niklas Laxström
4fa97663e7 Make the language recaching non-recursive and load the data directly.
This might be a bit slower, but avoids problems with cyclic language fallbacks.
Followup r94907
2011-08-22 08:12:10 +00:00
Niklas Laxström
cd47443fcf Fu r94907 - also update localisation cache, which accesses the fallback variable directly
Fixes bug 30456
2011-08-19 09:02:35 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00
Robin Pepermans
81446abcdc (see bug 29712) Removing the defaultUserOptionOverrides in MessagesXx.php because it is broken (and has been for a long time) and secondly, it is only used for things that can be done otherwise:
* 'editfont' => 'sans-serif'; -> trivial (can be set in CSS)
* 'underline' => 0; by languages written in scripts that are hard to read with underlines -> now set in shared.css, which makes it work also when they are used as interface language (note that [lang="xx"] is not yet present on wikitext content by default but will be soon as part of my work on RTL improvements)
* 'quickbar' => 2; by RTL languages. For this, I introduced a new option (5) that sets left/right according to the directionality of your interface language (and automatic is better than setting it in MessagesXx files!). Note that the broken feature was in this case "corrected" by CSS flipping, causing preferences to say "left" while it was actually "right". This commit fixes that bug as well.
Third, it actually would have made more sense to have it them load for wgLang instead of wgContLang, but that's not possible because wgLang is itself dependent on preferences
2011-07-05 01:26:49 +00:00
Sam Reed
296f3d3f4f And even more documentation 2011-05-28 18:59:42 +00:00
Mark A. Hershberger
c152979d1f clean up eol w/s 2011-04-25 02:20:04 +00:00
Brion Vibber
8ee5e02054 Followup to r85706 and friends: now that Math messages have been moved to extension, move out the settings list and constants.
* MW_MATH_* constants are now defined in Math extension
* Language::getMathNames() is removed
* mathNames section in message files is removed
* A hardcoded preference override in refreshLinks moved to MaintenanceRefreshLinksInit hook
2011-04-09 19:57:35 +00:00
Tim Starling
1e67922842 Followup for r81340:
* Allow any language code which consists entirely of valid title characters, and does not contain any path-traversal characters, to be customised via the uselang parameter. Language::isValidCode() represents this concept. 
* Add some shortcuts preventing Language and LocalisationCache from looking for localisation files for a language code which does not follow the usual form of language codes in MediaWiki, i.e. /[a-z-]*/. This concept is represented by Language::isValidBuiltInCode().
* Do not allow colon characters in file names, per Platonides' suggestion on CR.
2011-02-28 03:15:39 +00:00
Tim Starling
3bc410efa7 * Fix for r81960: List the local magic word synonyms first, so that they will be returned by $magic->getSynonym( 0 ). Apply array_values() to fix up the keys, potentially corrupted by array_unique().
* In MagicWord::initRegex(), put the longest synonyms first in the alternation. This means that when one synonym is an initial substring of another, the longest one will match in precedence, which is generally in line with user expectations.
2011-02-16 07:24:36 +00:00
Niklas Laxström
7694c67c99 * (bug 17160) Gender specific display text for User namespace
Second attempt for this thing..
2011-02-12 20:40:40 +00:00
Tim Starling
9a38d22579 Since 1.17 a whole lot of extensions have sprouted *.i18n.magic.php files. Most of these files have entries which erroneously omit the English synonym for a magic word. This breaks the extension completely when an affected language is selected.
This patch automatically includes synonyms from the fallback localisation, and prevents the case flag from being overridden, thus making extensions resistant to translator error.
2011-02-11 11:53:00 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Sam Reed
7bff03b3ad Remove public from interface defintion, as decleration in an interface is not valid 2010-12-15 11:30:54 +00:00
Trevor Parscal
ea8b855c2e Followup to r72349: fix database error caused by update.php indirectly (via LocalisationCache::recache() and MessageBlobStore::clear()) trying to clear out the msg_resource table before it's even created it. 2010-09-04 07:54:55 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Roan Kattouw
e46c9a91fd Build preload l10ncache after running hooks, not before, so extension changes (by e.g. LocalisationUpdate) to preloaded messages get picked up. 2010-03-08 14:43:02 +00:00
Tim Starling
e667605c8a Made Special:Allmessages many times faster for a typical installation, by taking advantage of the message name list available from LocalisationCache to avoid unnecessary message loads. Now it only loads messages that are on the current page being displayed. 2010-01-06 05:48:05 +00:00
Tim Starling
33ce9783f5 (bug 20837) Don't give a PHP notice when getSubitem() calls loadSubitem() which causes the whole item to be loaded. In this case there is no negative cache value stored so we need to use isset(). It was handled already for the case where the item was already loaded at function entry, but not for the case where the item is loaded halfway through loadSubitem(). 2010-01-06 04:08:59 +00:00
Max Semenik
8c4e1d2a57 Fixed variable name in error message 2009-11-13 11:16:42 +00:00
Roan Kattouw
7c7909f108 (bug 20773) Disabling LocalisationUpdate breaks stuff. Added a check that verifies each dependency object is a CacheDependency before using it, and considers the cache expired otherwise. 2009-09-23 13:51:47 +00:00
Tim Starling
d26d659ef1 Fix disabling of APC cache when loading message files: apc.enabled has been PHP_INI_SYSTEM since 3.0.13 but apc.cache_by_default works. This reduces the required APC cache space by about half on my test wiki, from 20MB to 10MB. 2009-09-04 03:41:25 +00:00