Commit graph

10 commits

Author SHA1 Message Date
C. Scott Ananian
d7b2fe4d46 language: Clean up $separatorTransformTable in km/la/my
LanguageKm and LanguageMy defined overrides for ::formatNum()
which did nothing -- but what they really wanted to do was just to
suppress separators.  Do that in the 'modern' way by invoking
::formatNumNoSeparators().

MessagesLa and MessagesKm defined $separatorTransformTable for one but
not both of the keys `.` and `,`.  Add defaults to
Language::formatNum() to handle this case without burping out a PHP
notice.  Use belt and suspenders by also defining an identity mapping
for '.' in MessagesLa::$separatorTransformTable.

Bug: T267091
Change-Id: I0169606ca1e211d241fa71f23ee0a16edc64b7ae
2020-11-05 03:30:05 +00:00
Santhosh Thottingal
ce8d0e9599 Update formatNum implementation to match tr35 and latest CLDR
* Update digitGroupingPattern to match CLDR 31: New versions of CLDR has
  digit grouping pattern with decimal part. Update digitGroupingPattern
  values in Message classes with this improved pattern.
  Refer: http://unicode.org/reports/tr35/tr35-numbers.html

* Refer the following chart for the decimal patterns.
  http://www.unicode.org/cldr/charts/31/by_type/numbers.number_formatting_patterns.html

* Uses PHP NumberFormatter class for the commafy implementation, which
  is available in PHP 7.

* Some tests need to update to match the TR 35 spec

* The formatNum public method in Language.php is the preferred way to
  use this feature. It does separator transformation and digit transformation
  wherever applicable.

* Renamed the second param name for formatNum from noCommafy to noSeparators

* commafy method is deprecated and formatNum is preferred. Practically,
  we are not just adding comma, but seperators according to the language.
  Replaced some tests based on commafy methods with tests based on formatNum.

Note: The corresponding js implementation is not changed in this commit.
It would probably be a good idea to use globalize.js, which is also based
on the CLDR patterns.

Note: This patch preserves the existing off-by-one error in
$minimumGroupingDigits; T262500 will eventually fix this.

Bug: T167088
Co-Authored-By: C. Scott Ananian <cscott@cscott.net>
Change-Id: Ic721b9a91e78e4ef07040339d1006b7a90a910c0
2020-10-21 10:08:04 -04:00
Umherirrender
844c6db2b6 Set method visibility on languages classes
Change-Id: I5db62d8243ce3abd7c442de10d6143de6dd1aad3
2019-12-09 16:37:38 +00:00
Amir Sarabadani
9850c542c6 Clean up array() syntax in docs, part VII
Last part

Change-Id: I38f015e2122ef4fd2d2141718bd889794c29f06c
2016-09-27 06:53:25 +03:30
umherirrender
55e8a9abfd Fixed some @params documentation (languages)
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
2014-04-17 13:32:54 +00:00
Alexandre Emsenhuber
1e69ac22e2 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I4228ed95446558db71e9084e7d505fc0b783fa53
2012-06-08 22:43:32 +02:00
Sam Reed
117fb34efc Some language love 2011-05-29 15:21:03 +00:00
Alexandre Emsenhuber
0ef95c5586 Added description to language classes 2010-10-10 12:53:37 +00:00
Sam Reed
e476b51e3a Stylize languages/*, languages/classes/*, but not languages/messages/* 2010-07-29 09:43:18 +00:00
Niklas Laxström
e0e0b5e019 * Number and date formats for my requested by Hintha@Betawiki 2008-07-29 16:13:49 +00:00