(#) Ellipsis string can be replaced with ellipsis character !!! WARNING: Ellipsis string can be replaced with ellipsis character This is a warning. Id : `TypographyEllipsis` Summary : Ellipsis string can be replaced with ellipsis character Severity : Warning Category : Usability: Typography Platform : Android Vendor : Android Open Source Project Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects : Resource files Editing : This check runs on the fly in the IDE editor See : https://en.wikipedia.org/wiki/Ellipsis Implementation : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/TypographyDetector.kt) Tests : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/TypographyDetectorTest.kt) Copyright Year : 2011 You can replace the string "..." with a dedicated ellipsis character, ellipsis character (\u2026, …). This can help make the text more readable. !!! Tip This lint check has an associated quickfix available in the IDE. (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text res/values/typography.xml:15:Warning: Replace "..." with ellipsis character (…, …) ? [TypographyEllipsis] <string name="ellipsis">40 times...</string> ----------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/values/typography.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers <resources> <string name="home_title">Home 'Sample'</string> <string name="show_all_apps">"All"</string> <string name="show_all_apps2">Show "All"</string> <string name="escaped">Skip \"All\"</string> <string name="single">Android's</string> <string name="copyright">(c) 2011</string> <string name="badquotes1">`First'</string> <string name="badquotes2">``second''</string> <string name="notbadquotes">Type Option-` then 'Escape'</string> <string name="fraction1">5 1/2 times</string> <string name="fraction4">1/4 times</string> <string name="notfraction">51/2 times, 1/20</string> <string name="ellipsis">40 times...</string> <string name="notellipsis">40 times.......</string> <string name="ndash">For ages 3-5</string> <string name="ndash2">Copyright 2007 - 2011</string> <string name="nontndash">x-y</string> <string name="mdash">Not found -- please try again</string> <string name="nontndash">----</string> <string name="notdirectional">A's and B's</string> <string-array name="typography"> <item>Ages 3-5</item> <item>Age 5 1/2</item> </string-array> <string name="ndash">X Y Z: 10 10 -1</string> <string name="ga_trackingId">UA-0000-0</string> <string>something somthing d\'avoir something something l\'écran.</string> </resources> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the [source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/TypographyDetectorTest.kt) for the unit tests for this check to see additional scenarios. The above example was automatically extracted from the first unit test found for this lint check, `TypographyDetector.test`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. (##) Suppressing You can suppress false positives using one of the following mechanisms: * Adding the suppression attribute `tools:ignore="TypographyEllipsis"` on the problematic XML element (or one of its enclosing elements). You may also need to add the following namespace declaration on the root element in the XML file if it's not already there: `xmlns:tools="http://schemas.android.com/tools"`. ```xml <?xml version="1.0" encoding="UTF-8"?> <resources xmlns:tools="http://schemas.android.com/tools"> ... <string tools:ignore="TypographyEllipsis" .../> ... </resources> ``` * Using a special `lint.xml` file in the source tree which turns off the check in that folder and any sub folder. A simple file might look like this: ```xml <?xml version="1.0" encoding="UTF-8"?> <lint> <issue id="TypographyEllipsis" severity="ignore" /> </lint> ``` Instead of `ignore` you can also change the severity here, for example from `error` to `warning`. You can find additional documentation on how to filter issues by path, regular expression and so on [here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html). * In Gradle projects, using the DSL syntax to configure lint. For example, you can use something like ```gradle lintOptions { disable 'TypographyEllipsis' } ``` In Android projects this should be nested inside an `android { }` block. * For manual invocations of `lint`, using the `--ignore` flag: ``` $ lint --ignore TypographyEllipsis ...` ``` * Last, but not least, using baselines, as discussed [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).