Commit graph

2028 commits

Author SHA1 Message Date
Chiefwei
d1989b857f Chinese Conversion Table Update 2021-2
Update the Chinese conversion table routinely to fix bugs reported at
https://zh.wikipedia.org/wiki/Wikipedia:字词转换/修复请求.

It is only data changes and only works for Chinese WikiProjects.

Change-Id: I14fc68ae8f6792e24127aaa93f6fe7aa1f786a26
2021-09-20 12:31:57 +08:00
jenkins-bot
224efbdfe1 Merge "Remove dead variables and functions and unneeded parenthesis" 2021-08-17 07:25:24 +00:00
jenkins-bot
f327fb73bb Merge "Remove trailing dot/space from some exception messages and output strings" 2021-08-16 17:40:55 +00:00
Chiefwei
e46a978f06 Chinese Conversion Table Update 2021-1
Update the Chinese conversion table routinely to fix bugs reported at
https://zh.wikipedia.org/wiki/Wikipedia:字词转换/修复请求.

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Ibb306188daa8c1fb97ae45d07f44022c35f46115
2021-08-15 03:39:10 +00:00
Umherirrender
b4bd3d4ee8 Remove dead variables and functions and unneeded parenthesis
Found by sonarqube

Change-Id: I3464d25e94d98aaca55d9209d5175542b335f994
2021-08-13 21:41:59 +02:00
Timo Tijhof
e07a279a39 language: Add MediaWiki\Languages\Data namespace to PSR-4 autoloader
Bug: T225756
Change-Id: I7e30a5f5c9f3c36e8a9e3f1fb6ebebb3bbe727ab
2021-08-10 22:00:25 +00:00
Timo Tijhof
f3ef7f7f23 language: Autoload normalize data and remove transformUsingPairFile compat
* Turn normalize data into an autoloadable class and use the class name
  as key instead of a partial file name with a base directory.

* This protected function is not aimed at re-use in extensions,
  has no other usage known to Codesearch. Mark it internal,
  and remove the compat introduced by 31283f34bf.

* Update the now ten-year-old documentation comments that described
  this as "Temporary". The functionality and comment were introduced
  in 2010 by Tim with r60599 (ad19c032b0).
  Ref <https://bash.toolforge.org/search?p=0&q=temporary>.

* Replace the broken wikitech-l archive link with a working one,
  and describe the thread for easier future reference.

Bug: T225756
Change-Id: I004da1f25c19e1095d0917349f2ba8461f9f0715
2021-08-10 21:03:13 +00:00
Timo Tijhof
9a7c213682 Remove trailing dot/space from some exception messages and output strings
One exception message contained a trailing dot/space, which I removed
as well, following I935835316c0.

A very small number of exceptions and output() calls contained trailing
space, which I removed for consistency.

Change-Id: I16f48c1a051c452bbef699eb9b7476d83f8821d8
2021-08-04 02:38:48 +00:00
Fomafix
ea1b06c150 Fix various typos in documentation
Bug: T201491
Change-Id: Ifa1b84b28ea97dfb4212658b02f24ee6881c1cb0
2021-06-21 00:26:07 +00:00
Tim Starling
9c3c0b704b Use array_fill_keys() instead of array_flip() if that reflects the developer's intention
array_fill_keys() was introduced in PHP 5.2.0 and works like
array_flip() except that it does only one thing (copying keys) instead
of two things (copying keys and values). That makes it faster and more
obvious.

When array_flip() calls were paired, I left them as is, because that
pattern is too cute. I couldn't kill something so cute.

Sometimes it was hard to figure out whether the values in array_flip()
result were used. That's the point of this change. If you use
array_fill_keys(), the intention is obvious.

Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
2021-06-15 00:11:10 +00:00
jenkins-bot
41784a5f5c Merge "Chinese Conversion Table Update 2020-2" 2021-02-21 17:24:51 +00:00
jenkins-bot
d749cbdf38 Merge "Use __CLASS__/::class to define callback for array_map/_filter/usort" 2021-02-05 03:14:42 +00:00
Umherirrender
e4d1a2c8bd Use __CLASS__/::class to define callback for array_map/_filter/usort
Change-Id: I3519dd5a1ce1ea688de602190cd74755c400c717
2021-01-22 16:39:29 +00:00
daniel
47bb958f03 Deprecate premature instantiation of services.
This deprecates access to the global service container before
initialization is complete. For now, such premature access will
trigger a deprecation warning. In 1.37 we can prevent it entirely.

