]> Cypherpunks repositories - gostls13.git/commit
exp/locale/collate: changed API to allow access to different locales through New(),
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 14 Sep 2012 10:10:02 +0000 (19:10 +0900)
committerMarcel van Lohuizen <mpvl@golang.org>
Fri, 14 Sep 2012 10:10:02 +0000 (19:10 +0900)
commita4d08ed5dfe23f5b0d777548410456fbb517478c
treeb305e710dabdbf744e65bea5623af95b5665e3d5
parentdb3c800d19a394d76531f001dbb09e13a6630712
exp/locale/collate: changed API to allow access to different locales through New(),
instead of variables. Several reasons:
- Encourage users of the API to minimize the number of creations and reuse Collate objects.
- Don't rule out the possibility of using initialization code for collators. For some locales
  it will be possible to have very compact representations that can be quickly expanded
  into a proper table on demand.
Other changes:
- Change name of root* vars to main*, as the tables are shared between locales.
- Added Locales() method to get a list of supported locales.

R=r
CC=golang-dev
https://golang.org/cl/6498107
src/pkg/exp/locale/collate/build/builder.go
src/pkg/exp/locale/collate/build/table.go
src/pkg/exp/locale/collate/collate.go
src/pkg/exp/locale/collate/maketables.go
src/pkg/exp/locale/collate/table.go
src/pkg/exp/locale/collate/tables.go