[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - wizards/com

Julien Nabet serval2412 at yahoo.fr
Sun Jan 7 18:08:06 UTC 2018


 wizards/com/sun/star/wizards/common/strings.hrc |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0e2cd1b44cf1794ac93aa59b6ec103276e40ae46
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jan 7 01:19:18 2018 +0100

    tdf#114873: localize Letter, fax and agenda wizards
    
    Since we use contextual messages, we need to concatenate:
    - context
    - EOT character
    - the message itself
    see https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
    
    A priori, regression from 00657aef09d854c74fb426a935a3e8b1fc390bb0
    
    Change-Id: Ie3e781e30ce09f0121afff2f0eb0769b1fbd2114
    Reviewed-on: https://gerrit.libreoffice.org/47531
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/wizards/com/sun/star/wizards/common/strings.hrc b/wizards/com/sun/star/wizards/common/strings.hrc
index fc43b334342c..46a2097c25cd 100644
--- a/wizards/com/sun/star/wizards/common/strings.hrc
+++ b/wizards/com/sun/star/wizards/common/strings.hrc
@@ -20,7 +20,13 @@ gettext.bindtextdomain('wiz', unohelper.fileUrlToSystemPath(
 gettext.textdomain('wiz')
 
 def NC_(context, string):
-    return gettext.gettext(string)
+    # Contextual strings are stored with the concatenation of
+    # the context, a EOT byte, and the original string, instead of the original string
+    # see https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
+    ret = gettext.gettext(context + chr(4) + string)
+    if ret.find(chr(4)) == -1:
+        return ret
+    return string
 
 # common section
 RID_COMMON_START_0                      = NC_("RID_COMMON_START_0", "The directory '%1' could not be created.<BR>There may not be enough space left on your hard disk.")


More information about the Libreoffice-commits mailing list