Commit graph

2008 commits

Author SHA1 Message Date
Timo Tijhof 4615338a51 Implement getInterfaceTextInLanguage and use API and Parser
Fallback for user language and content language is easiest to
resolve server-side. Also saves sending a lot of data to the
client that it doesn't need. Similar to how ResourceLoader only
sends 1 set of message values.

Bug: 50431
Bug: 52922
Change-Id: If8317ed6522a05d5a48a210ff43c97277b950a97
2013-10-07 19:26:59 +02:00
Translation updater bot 5fb125284c Localisation updates from http://translatewiki.net.
Change-Id: I3de92aed0cf72047bfa981da52fba3e59ca7b15f
2013-10-06 18:50:08 +00:00
Translation updater bot f5964289ba Localisation updates from http://translatewiki.net.
Change-Id: Ie64232e08663cfd0bf99182cb5c4146e5f22d9eb
2013-10-03 18:14:31 +00:00
Translation updater bot ced57d2f06 Localisation updates from http://translatewiki.net.
Change-Id: I0cc8f7f8d30e88de45eb86066319798c8c15dac3
2013-10-02 14:28:14 +00:00
Translation updater bot 5966ee9e4c Localisation updates from http://translatewiki.net.
Change-Id: Id8350bee1c7e1708987f3ba853dac2b4a43a7155
2013-10-01 19:24:16 +00:00
Translation updater bot c7a3c83ff5 Localisation updates from http://translatewiki.net.
Change-Id: I3ed4339d635c48157a85d62f20bbea1109fe233c
2013-09-29 20:17:05 +00:00
Timo Tijhof f8eb557a64 Account for absence of template description in #getHtml
The description property is optional and is explicitly set to
null by the parser in normalisation if there is none.

The HTML rendering of parameter descriptions (as oppposed to the
description of the template as a whole) already covered for this.
Used the same logic for the template parameter.

Also fixed:
* Localize the text "no description"
* Use !== null instead of isset() since the property is always
  set, we just need to know whether it is null or an object.

Bug: 54422
Change-Id: I86a40dbd1225feb54123e77a856b4ad6d525461b
2013-09-25 20:23:46 +00:00
Timo Tijhof 3ab2b4439a Re-add version_compare (>= 1.22wmf18)
Follows-up 98cf7e35e.

Change-Id: I07a63effb5cdb14e48c6b69780fe71dc24f17fd9
2013-09-20 00:57:00 +02:00
Reedy 98cf7e35e3 version_compare sucks
Change-Id: I13c2eaae2dbf2d4a4f77e17f601a735a5b0d24b0
2013-09-19 19:47:03 +01:00
Timo Tijhof fc9da6c7bf Remove global function gzdecode fallback
Moved into MediaWiki core (as of 1.22alpha) in change f72117e768.

