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

Update Italian translation and sort baseline strings lexicographically #630

Merged
merged 8 commits into from
Jun 15, 2023
Merged

Conversation

andreaippo
Copy link
Contributor

Update Italian translation:

  • remove capitalization where unnecessary
  • translate new strings
  • minor changes
  • sort lexicographically

Baseline strings file:

  • sort lexicographically. This should make it easier for translators to rebase their files, as it ensures a consistent ordering between the baseline file and the translation. Alternatively, core devs should always append new strings at the end of the file, but I think that sorting makes it look tidier. Let me know what you think.

@andreaippo
Copy link
Contributor Author

@andscape-dev could you please review as well?

@twizmwazin
Copy link
Contributor

I'm in favor of lexicographic sorting, especially if we can enforce it with CI.

@andreaippo
Copy link
Contributor Author

andreaippo commented Jun 14, 2023

I'm in favor of lexicographic sorting, especially if we can enforce it with CI.

Seems like spotless can do that for JSON :(

https://github.com/diffplug/spotless/blob/main/plugin-gradle/README.md#json

No luck finding something for XML so far

@andscape-dev
Copy link
Contributor

Thanks for the updates! I'm fine with the lexicographical ordering, I use the Android Studio translations editor so I don't really touch the files manually anyway... Will this require translators to sort the files manually every time, though? Or can this be done automatically with some kind of auto-formatting?

@andscape-dev
Copy link
Contributor

By the way, my local build is failing. "Unresolved reference: ic_launcher_foreground" in MarkdownHelper.kt and PictrsImage.kt. Seems unrelated, but is this just my local env being broken or is it happening to you too?

@dessalines
Copy link
Member

@andscape-dev I had this once, found the fix on stackoverflow. Clean gradle cache and then run invalidate caches and restart in android studio, iirc.

@twizmwazin @andreaippo We use a prettier CI image to check our json and a lot more with all our lemmy projects. Looks like it has an xml plugin. I'm just not sure it would be very desirable tho, because every little translation addition would require us to manually fix the formatting. Contributers aren't going to install prettier and run it for us.

@andreaippo
Copy link
Contributor Author

@andscape-dev I had this once, found the fix on stackoverflow. Clean gradle cache and then run invalidate caches and restart in android studio, iirc.

@twizmwazin @andreaippo We use a prettier CI image to check our json and a lot more with all our lemmy projects. Looks like it has an xml plugin. I'm just not sure it would be very desirable tho, because every little translation addition would require us to manually fix the formatting. Contributers aren't going to install prettier and run it for us.

I don't see a command to sort lexicographically, though :(
To tell you the truth, I'm a Java dev with zero experience with Android dev and the corresponding toolkit.
So even the translation MRs I submitted are the result of using the Kate editor or IntelliJ IDEA. I have no idea how Android studio handles strings files, maybe it has some nice features to keep related strings close together. But whatever fancy features it may have, the problem is we cannot expect every contributor/translator to use the same IDE/editor, therefore a universal ordering might be the best solution, although I honestly wouldn't know how to implement it in an automated way.

Should we have to keep the file sorted manually, would that be a big deal? With Kate (and notepad++) it's a few clicks, I'd expect other IDEs to provide the same.

@andscape-dev
Copy link
Contributor

@andreaippo AFAIK Android Studio doesn't have a feature to sort XML entries by tag value, and it is the standard IDE for Android. We can't force all contributors to use Android Studio, but we can assume most of them will.

To me, keeping entries in the order they are added to the codebase seems the simplest solution. That way changes willl be clustered towards the bottom and therefore easier to review/merge.

@andreaippo
Copy link
Contributor Author

@andreaippo AFAIK Android Studio doesn't have a feature to sort XML entries by tag value, and it is the standard IDE for Android. We can't force all contributors to use Android Studio, but we can assume most of them will.

To me, keeping entries in the order they are added to the codebase seems the simplest solution. That way changes willl be clustered towards the bottom and therefore easier to review/merge.

seems to be the best course of action at this point. I'm not sure I'd be willing to install (another) full IDE just for localization, a simple diff tool would be enough for me and for occasional contributors to the project as well, so I think that it's important that it's easy for everyone to compare with the baseline (English) file and see which strings have been added. And adding nodes in the middle of the file isn't well digested by a couple of diff tools I tried today, therefore using an "append-only" policy seems the best option for everyone.

@andscape-dev
Copy link
Contributor

@andreaippo have you had time to take a look at my comments? They're minor suggestions, we can merge without them too...

@andreaippo
Copy link
Contributor Author

@andreaippo have you had time to take a look at my comments? They're minor suggestions, we can merge without them too...

Hey, I can't seem to find any comments. Are they in the diff somewhere?

@andscape-dev
Copy link
Contributor

Hey, I can't seem to find any comments. Are they in the diff somewhere?

Weird, I see them here in the thread as an open review...

@andscape-dev
Copy link
Contributor

So yeah, I have no idea why, but Github was showing my review to me only, and not to anyone else...

@andreaippo
Copy link
Contributor Author

So yeah, I have no idea why, but Github was showing my review to me only, and not to anyone else...

Happened to me all the time when I first started using Gitlab after a long period on BitBucket. In my case I had to submit/finalize my review, otherwise comments would stay private :D

@andscape-dev
Copy link
Contributor

Awesome, LGTM!

@andreaippo
Copy link
Contributor Author

Awesome, LGTM!

Great!

@twizmwazin @dessalines we are ready for merge :)

@twizmwazin twizmwazin enabled auto-merge (squash) June 15, 2023 06:18
@twizmwazin twizmwazin merged commit 0684c50 into LemmyNet:main Jun 15, 2023
Chris-Kropp pushed a commit to Chris-Kropp/jerboa that referenced this pull request Jun 16, 2023
LemmyNet#630)

* Update Italian localization and sort baseline strings file lexicographically to simplify rebasing by translators

* Address review comments by @andscape-dev

---------

Co-authored-by: Kevin Phoenix <kevin@kphoenix.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants