slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
474 stars 39 forks source link

`slang edit add` always puts items at the end #158

Closed adil192 closed 1 year ago

adil192 commented 1 year ago

Motivation

Why do you want this feature? Ex: I'm always frustrated when [...]

Putting OUTDATED translations at the end results in messy hard-to-read git diffs.

For example, see https://github.com/adil192/saber/commit/eed1be52641f3f69c04689ac903404c4ff2fe9e8. Only two strings were actually changed, but it's very hard to see that just from looking at the diff:

Developer Experience

How should devs use this new feature? Ex: There should be a new parameter called [...]

There should be no change in usage

Tienisto commented 1 year ago

I cannot reproduce this. It replaces entries in place and skips not existent keys on my examples

adil192 commented 1 year ago

skips not existent keys

Are you referring to missing keys or (OUTDATED) keys?

Tienisto commented 1 year ago

The outdated keys

adil192 commented 1 year ago

Hmmm... maybe it only affects yaml?

adil192 commented 1 year ago

Turns out it's not the OUTDATED flag that's the problem.

Running e.g. dart run slang edit add fr greetings.hello "Bonjour" always puts the new translation at the end rather than in the order of the base locale.