Bug: T153256
Change-Id: Ibd3ab32d92c9c3d3783082ab574739467c1c2ff9
2021-01-19 22:33:13 +01:00
Umherirrender
c85a43561e Improve class property documentation
Reformat existing documentation to match the format

Change-Id: I190b54b5e962f17bab6502dd1b3c02f11dc926d2
2020-10-30 10:38:58 +01:00
Chiefwei
249ce4ef1f Chinese Conversion Table Update 2020-2
Update the Chinese conversion table routinely to fix bugs reported at
https://zh.wikipedia.org/wiki/Wikipedia:字词转换/修复请求.

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Ife8aa010d7b1d77c2fe05df4bea856c4f36c464b
2020-08-02 18:14:47 +08:00
Thiemo Kreuz
70027add5d Make use of the preg_match() return value, if possible
Instead of checking if the resulting $matches array is complete, we can
safely assume it is, as long as the preg_match() call returned a
non-false value.

Note that some of these used empty() before and are actually bogus
because of this! empty() considers the string "0" to be empty. In case
of a ==0== headline that's an actual bug.

I'm also removing the `= []` initialization before the preg_match.
I understand why it was added: to make it a little more obvious that the
variable is guaranteed to be initialized. But:
* This is guaranteed by the preg_match anyway.
* Neither initializing it with null or an empty array makes much sense
  because the code below assumes so much more, e.g. that specific
  elements exist, and are arrays. Again, these guarantees are all given
  by the preg_match.

I find the additional initialization more distracting than helpful.

Change-Id: I22b192b59038d9fa51a7e6f04d8d76634ae3de73
2020-07-14 19:26:35 +00:00
MarcoAurelio
48004c1d60 Fix typo: 'avalaible' → 'available'
Change-Id: I1e3c8a4106f94fa094532874a5ad927f75f5ba76
2020-05-22 11:01:37 +00:00
Reedy
c7eb28aac9 Fix various MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: I50c7c93f1534e966224f98a835ca01f93eb9416d
2020-05-21 01:06:05 +00:00
Reedy
3b94e2af1c Narrow MediaWiki.Commenting.FunctionComment.WrongStyle
Change-Id: I95d1195f09a806910559a0c5106d472addd3dec4
2020-05-20 03:33:39 +01:00
Reedy
f648dd236e Fix PSR12.Properties.ConstantVisibility.NotFound in maintenance/
Change-Id: Ib0f081f7b278fdd3f4083fc5020bcac97f6015b4
2020-05-09 23:54:58 +00:00
jenkins-bot
6e587d0e28 Merge "language: Remove maintenance/language/languages.inc" 2020-04-16 17:04:49 +00:00
jenkins-bot
314bc27378 Merge "language: Remove maintenance/language/transstat.php" 2020-04-16 17:04:39 +00:00
Niklas Laxström
cdfd1e1891 language: Remove maintenance/language/languages.inc
Nothing uses this file or its classes anymore
according to MediaWiki code search.

Change-Id: Ie165ff887b43304ea519d8b7c0a99a2187a9137e
2020-04-16 16:45:34 +00:00
Niklas Laxström
e19f4e16a6 language: Remove maintenance/language/transstat.php
https://www.mediawiki.org/wiki/Localisation_statistics hasn't been
updated since 2015. Translatewiki.net provides up to date stats.

Change-Id: I6f9902219edb63c2df08b1e1d70826cfc3531057
2020-04-16 11:39:30 +02:00
Niklas Laxström
e62f257592 language: Remove maintenance/language/checkDupeMessages.php
It's broken, not updated for the move of translations to json files.

