ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
7.94k stars 2.16k forks source link

Lint unicode horizonal ellipsis "…" translated to three periods #16269

Closed david-allison closed 2 weeks ago

david-allison commented 2 weeks ago

Should be using the Unicode. Optional lint improvement

_Originally posted by @david-allison in https://github.com/ankidroid/Anki-Android/pull/16267#discussion_r1578311441_

david-allison commented 2 weeks ago

This is a good first issue. Please leave a comment if you'd like to work on this, and we'll improve the description to provide concrete steps for implementation

Aditya13s commented 2 weeks ago

I want to work on this.

david-allison commented 2 weeks ago

Sounds good! Do you need instructions, or do you feel it's easy enough to work out?

Aditya13s commented 2 weeks ago

Yes! Need Some Instructions.

david-allison commented 2 weeks ago

Here is a lint rule which involves CrowdIn strings

https://github.com/ankidroid/Anki-Android/blob/main/lint-rules%2Fsrc%2Fmain%2Fjava%2Fcom%2Fichi2%2Fanki%2Flint%2Frules%2FDuplicateCrowdInStrings.kt

Make a copy of the class, add it to IssueRegistry

Modify the functionality to:

Check for ... and return a lint error if this is found in any string value

If that works, rebase in a commit beforehand which fixes all the errors which are raised

We'll then go through to fix the issues on CrowdIn in the first commit, you can then drop the first commit, rebase the branch onto main, and we can merge the lint check

lukstbit commented 2 weeks ago

I think it would be simpler to use one of our current checks, in TranslationTypo.visitElement():

// use the unicode character instead of three dots for ellipsis
if (element.textContent.contains("...")) {
    context.report(ISSUE, context.getElementLocation(element), "should use unicode '…' instead of three dots for ellipsis")
}

Fixing this issues will require manual changes on crowdin.