digidem / mapeo-core-next

The upcoming version of Mapeo Core
MIT License
7 stars 1 forks source link

feat: config import translations #602

Closed tomasciccola closed 1 month ago

tomasciccola commented 2 months ago

May fix #587

tomasciccola commented 2 months ago

I've basically followed the pattern with the *fields and *presetiterators. I had to change the preset iterator so that it also yields its name (which is actually the object key) since that is used in translations to reference it (so translations don't use the name field in presets but the key itself; i.e. "Boundary Line" is actually "boundary-line")

tomasciccola commented 2 months ago

Also, keen to read alternatives to having 4 nested loops. Using a reducer is an alternative but I don't think it'll necessarily be clearer code...

tomasciccola commented 2 months ago

there's a type of translation thats always empty called category. I don't know the use of it, but I'm skipping it - for now - and only importing 'fields' and 'presets'. We may want to update the default config (and config builder) in the future to remove this..

EvanHahn commented 2 months ago

Let me know when I should take another look at this (no rush).