Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not re-sort the keys when writing back .strings files #51

Closed
tempelmann opened this issue May 22, 2019 · 2 comments
Closed

Should not re-sort the keys when writing back .strings files #51

tempelmann opened this issue May 22, 2019 · 2 comments
Labels
wontfix This will not be worked on

Comments

@tempelmann
Copy link

It makes it difficult to track the changes, e.g. in a version control system (git).

Also, I like to have my own ordering, where I group strings by purpose.

Another problem with the sorting is that it does not preserve comments at the end of a line. Example:

"Tr.trash_verb" = "löschen"; /* as a verb, i.e. to trash */

If this line gets reordered, the comment ends up with a different line.

Since the keys do not change while editing in this tool, I suggest to preserve the order of the keys when reading the file, and restoring them in the same order when writing back. Or by using a OrderedDictionary (though that's not a standard class in Cocoa, I'm afraid, unless Swift now has one?).

@igorkulman
Copy link
Owner

igorkulman commented May 23, 2019

You are right the app does not correctly handle comments at the end of a translation, that is definitely a bug and should have its own separate issue (#52).

I thought about keeping the sort order in the beginning, but it seemed like too much work, especially when you realize every language file can have a different sort. So I decided to just always keep the strings sorted. I get that the first time you use the app you will get a commit with a huge unreadable diff but then it gets better :)

Anyway, I do not plan to implement this, but if you send a PR I will be happy to accept it.

@Tantalum73
Copy link
Contributor

Hi @tempelmann, PR #53 should fix your issues with trailing comments 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants