intlc icon indicating copy to clipboard operation
intlc copied to clipboard

Flattening reorders keys

Open thewilkybarkid opened this issue 1 year ago • 2 comments

We've tried out the flatten command, and it works great. However, it reorders the keys (and adds backend and description properties). It probably shouldn't change the structure of the file.

Related, could 'should be flattened' be a lint rule?

thewilkybarkid avatar Oct 23 '24 13:10 thewilkybarkid

For key reordering context there's https://github.com/unsplash/intlc/issues/46. It didn't matter to us when we were in early development, but it's a reasonable request, along with not adding previously absent keys.

I'd personally advise against flattening by hand rather than with tooling as it can severely harm readability (for a dev, anyway). There wouldn't be any harm in adding a lint rule for if you'd prefer to go that route, however there's currently no infrastructure for enabling or disabling specific rules and it wouldn't be appropriate to enable it by default. In the meantime you might be able to get by with flattening and compare each key's message.

To be fully transparent I don't expect us to get around to this any time soon as the tool is pretty much feature complete for our needs and, alongside the wider economic context, time is a little tighter than it once was. I'm also personally striking a healthier balance with extracurricular development than I was a couple of years ago. But I'd be very happy to review any contributions. 🙂

samhh avatar Nov 08 '24 11:11 samhh

I'd personally advise against flattening by hand rather than with tooling as it can severely harm readability (for a dev, anyway). There wouldn't be any harm in adding a lint rule for if you'd prefer to go that route, however there's currently no infrastructure for enabling or disabling specific rules and it wouldn't be appropriate to enable it by default. In the meantime you might be able to get by with flattening and compare each key's message.

Yeah, I'm trying to imagine using this in CI. At the minute this is the only option, and to see if it makes any changes. The results are rather explosive at the moment though and everything if different. 😄

For key reordering context there's https://github.com/unsplash/intlc/issues/46. It didn't matter to us when we were in early development, but it's a reasonable request, along with not adding previously absent keys.

Sorry I didn't spot that issue. We could live with making everything alphabetical, but the extra keys are more of a problem: empty description values are noisy, and backend isn't something we'll need/use.

But I'd be very happy to review any contributions. 🙂

I'm not familiar with Haskell myself (other than reading the docs in regards to understanding fp-ts and its ecosystem better), but as we're now using Intlc in production I'll see what we can do. 🙂

thewilkybarkid avatar Nov 13 '24 10:11 thewilkybarkid