Change-Id: If372596d272fabba27e7379c7867f472529f588a
2020-04-15 17:22:09 +00:00
Niklas Laxström
3af1ef9c0e language: Remove maintenance/language/checkLanguage.php
Translation checks are done in translatewiki.net these days.

Change-Id: I9c9b962a3accc50e875a53cec6ef458e4bb2a6a5
2020-04-15 17:17:07 +00:00
Niklas Laxström
93e06ca81b language: Remove maintenance/language/checkExtensions.php
Broken:
ArgumentCountError from line 43 of /home/developer/mediawiki/workdir/
extensions/Translate/ffs/MediaWikiExtensions.php: Too few arguments to
function PremadeMediawikiExtensionGroups::__construct(), 0 passed in
/home/developer/mediawiki/workdir/maintenance/language/checkLanguage.inc
on line 609 and exactly 2 expected

No point fixing this, checks are done on translatewiki.net side.

Change-Id: I9f39684c2ef8479ea35ad1d60e3f1f86d88a8067
2020-04-15 17:14:35 +00:00
Niklas Laxström
50feaf5cc4 language: Stop using Languages class in maintenance/langmemusage.php
This class comes from languages.inc.

Change-Id: I046fa583b95fe3dee3690fd7ca89e0ec0b3e63aa
2020-04-15 17:12:57 +00:00
jenkins-bot
beb2c35765 Merge "Chinese Conversion Table Update 2020-1" 2020-03-05 01:46:58 +00:00
Chiefwei
2a9f94203d Chinese Conversion Table Update 2020-1
Update the Chinese conversion table routinely to fix bugs reported at
https://zh.wikipedia.org/wiki/Wikipedia:字词转换/修复请求.

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Ia51d3b51e28bedffd8a8d800409e3dbe82f95187
2020-03-03 23:26:43 +00:00
ArtBaltai
31283f34bf Reduce usage of the Language class
reduce/deprecate visibility of some members of the Language class

Bug: T243913
Change-Id: I6bad608455ceaa46f895f00dcc6380cec6d32680
2020-03-03 01:38:27 +03:00
Timo Tijhof
f575721a06 Update all use of $wgVersion to MW_VERSION
Follows-up I04628de4152dd5.

Bug: T212738
Change-Id: I718474ec0d9fd29ac2c05477f0f2493615d8aff5
2020-02-25 02:16:12 +00:00
Petr Pchelko
204fa7e509 Remove usages of deprecated Language methods
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
2020-02-16 00:45:48 +00:00
daniel
ef5d4d0970 Fix namespace for usage of StaticArrayWriter
Change-Id: I6850b47f3868e1c5f7d5a0ffcfe413df2c599031
2020-01-15 18:48:38 +01:00
Umherirrender
b4fe9c4bcc Set method visibility on maintenance scripts
Change-Id: I44c82fbe65e1d002803ce065df6563f06dd39cd4
2019-11-16 22:54:17 +00:00
Aryeh Gregor
0de9c47b50 Remove Language::factory and getParentLanguage use
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
2019-10-27 12:34:28 +02:00
Umherirrender
7363e38ddf Set public for override of Maintenance functions
The following function are set to public in the parent class and cannot
have another visibility in subclasses
Maintenance::__construct
Maintenance::execute
Maintenance::getDbType
Maintenance::validateParamsAndArgs
Maintenance::setDB

Change-Id: I0cd6514642d479aca20f1221bf673b0713c21631
2019-10-09 20:41:33 +02:00
Chiefwei
5845b5d55f Chinese Conversion Table Update 2019-3
Update the Chinese conversion table routinely to fix bugs reported from https://zh.wikipedia.org/wiki/Wikipedia:%E5%AD%97%E8%AF%8D%E8%BD%AC%E6%8D%A2/%E4%BF%AE%E5%A4%8D%E8%AF%B7%E6%B1%82 .

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Iaed40e230bd7be0656af3b24837e870743c84700
2019-09-16 22:30:52 +08:00
Chiefwei
16a901a274 Chinese Conversion Table Update 2019-2
Update the Chinese conversion table routinely to fix bugs reported from https://zh.wikipedia.org/wiki/Wikipedia:%E5%AD%97%E8%AF%8D%E8%BD%AC%E6%8D%A2/%E4%BF%AE%E5%A4%8D%E8%AF%B7%E6%B1%82 .

