[Pkg-mozext-commits] [adblock-plus] 387/464: Remove access keys when importing strings from Firefox into Chrome

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit f9d3e38539c7830d82def3800cb6217febe36fac
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Wed Jul 3 14:58:31 2013 +0200

    Remove access keys when importing strings from Firefox into Chrome
---
 packagerChrome.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/packagerChrome.py b/packagerChrome.py
index 539f331..f6c93a4 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -243,7 +243,17 @@ def importGeckoLocales(params, files):
               key = re.sub(r'\..*', '', parts[-1]) + '_' + re.sub(r'\W', '_', stringID)
             if key in data:
               print 'Warning: locale string %s defined multiple times' % key
-            data[key] = {'message': sourceData[stringID]}
+
+            # Remove access keys
+            value = sourceData[stringID]
+            match = re.search(r'^(.*?)\s*\(&.\)$', value)
+            if match:
+              value = match.group(1)
+            else:
+              index = value.find("&")
+              if index >= 0:
+                value = value[0:index] + value[index + 1:]
+            data[key] = {'message': value}
       except Exception, e:
         print 'Warning: error importing locale data from %s: %s' % (sourceFile, e)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list