Open stephen-huan opened 5 days ago
Thanks! I'm actually planing to port this script to lua, as I would like to have less dependencies. Will that be a problem for your projects?
Note that I'm less familiar with this script, as I did not wrote it nor used it before, so unless @jspitz beats me to it it will probably take me a couple of days to find a time to review this PR.
Thanks! I'm actually planing to port this script to lua, as I would like to have less dependencies. Will that be a problem for your projects?
In the short term, I base my work off my fork of polyglossia, so it wouldn't directly affect me. In the long run, I've been thinking about moving to lua myself (for the same reason, pandoc embeds a lua interpreter by default). So in either case, you shouldn't need to worry about my (relatively niche) use case.
Note that I'm less familiar with this script, as I did not wrote it nor used it before, so unless @jspitz beats me to it it will probably take me a couple of days to find a time to review this PR.
No worries, I made the modifications and thought I might as well upstream the fixes.
python2 has been depreciated since 2020. It'd be useful if I could use this file for some translation work in pandoc, and I'm writing code in python3. The first commit makes the script usable from python3, while keeping compatibility with python2 (>= 2.6). The next two commits are some minor nits.
The third commit fixes a bug, currently,
babelname2bcp47
mapschinese
tozh-TW
since a dictionary with duplicate keys takes the last value. Babel useschinese
to meanzh
, so the duplicates have been removed. The keysa-Deva
is also duplicated inbcp472lang
, but the value is the same for both so the resulting semantics are the same.The fourth commit adds some missing bcp47 codes to
bcp472lang
.