[Libreoffice-commits] core.git: solenv/bin

Jussi Pakkanen (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 15 09:45:03 UTC 2020


 solenv/bin/desktop-translate.py |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit f516f6753d87d963c06953c60e6ad56112c191be
Author:     Jussi Pakkanen <jpakkane at gmail.com>
AuthorDate: Fri Apr 10 20:37:22 2020 +0300
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Apr 15 11:44:35 2020 +0200

    Handle desktop files with multiline entries.
    
    This fixes a regression mentioned e.g. here:
    
    https://bugs.documentfoundation.org/show_bug.cgi?id=130911#c6
    
    Change-Id: Ic1a826ba933b8387d39aa25245095f27b0237801
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92050
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/solenv/bin/desktop-translate.py b/solenv/bin/desktop-translate.py
index 3ae49ae576ee..6d5c074de7b0 100644
--- a/solenv/bin/desktop-translate.py
+++ b/solenv/bin/desktop-translate.py
@@ -74,13 +74,15 @@ for line in source:
 
         if locale != line:
             # replace en-US with en
-            locale.replace('en-US', 'en')
+            locale = locale.replace('en-US', 'en')
 
             # use just anything inside the ""
-            value = value.strip()
             assert(value[0] == '"')
-            assert(value[-1] == '"')
-            value = value[1:-1]
+            # Some entries span multiple lines.
+            # An entry will always end on a double quote.
+            while not value.endswith('"\n'):
+                value += source.readline()
+            value = value[1:-2]
 
             # replace resource placeholder
             value = value.replace('%PRODUCTNAME', o.productname)


More information about the Libreoffice-commits mailing list