I'm working on a new version of the CLDR (localization data) packages, with the goal of reducing the amount of data that most installations will need.
The packages are broken up into:
cldr2: provides functions for accessing the data and resolving locale names
cldr2-data_<locale name>: one per locale, provides data from the rest of the unicode-cldr repos, but only for the locale in the package name
The cldr2 package depends on cldr2-data-core, but a user is free to install as many or as few locale-specific packages as desired.
The problem I've run into is how, at runtime, to find the data files I need in a way that works during development.
Each of the cldr2-data-* packages has a data archive at cldr2/data/json.zip from the package root directory. So, if someone wants data from the core package, we could do:
```
(define dir (pkg-directory "cldr2-data-core" #:cache PKG-CACHE))
... [raise an exception if the package isn't installed] ...
(define zip-path (build-path dir "cldr2" "data" "json.zip"))
... [open the archive and extract the relevant data] ...
```
And that's fine, except that it doesn't work in development when using raco link, because raco link manages collections, not packages. And I don't think that collection-file-path is useful here either, since all of these json.zip files have exactly the same collection-relative path.
What's the best way to handle this? Should I just give the zip files distinct names and use collection-file-path? Or is there a better way to handle this situation? (I'm a bit reluctant to use collection-file-path, since I think it searches the file system and so would be a bit expensive. pkg-directory needs to parse the package catalog, but it allows the results of that parse to be cached.)
-Jon