| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Depending on which namespace we want these classes to have after
T166010 they could either stay in includes/languages/ (plural) in
their own MediaWiki\Languages\-namespace dedicated to Language
subclasses, or they could go in into a subdirectory like
`includes/language/languages/` if we want to keep them in the same
top-level namespace as other Language classes and services, but in
a more nested namespace.
For now, I've made the smaller change and kept the Language subclasses
in their own directory directly under includes/, not nested further.
Bug: T225756
Change-Id: I01015424707b442853879fd50c97f00215e5c2fa
|
|
|
|
|
| |
Bug: T226833, T243760
Change-Id: I6fc7f267098d663fbefd0e78457726c343c9b3e4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Done:
* Replace LanguageConverter::newConverter by LanguageConverterFactory::getLanguageConverter
* Remove LanguageConverter::newConverter from all subclasses
* Add LanguageConverterFactory integration tests which covers all languages by their code.
* Caching of LanguageConverters in factory
* Make all tests running (hope that's would be enough)
* Uncomment the deprecated functions.
* Rename FakeConverter to TrivialLanguageConverter
* Create ILanguageConverter to have shared ancestor
* Make the LanguageConverter class abstract.
* Create table with mapping between lang code and converter instead of using name convention
* ILanguageConverter @internal
* Clean up code
Change-Id: I0e4d77de0f44e18c19956a1ffd69d30e63cf51bf
Bug: T226833, T243332
|
|
|
|
| |
Change-Id: I5db62d8243ce3abd7c442de10d6143de6dd1aad3
|
|
|
|
| |
Change-Id: I9dd10bbf81d277865301eccde73da17418df1238
|
|
|
|
|
|
|
|
| |
This only adds public for some function used outside of languages
classes.
This does not fixed all functions, just one first shot
Change-Id: I5c0ee93a0867c847b084d2ce459dbad9cddaf9fb
|
|
|
|
|
|
|
|
|
| |
Languages with variants no longer can override the parent's constructor
(which is now used for injecting services). Instead, they need to
override Language::newConverter().
Bug: T201405
Change-Id: I923400d61763cf1db88cb0c3f684c9c10e58032d
|
|
|
|
| |
Change-Id: I036434268f1e7992f7f9f23d2c1c0fcd399823c8
|
|
|
|
|
|
| |
Like suggested in https://www.mediawiki.org/wiki/Manual:Coding_conventions#Line_continuation
Change-Id: I86db3c24ffc69737c6917cfc68300ff4695961cd
|
|
|
|
|
|
| |
Also use ?? instead of ?: to check for null.
Change-Id: I058b61d7e06cdefecdafa82f60109cc386e2a809
|
|
|
|
|
|
|
|
| |
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files
Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously various language objects would install a hook to update the
shared conversion table cache when the object was constructed. This is
not a good idea since language objects may be constructed even when they
are not the content language, but only the content language is
associated with variant conversion and the conversion cache.
Instead, have WikiPage call a method on $wgContLang directly. I put this
with message cache update since the logic is almost identical.
Change-Id: Ief9c0ef993e39645e74a6e158cb4e6e2139ce91d
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move ZhConversion.php and Names.php to languages/data and make them both
expose their data as static class variables instead of in the local
scope. This means that the autoloader can be used to load the data,
which is efficient and secure. This also makes additional request-local
caching of the arrays unnecessary.
Change-Id: Iafb96ac4165d0965fcb9a69f1d0a91139ea9790c
|
|/
|
|
|
|
|
|
| |
Remove require_once for LanguageConverter and base classes. These
are in the autoloader now, so an explicit require is no longer
necessary.
Change-Id: Ie34ffc58fd9ec89fb57cf077dd5ac1746c35c48e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Chinese conversion table is substantially updated to fix a lot of
bugs reported in recent years, and the script generating conversion
table (LanguageZh.php) is also modified to facilitate the maintenance.
Zh-sg and zh-my is set to fallback to zh-cn to improve reading
experience, since there is only trivial difference among them, just like
zh-hk and zh-mo. Further optimization for zh-sg and zh-my will be
performed in local conversion table of Chinese WikiProjects.
Bug: T91620
Change-Id: I1bb0315d6d7a2c9653905654d933942e362bcc42
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Apply the conversion variants from specific zones before zh-hans
and zh-hant, to allow fitting specific linguistic habits before
falling back to the generic ones. The actual rules will be added
in a followup patch.
Previously, the zh-cn table was composed by:
(1) Load zh2Hans as zh-hans table
(2) Load zh2CN + zh2Hans as zh-cn table
(3) Load Conversiontable/zh-hans + zh-hans as zh-hans table
(4) Load Conversiontable/zh-cn + zh-cn as zh-cn table
(5) Load zh-hans + zh-cn as the final zh-cn table
The new loading order is:
(1) Load zh2Hans as zh-hans table
(2) Load zh2CN as zh-cn table
(3) Load Conversiontable/zh-hans + zh-hans as zh-hans table
(4) Load Conversiontable/zh-cn + zh-cn as zh-cn table
(5) Load zh-cn + zh-hans as the final zh-cn table
Change-Id: Ie9d08b85d4911618946fa7efd23eb898412449e5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.
Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.
Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
|
|/
|
|
|
|
|
| |
- Makes beginning of @param in capital
- Removed return void
Change-Id: Ie05436c1ef886cb23c62ccde95384f253f83694c
|
|
|
|
| |
Change-Id: I0985f3c7e4b36338c68a4a63cfba4eaa4af567c0
|
|
|
|
|
|
|
|
| |
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: I7a4dec6a8de96ee21ef34e52bb755f723aa3b0e6
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.
Also updated usage in text in documentation and the
installer LocalSettingsGenerator.
Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;
Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
|
|
|
|
|
|
|
| |
Added spaces before if
Added some braces for one line statements
Change-Id: I980771894369499646532b13b801db6447381773
|
|
|
|
|
|
|
|
|
| |
This is deprecated as of PHP 5.5, and the remaining uses are quite
silly. Tim said I should remove his easter egg from Special:Version,
as it already was broken, and a new one can be added in a separate
commit.
Change-Id: I0f09f4efc7afe5933c8317462026a475530a5324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* IRIs are getting more and more widely used these days so Chinese
characters are also needed to be prevented from being converted
in text of external links.
* So now all markNoConversion() functions in languages with variants
do the same thing. Merge them into a single function in the
Language class and drop implementations in individual languages.
* By the way rephrase phpdoc of that function, and (bug 24798) fix
the link detection regex to use wfUrlProtocolsWithoutProtRel().
Protocol-relative regex is excluded to avoid false positives.
* Add parser test for it.
Change-Id: I2ec0ac2b9b11221584adb72555168498de209d57
|
|
|
|
|
|
|
|
|
| |
Covers 3 hooks:
* ArticleContentInsertComplete -> PageContentInsertComplete
* ArticleContentSave -> PageContentSave
* ArticleContentSaveComplete -> PageContentSaveComplete
Change-Id: I186669a5941d8982725ed364b481215d291b2043
|
|
|
|
| |
Change-Id: Ic01fd95d50a909470d6f0ffd93c972322789d49a
|
|
|
|
| |
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
|
|
|
| |
This reverts commit 67bfdc7a68940d901e585eadd984a2074bf0216a
|
|
|
|
| |
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
|
|
|
|
|
|
| |
Also made file/class documentation more consistent.
Change-Id: I162f57c994765189681ac3fb30f889e648c6c6a1
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/89118
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/70131
|
|
|
|
|
|
|
|
|
| |
title like "User_talk:Example".
2. Improve the function of namespace conversion. Allow admins to custom namespace conversion in MediaWiki's messages([[MediaWiki:conversion-nsX]]).
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/69081
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/61859
|
|
|
|
|
|
|
| |
stripForSearch into wordSegmentation and normalizeForSearch. So the wordSegmentation could be called by search engines separately.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/61856
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rewrote convertArray() as an RD parser (with inline tokenizer) as suggested on CR r60986. Fixes unclosed rule issue (with parser test). Fixes O(N^2) timing.
* Removed $this->mMarkup abstraction. Life is complicated enough as it is.
* Replaced a couple of instances of explode() with StringUtils::explode(), limited element count in a couple more.
In ConverterRule:
* Removed mConvTable initialisation from the constructor, unnecessary
* Optimised the "-{xxx}-" tight loop by replacing function calls such as count() and in_array() with language constructs such as isset(). Reduced execution time from 356us to 275us.
* Cached $varsep_pattern for further reduction to 243us.
* A couple more parseFlags() hacks brings it back to 230us.
* Split out $this->mVariantFlags from $this->mFlags. Rearranged flag detection into a foreach/switch to avoid unnecessary isset() calls. 189us.
* Added a special-case optimisation to generateConvTable() for the case where there are no tables defined inline in the article. 116us.
* Fixed bug from r37499: "!R || !N" is always true since they are mutually exclusive, "!R && !N" was intended (with parser test).
* Fixed E_NOTICE from "-{N|foo}-"
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/61233
|
|
|
|
|
|
|
|
| |
1. Changed the conditions, not only for LuceneSearch, but also more commonly to others.
2. Reduced code duplication.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/60764
|
|
|
|
|
|
|
| |
2. Add double-width roman characters conversion support to zh, gan, and yue.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/60743
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/56459
|
|
|
|
|
|
|
| |
causes unstub loops
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/56458
|
|
|
|
|
|
|
| |
2. Patch for situations that some wikis like zhwikisource may disabled some language variants. We should treat these disabled variants unacceptable in LanguageConverter.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/55415
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Chinese
Big fixup for Chinese word breaks and variant conversions in the MySQL search backend...
- removed redunant variant terms for Chinese, which forces all search indexing to canonical zh-hans
- added parens to properly group variants for languages such as Serbian which do need them at search time
- added quotes to properly group multi-word terms coming out of stripForSearch, as for Chinese where we segment up the characters. This is based on Language::hasWordBreaks() check.
- also cleaned up LanguageZh_hans::stripForSearch() to just do segmentation and pass on the Unicode stripping to the base Language implementation, avoiding scary code duplication. Segmentation was already pulled up to LanguageZh, but was being run again at the second level. :P
- made a fix to Chinese word segmentation to handle the case where a Han character is followed by a Latin char or numeral; a space is now added after as well. Spaces are then normalized for prettiness.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/52338
|
|
|
|
|
|
|
|
|
| |
wiki with
LanguageConverter class)
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/48015
|
|
|
|
|
|
|
| |
2. New function to convert namespace text for display. (only applies on wiki with LanguageConverter class)
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/46913
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://translatewiki.net.
PHP Notice: Undefined property: FakeConverter::$mMainLanguageCode in /var/www/w/languages/Language.php on line 2230
PHP Notice: Undefined property: FakeConverter::$mVariants in /var/www/w/languages/Language.php on line 2233
PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /var/www/w/languages/Language.php on line 2233
PHP Notice: Undefined property: FakeConverter::$mMainLanguageCode in /var/www/w/languages/Language.php on line 2234
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/46526
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/46523
|
|
|
|
|
|
|
|
|
|
|
|
| |
extensions."
Uses $dir in extension files, and assumes that it remains unchanged in require_once( 'maintenance/commandLine.inc' ).
In fact, it is likely that '$dir' will be set when setting up command-line, as some extensions will use the same var.
Recommended fix: Use $CentralAuth_dir, $EmailPage_dir, etc.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/44056
|