https://bugzilla.wikimedia.org/show_bug.cgi?id=164

--- Comment #191 from Philippe Verdy <verd...@wanadoo.fr> 2010-07-26 19:07:34 
UTC ---
In all this discussion it appears that the development can be made in two
separate projects developped independantly.

You can continue to develop the SQL schema extension, provided that:

- you call a PHP function/method that will be developped separately in a
"Collator" class, to compute the collation sortkeys for each locale and
specified collation level.

- you call a PHP function/method that will be developped separately in a
"Collator" class, to compute the collation mappings for each locale and
specified collation level and maximum grapheme clusters, in order to generate
the headings on the fly in the category list

- you think about a HTTP query parameter that will allow to change the locale
(this parameter exists, it's "uselang", but another one will be needed
eventually to specify sort options like "-x-lc" or "-x-uc" (the "-x-" separator
will be used impliclty. So the HTTP query may contain: &uselang=fr&opt=lc).
These parameters will be used later when you'll be able to store multiple
sortkeys.


Separately, another project will implement the Collator class, that will load
the DUCET table, load the tailorings designed per locale or
locale+"-x-"+option, and prepare the table of collation elements and their
associated collation weights for each level. Then it will implement the
methods:

- Collator::Collator(locale, level=1) which instanciates a Collator object for
the specified locale string (language + optional options) and the collation
level (it does not need to prepare the full table of colaltion weights, just
those needed for the specified level). The default level will be 1.

- Collator::sortkey(text) which returns the opaque collation key (a binary
array of bytes) for the specified Collator instance.

- Collator::map(text, maxelements='') which returns the humane readable text
after applying the collation mapping associated to the Collator instance. It
will stop after returning at most 'maxelements' collation elements in the
remapped string, or will process all the text if maxelements is null or not
specified. For category headings, you'll give by default maxelements=1 (unless
another calue was specified when preparing a specific locale with the extra
option of {{SORTAS:locale|maxelements}} in the visited category page.


Separately another simple project will use the Collator class to expose them in
parser functions. In fact this third project will be very easy and fast to
complete, even if the Collator class is not fully developped with all its
options.

A very basic Collator class can be used to develop the parser function
extension that will expose:
-  {{SORTKEY:text|locale|level}}
   defaults: locale={{CONTENTLANGUAGE}}|level=1
- {{COLLATIONMAP:text|locale|level|maxelements}}
   defaults: locale={{CONTENTLANGUAGE}}|level=1|maxelements=<!--empty/null-->

With it you can immediately deply it on a test wiki server, where you'll build
test lists in a "sortable wikitable". and you can continue building the
Collator class. to support various locales and all the needed options.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to