android/source/build.gradle           |    5 +++--
 android/source/lint.xml               |    9 +++++++++
 android/source/res/values/strings.xml |    2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit d5922ae2404e9efa62f3f19a56009c6668c3d574
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Dec 15 10:57:54 2023 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Dec 15 17:27:35 2023 +0100

    android lint: Ignore extra translations
    
    These should be managed automatically via weblate, s. [1],
    so there shouldn't be any need to manually remove stale
    strings for all translations.
    
    There are 2 lint checks for these, `ExtraTranslations`
    and `UnusedResources`.
    
    Disable `ExtraTranslations` altogether.
    The `UnusedResources` check seems useful in general,
    so only disable that for the translations by adding
    a lint config file `lint.xml` (s.a. [2]) using a
    wildcard for the path that matches the translation's
    string.xml files.
    
    This is in preparation for
    
        Change-Id: Icab66a1768f5c6250598fcf788377575d3f6f611
        Author: Michael Weghorn <[email protected]>
        Date:   Fri Dec 15 10:28:21 2023 +0100
    
            android lint: Drop unused string resources
    
            This also avoids that these will show up in Weblate,
            causing unnecessary work for translators since they're
            unused anyway.
    
            IIUC, dropping the strings in already existing translations
            should be handled automatically by Weblate.
            (Leave them there to see whether this actually works as
            expected.)
    
    [1] 
https://gerrit.libreoffice.org/c/impress_remote/+/155966/comments/769f76c5_c3c499ec
    [2] https://developer.android.com/studio/write/lint
    
    Change-Id: Ic7c7a1c4c5583bf1a42004480435aac70a88dee0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160822
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/android/source/build.gradle b/android/source/build.gradle
index b89efc3d00fd..009e9b59a742 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -90,8 +90,8 @@ android {
     }
     lint {
         warningsAsErrors true
-        // ignore missing translations, since these are tracked in Weblate 
already
-        ignore 'MissingTranslation'
+        // ignore missing or extra translations, since these are 
tracked/managed via Weblate
+        ignore 'ExtraTranslation', 'MissingTranslation'
         // don't error-out on external updates (new gradle plugin, library 
versions
         // or target API become available)
         // don't error-out on TypographyEllipsis, since this can be introduced 
with
@@ -101,6 +101,7 @@ android {
         // These should be dealt with at some point, though.
         // To update lint-baseline.xml, just remove the file and run the build 
again.
         baseline file("lint-baseline.xml")
+        // s.a. lint.xml that contains further config
     }
 }
 
diff --git a/android/source/lint.xml b/android/source/lint.xml
new file mode 100644
index 000000000000..bfcae7ec03cf
--- /dev/null
+++ b/android/source/lint.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <!-- Disable check for extra resources in translations, Weblate takes care 
of
+         removing these. -->
+    <issue id="UnusedResources">
+        <ignore path="res/values-*/strings.xml" />
+    </issue>
+</lint>
+
commit f43c133c87a2a6e8f0918e5038097d63dbdbe256
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Dec 15 08:41:41 2023 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Dec 15 17:27:21 2023 +0100

    android lint: Replace "..." with ellipsis character
    
    Address this lint warning listed in the lint-baseline.xml:
    
        <issue
            id="TypographyEllipsis"
            message="Replace &quot;...&quot; with ellipsis character (…, 
&amp;#8230;) ?"
            errorLine1="    &lt;string name=&quot;action_save_as&quot;>Save 
As...&lt;/string>"
            errorLine2="                                  ~~~~~~~~~~">
            <location
                file="res/values/strings.xml"
                line="53"
                column="35"/>
        </issue>
    
    This also helps to avoid introducing more issues of that kind in newly
    added translations, quoting from cloph's Gerrit comment [1]:
    
    > and FYI: if the source-string would end in an Ellipsis, then weblate could
    > enforce the translation ending in an ellipsis [...]
    >
    > ( https://docs.weblate.org/en/latest/user/checks.html#mismatched-ellipsis 
)
    
    [1] 
https://gerrit.libreoffice.org/c/core/+/160614/comments/5ef2dc6d_75cde15f
    
    Change-Id: Ic056849dd56d7e6c50615ffd62d470df4ab337bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160817
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/android/source/res/values/strings.xml 
b/android/source/res/values/strings.xml
index 5d280ca5025b..1460b525192f 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -50,7 +50,7 @@
     <string name="action_strikeout">Strike Out</string>
     <string name="action_keyboard">Show keyboard</string>
     <string name="action_save">Save</string>
-    <string name="action_save_as">Save As...</string>
+    <string name="action_save_as">Save As…</string>
     <string name="action_fromat">Enable Format</string>
     <string name="action_search">Search</string>
     <string name="action_UNO_commands">Send UNO Cmd</string>

Reply via email to