Edgewall Software
Modify

Ticket #68 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Process <alias> elements in CLDR files

Reported by: cmlenz Owned by: cmlenz
Priority: critical Milestone: 0.9.3
Component: CLDR Import Version: 0.9.1
Keywords: Cc:

Description

Lots of locale data in the CLDR XML files isn't repeated, but instead referred to via <alias> elements. We don't currently process those, which means that some data is missing.

One problem is that <alias> uses XPath, and no part of the standard library supports that, unfortunately. We could use lxml or try to take apart the XPaths manually, but both seem suboptimal. Requiring lxml might work if the results of the import process were in the repository.

Attachments

cldr_aliases.diff (23.0 KB) - added by cmlenz 4 years ago.
In-progress patch for alias support
cldr_aliases.2.diff (21.2 KB) - added by cmlenz 4 years ago.
New patch, improved and reasonably complete
cldr_aliases.3.diff (20.5 KB) - added by cmlenz 4 years ago.
Yet another patch update

Change History

comment:1 Changed 4 years ago by jarek.zgoda@…

How about pre-processing CLDR with XSLT to get plain, parseable XML, eg. using some external XSL processor, like xsltproc, sablotron or xalan?

comment:2 Changed 4 years ago by jarek.zgoda@…

I found some Perl module on CPAN that handles aliases in CLDR files: http://search.cpan.org/src/DROLSKY/DateTime-Locale-0.35/tools/generate_from_cldr.

I'll check if it could be of any purpose here.

comment:3 Changed 4 years ago by cmlenz

  • Priority changed from major to critical

Changed 4 years ago by cmlenz

In-progress patch for alias support

comment:4 Changed 4 years ago by cmlenz

  • Status changed from new to assigned

I've added an incomplete patch that adds some alias processing.

The basic approach is that while locale inheritance is still done when loading locale data files, aliases are resolved when items are accessed. The pickle files store Alias instances. Locale data access is wrapped in an AliasResolvingDict instance.

Changed 4 years ago by cmlenz

New patch, improved and reasonably complete

comment:5 Changed 4 years ago by cmlenz

Ok, uploaded a new patch for the CLDR alias support. Note that this is also based on CLDR 1.6, which requires changes to some tests. Also, still need to add more tests for the alias resolving.

Changed 4 years ago by cmlenz

Yet another patch update

comment:6 Changed 4 years ago by cmlenz

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone changed from 1.0 to 0.9.3

Okay, this should be fixed in [412].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.