Commit graph

13 commits

Author SHA1 Message Date
Timo Tijhof
339ca89b18 resourceloader: Support hashes as cache invalidation trigger
For now ResourceLoader will still internally deal with timestamps,
especially because they are easier to max() on the client side
(on the server we could make a hash of different hashes, on the
client that's a bit annoying).

However ResourceLoaderModule#getHashMtime will abstract the logic
we already use in ResourceLoaderLanguageDataModule and have
encouraged others to use, which is to put the timestamp and
hash in Memcached, and use that to observer the hash change and
update the timestamp when it does.

Updated ResourceLoaderLanguageDataModule to make use of this.

Change-Id: Ib051ef41ba239084671c30fd275b8d94099d5d52
2013-10-07 23:00:38 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Santhosh Thottingal
8af7462d3a Commafy support for convertNumber
As per http://www.unicode.org/reports/tr35

Change-Id: I765298959ad10ea8561abfea487328c8ddeb39f0
2013-02-21 11:16:26 +05:30
Juliusz Gonera
c2d117b379 Add mobile target to modules needed for mw.msg()
This changes allows us to use mw.msg() in MobileFrontend.

Change-Id: I446656bcc17a31d23da054a6e1154f3e5823fbf5
2012-12-17 16:24:02 -08:00
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
Santhosh Thottingal
f47dfe9939 Remove duplication of Langauge digitTransformTable in javascript.
Use the new ResourceLoaderLanguageDataModule for passing the digit
transform table and digit separators (comma or dot) from the PHP
classes. And remove the duplicative javascript files so we no longer
have to maintain changes to MessagesXYZ.php and languages/xyz.js.

Change-Id: Icf63ebf927f993fe04518c4afe3a0b6959f5b1bd
2012-06-18 00:05:24 +02:00
Timo Tijhof
1f5925f395 mw.language: Document ability to set multiple values at once.
* ResourceLoaderLanguageDataModule uses this but it looked
  a bit like an error when looking at the function signature
  of setData.

  This is the power of mw.Map.

* Fixed indention as well.
* Added missing semi colon.

Change-Id: I1e9e8254862ae08e9a11e55dd42d7e851a56a3cc
2012-06-09 17:47:41 +02:00
Timo Tijhof
59a390c8b1 ResourceLoaderLanguageDataModule: clean up
Change-Id: Id64e7ec8f22cc74926ff374ca207bf19552398aa
2012-06-06 22:07:29 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Santhosh Thottingal
4c6c50f206 Reverse the dependency for mediawiki.language.data
* Previously mediawiki.language.data depended on mediawiki.language,
  making any module using langauge data having to explicitly define
  it as a dependency. This is not good. We should abstract the data
  generation part and for the users of the module.
  mediawiki.language should take care of having the required data.

* So, reversing the dependency so that mediawiki.language depends on
  mediawiki.language.data. Then a simple dependency declaration with
  "mediawiki.language" is enough to have associated data available.

This supersedes change set I810fb0a5

Change-Id: Iede836bb3e2fd700cb7c58caeebe9ec2e0043dfb
2012-06-05 15:54:27 +02:00
Alexandre Emsenhuber
7d9016943d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1815587ab2eeb24623ce4bf1c695088bd3f1c2ea
2012-04-30 09:16:10 +02:00
Santhosh Thottingal
931c31c7bd (bug 33658) support for {{GRAMMAR:}} in jqueryMsg
This add GRAMMAR support to the mediawiki.jqueryMsg module:

1. make jqueryMsg understand GRAMMAR(case insensitive)
2. mw.language get convertGrammar, can be overridden per language as in
   php
3. Introduce resourceloader module ResourceLoaderLanguageDataModule
4. Language.php get a method to filter wgGrammerForms for the current
   contentLanguage.
5. Qunit tests
6. This code was originally written in jsgrammar branch of svn and had
   reviewed during the last slush time.

Change-Id: I90dd0b2f0cb30fd30539896c292829adc4fc7364
2012-04-10 11:47:39 +02:00