zotero / citeproc-rs

CSL processor in Rust.
https://cormacrelf.github.io/citeproc-wasm-demo/
Other
75 stars 10 forks source link

Move locales-en-US.xml from wasm crate to csl #39

Closed kira-bruneau closed 4 years ago

kira-bruneau commented 4 years ago

Currently the db crate can't be built in isolation since it depends on on locales-en-US.xml, which exists outside of the crate.

This commit moves locales-en-US.xml to csl, and exposes the contents of the file through EN_US so it can be used from other crates.

Fixes #23

This fixes the problem, but please let me know if you can think of a better way of approaching this.

kira-bruneau commented 4 years ago

@doronbehar

cormacrelf commented 4 years ago

LGTM, thanks for driving this one.

dstillman commented 4 years ago

(Presumably we eventually want to just use a submodule of the CSL locales repo, though, right?)

cormacrelf commented 4 years ago

Submodules are annoying enough to update (edit: no less annoying than this, and no more automatic); locales-en-US.xml changes once every few years and it's a big event when it does (only when there's a feature addition to the spec); the rest of the locales are not needed to build the program.

When I say "build the program" I mean for tests and for the wasm code to avoid a constant 1 extra HTTP request that blocks using the processor. The rest of the time, it is expected that locales will be present in the end-user's filesystem or available over CDN/HTTP. But I don't care if a few kB makes it into an overall pretty large native binary, so this is fine.

dstillman commented 4 years ago

Ah, OK, I didn't realize the other locales wouldn't be needed eventually.