It is only data changes and only works for Chinese WikiProjects.

Change-Id: I95cb08470ff5fc94ca7d4508e7760ee7bde5a6c7
2019-06-10 22:44:29 +08:00
Chiefwei
f415b6e162 Chinese Conversion Table Update 2019-1
Update the Chinese conversion table routinely to fix bugs reported from https://zh.wikipedia.org/wiki/Wikipedia:%E5%AD%97%E8%AF%8D%E8%BD%AC%E6%8D%A2/%E4%BF%AE%E5%A4%8D%E8%AF%B7%E6%B1%82 .

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Id2d16722eaa837c37e8696c9dd9a2d2231af26e8
2019-04-26 23:34:57 +00:00
Giuseppe Lavagetto
287aebe189 Fix the scripts to generate ucfirst overriddes
* Fix a couple mistakes in generateUcfirstOverrides.php
* Skip surrogate codepoints as they can't be converted to json.

Change-Id: I5eddd90f7b348806d502dfbac08c367701d17f25
2019-04-18 18:28:17 +02:00
Giuseppe Lavagetto
d46835ef4f Add ability to override mb_strtoupper in Language::ucfirst
Different PHP versions treat unicode differently, and specifically some
wiki resources become unreachable if mb_strtoupper's behavior has changed.
This patch allows to introduce an override table that allows to smooth
the transition period.

It also provides maintenance scripts to generate such an override table.

Bug: T219279
Change-Id: I0503ff4207fded4648c58c7b50e67c55422a4849
2019-04-17 15:18:44 +00:00
Reedy
3f4f5eb7f2 Add use Wikimedia\StaticArrayWriter statements to maintenance scripts
Follows-Up: I022c074e8a708fb5219bc4ff4b53e7e31f60dc4b
Change-Id: Ieea214b31a6ba9cc8eb2b6bae50529d70448a872
2019-04-11 15:34:46 +00:00
Chiefwei
7316fe48a7 Chinese Conversion Table Update 2018-4
Update the Chinese conversion table routinely to fix bugs reported from https://zh.wikipedia.org/wiki/Wikipedia:%E5%AD%97%E8%AF%8D%E8%BD%AC%E6%8D%A2/%E4%BF%AE%E5%A4%8D%E8%AF%B7%E6%B1%82 .

It is only data changes and only works for Chinese WikiProjects.

Change-Id: I6d5b3c190411453673952c3557e2ea81dec885e6
2018-12-23 13:45:50 +08:00
jenkins-bot
1d5344025f Merge "Chinese Conversion Table Update 2018-3" 2018-12-10 23:55:03 +00:00
Fomafix
3ee1560232 No yoda conditions
Replace
  if ( 42 === $foo )
by
  if ( $foo === 42 )

Change-Id: Ice320ef1ae64a59ed035c20134326b35d454f943
2018-11-21 17:54:39 +01:00
Fomafix
512aa4e551 Use PHP 7 '??' operator instead of if-then-else
Change-Id: Ia86f8433f30a166d38ee63d0d1745b26740767b9
2018-10-27 23:46:13 +02:00
Chiefwei
eb34e6c89c Chinese Conversion Table Update 2018-3
Update the Chinese conversion table routinely to fix bugs reported from https://zh.wikipedia.org/wiki/Wikipedia:%E5%AD%97%E8%AF%8D%E8%BD%AC%E6%8D%A2/%E4%BF%AE%E5%A4%8D%E8%AF%B7%E6%B1%82 .

It is only data changes and only works for Chinese WikiProjects.

Change-Id: Ib9ad77bd57dd55899ce685eb2023d1ee5c739e54
2018-10-06 18:00:45 +08:00
Fomafix
5632815976 Write Latin and other scripts with captial letter
Change-Id: I16c660e54191b63cd6eb3407cb00504665930c4e
2018-10-05 18:49:08 +02:00