Change-Id: I6383e933b10d8fca2a855c6b3e287264b176abb8
2013-09-19 08:14:06 +00:00
MatmaRex 7bf85a39a1 Remove all references to TemplateInfo
Change-Id: I5ffc8f75140a2c372fc1c64509b13a534fe07479
2013-09-12 11:41:07 +02:00
Antoine Musso 8dc157bc09 Test gzdecode() in TemplateDataBlob::newFromDatabase()
gzdecode() has been introduced in PHP 5.4 although gzencode() has been
there for a while.  Wikimedia is still using PHP 5.3, so the
TemplateDataBlob::newFromDatabase() would trigger a fatal error whenever
it is passed compressed JSON :-(

The test does not fix the root cause (that needs a fallback function in
the TemplateData extension), but it does highlight the issue in PHP 5.3.x.

Updated a @return comment, correcting the class being returned.

bug: 54058
Change-Id: I8357b474165f4317982b9c924cf0afe68650d677
2013-09-12 04:14:40 +00:00
Reedy 0e4339da86 Add fallback for gzdecode (only exists in PHP >= 5.4.0)
Bug: 54058
Change-Id: I62a843aec4657a3d4895d34535cc2be42d4552fd
2013-09-12 03:55:35 +00:00
Translation updater bot db3d942b69 Localisation updates from http://translatewiki.net.
Change-Id: I2e1ede7d148f8655cabde41365bb8a47da10b388
2013-09-09 19:29:34 +00:00
MatmaRex d66b4c6090 Store compressed JSON since size is limited
We only have 65535 bytes, let's use them wisely.

Prior to Ib2db241a in core (1.22wmf12) even binary page properties
were sometimes shown as plaintext (e.g. on Special:PagesWithProp).
Thus this introduces a "soft dependency" on that change.

No backwards-incompatible changes were made in public methods.
Added two new ones:

* Add TemplateDataBlob#getJSONForDatabase which returns compressed
  JSON, use it where applicable.
* Add TemplateDataBlob::newFromDatabase which accept compressed and
  uncompressed JSON, use it where applicable.

Use a long pseudorandom string in the test.

Bug: 51740
Change-Id: Ie66b0dd6b6dab6f8648e78595c41e52d9c704d57
2013-09-04 22:52:02 +00:00
Timo Tijhof 1f5705aa23 Fix phpcs errors
Configuration for phpcs was changed to now require spacing
of ternary to be at the end of the previous line.

Change-Id: I8a358053a9ccf4ec83bfd8db1383fce12d9d9f2f
2013-09-04 15:49:27 -07:00
Translation updater bot a729731fb9 Localisation updates from http://translatewiki.net.
Change-Id: I024ca92f7b925d06d7ef221a7c07ec091843e87f
2013-09-01 19:27:43 +00:00
Translation updater bot dd13dfc6bd Localisation updates from http://translatewiki.net.
Change-Id: I30afbe36918e9d8cfab596899ef6559c66a37f2a
2013-08-30 19:25:23 +00:00
Translation updater bot 6e33d0bf86 Localisation updates from http://translatewiki.net.
Change-Id: I4a5b5fd6987e57c86a7f2bddc7e50038941b5479
2013-08-29 19:22:20 +00:00
Translation updater bot f3724eee4a Localisation updates from http://translatewiki.net.
Change-Id: Idf7e94dd685508f32b2b6c766a4f6f3b9ab8224f
2013-08-25 20:07:28 +00:00
Translation updater bot 139a33c720 Localisation updates from http://translatewiki.net.
Change-Id: Ia37feb0e391e4a8fc7b7c28ebe0e8cb03b91fbc0
2013-08-22 19:49:44 +00:00
Translation updater bot d1cac29a90 Localisation updates from http://translatewiki.net.
Change-Id: I4b77912822de049f6cb4ffdb615293a5bd47c0a4
2013-08-17 19:25:07 +00:00
Translation updater bot 06bb6da115 Localisation updates from http://translatewiki.net.
Change-Id: I4fbb3b4efef0938a8885c1afce4125d50e73dea0
2013-08-09 19:47:20 +00:00
Translation updater bot 3978bc3b67 Localisation updates from http://translatewiki.net.
Change-Id: Id64d7aa9bb7c179fa5cb8198b5a5b6aba3827ac5
2013-08-07 19:46:29 +00:00
Translation updater bot bfaa905839 Localisation updates from http://translatewiki.net.
Change-Id: If2a3356920072f92c3d1691cb236a00911f3db25
2013-08-06 19:30:04 +00:00
Translation updater bot f634ee9998 Localisation updates from http://translatewiki.net.
Change-Id: I35582d22cdc10cbbb8ace21f875b78e631f6b935
2013-08-05 19:39:12 +00:00
Translation updater bot f048ea613c Localisation updates from http://translatewiki.net.
Change-Id: I8f57e162e4bebf653e9e0768fea882f5e6bd03af
2013-08-04 18:56:09 +00:00
Translation updater bot b8d1fc39ef Localisation updates from http://translatewiki.net.
Change-Id: Iaee862f505135489fb6e8d48ca97f3afa4104460
2013-08-03 19:45:22 +00:00
Translation updater bot 877de81d51 Localisation updates from http://translatewiki.net.
Change-Id: Icaf07b52be9ce3d407c3565a265442757690e538
2013-08-02 21:38:41 +00:00
jenkins-bot 18663c27eb Merge "Use ParserOptions language instead of RequestContext language" 2013-08-02 19:33:21 +00:00
MatmaRex 6281fe626f Bail when JSON length exceeds database limits
This might not be necessary on non-MySQL databases, but I'm sure that
at least their limits aren't lower than MySQL's, so let's stay on the
safe side.

Bug: 51740
Change-Id: I9c7115a951f126844bc70755bff12e8cd5fc2be1
2013-08-01 23:39:47 +02:00
Timo Tijhof 088d67b61f Use ParserOptions language instead of RequestContext language
The context user language is correctly set to that of the user
who is saving the page.

Parser options are set to the default language during saving and
only changed to the user language when viewing the page with
a uselang that is not the default wiki language.

As a result we were saving the user language (e.g. French) on
en.wikipedia.org as the canonical version on-save and only changing
it to the correct language for non-English viewers.

To test:
* Wiki set to 'en', user preference language to 'nl'
* Save a page with templatedata
* View it logged-out without a uselang query

Was 'nl', is now 'en'.

Bug: 52419
Change-Id: Ic8b5b63450c9f80b85a95d16cc81ce62fc96b77f
2013-08-01 23:18:00 +02:00
Timo Tijhof 23c984425c TemplateDataBlob: Use "new stdClass()" instead of "(object) array()"
Change-Id: I374e153c7e9e8451e1399537d0206bdec52b135c
2013-07-31 23:56:26 +00:00
Translation updater bot 051aefe194 Localisation updates from http://translatewiki.net.
Change-Id: I22b3f6950eefa8b2e41244282611a642835ab482
2013-07-31 20:00:21 +00:00
TheDJ 454fb57fdd Merge "ApiTemplateData: Fixed a typo in error message" 2013-07-29 21:46:22 +00:00
Translation updater bot f4974ff1ed Localisation updates from http://translatewiki.net.
Change-Id: I3ad910ec679118f2ef5d91e8c63d6f8a9ffd6ed8
2013-07-24 19:56:48 +00:00
Translation updater bot f28c181499 Localisation updates from http://translatewiki.net.
Change-Id: If42359aa23a300d4be79cdceef3b233b5ffb2955
2013-07-23 18:43:53 +00:00
MatmaRex 6887e01e6e ApiTemplateData: Fixed a typo in error message
Change-Id: Ib273c89dd5981e6ac613ed3901ec91b19ad767be
2013-07-23 16:26:58 +02:00
aude f41e9d57cf Fix api help url
Change-Id: I49da3832e4905e659fd3d4f33b5470e48a3ccab6
2013-07-15 00:15:04 +00:00
Translation updater bot 831c0401fd Localisation updates from http://translatewiki.net.
Change-Id: I7345723476ac5dec39156b81eb1ea2914713980e
2013-07-14 19:19:14 +00:00
jenkins-bot a7887c43d4 Merge "Add specialized short-form string/line type" 2013-07-12 17:35:25 +00:00
Mark Holmquist 53e48a98d5 Add specialized short-form string/line type
This is to help differentiate between <input type="text" /> and
<textarea> fields. We need this for UploadWizard in particular because
we intend to build a form for the Information template on Commons, and
it has both small fields (for which we'll use <input>) and big ones
like description (for which we need <textarea>).

Change-Id: Ib9b381816d18f2723a9f715c54f6a64ff4b69847
2013-07-11 17:04:42 -07:00
Translation updater bot 06ec95de0f Localisation updates from http://translatewiki.net.
Change-Id: Ia053078cd97daf2069466b28ec7060ade6bf78ff
2013-07-07 19:45:47 +00:00
Translation updater bot 3a549c215a Localisation updates from http://translatewiki.net.
Change-Id: I25fc976c589b1c3cb7ea5c43f6ed3b8eb3af889e
2013-07-06 19:04:02 +00:00
Translation updater bot 913460f0e2 Localisation updates from http://translatewiki.net.
Change-Id: Idb0f3d62b8208585c8736bf1c605f164fd26ee81
2013-07-01 20:00:02 +00:00
Translation updater bot bee15b9939 Localisation updates from http://translatewiki.net.
Change-Id: I1118a1372ff4d08fcb17ef3e4239074cd9dce579
2013-06-28 13:58:00 +00:00
Translation updater bot 959034d021 Localisation updates from http://translatewiki.net.
Change-Id: I99eac12dc6f09deab0b37cce69470b11241f35a9
2013-06-27 19:55:56 +00:00
Translation updater bot 0c5eeafc1a Localisation updates from http://translatewiki.net.
Change-Id: Id929486fba172e419b6ad2ab6595115061fbb175
2013-06-25 19:58:17 +00:00
Translation updater bot 393f138434 Localisation updates from http://translatewiki.net.
Change-Id: Ia8adc7edd2128fbbe5316b27ec26f30d901f4974
2013-06-20 19:00:02 +00:00
Translation updater bot a66c67181f Localisation updates from http://translatewiki.net.
Change-Id: If50900abf7925388542a4910b487104d9b104feb
2013-06-12 19:58:44 +00:00