| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 | 2 |
| 3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
| 4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | 6 |
| 7 import re, os, sys, codecs, json, urllib, urllib2 | 7 import re, os, sys, codecs, json, urllib, urllib2 |
| 8 from StringIO import StringIO | 8 from StringIO import StringIO |
| 9 from ConfigParser import SafeConfigParser | 9 from ConfigParser import SafeConfigParser |
| 10 from zipfile import ZipFile | 10 from zipfile import ZipFile |
| 11 from xml.parsers.expat import ParserCreate, XML_PARAM_ENTITY_PARSING_ALWAYS | 11 from xml.parsers.expat import ParserCreate, XML_PARAM_ENTITY_PARSING_ALWAYS |
| 12 | 12 |
| 13 langMappingGecko = { | 13 langMappingGecko = { |
| 14 'bn-BD': 'bn', | 14 'bn-BD': 'bn', |
| 15 'br': 'br-FR', | 15 'br': 'br-FR', |
| 16 'dsb': 'dsb-DE', | 16 'dsb': 'dsb-DE', |
| 17 'fj-FJ': 'fj', | 17 'fj-FJ': 'fj', |
| 18 'hsb': 'hsb-DE', | 18 'hsb': 'hsb-DE', |
| 19 'hi-IN': 'hi', | 19 'hi-IN': 'hi', |
| 20 'ml': 'ml-IN', | 20 'ml': 'ml-IN', |
| 21 'gu': 'gu-IN', | |
|
Wladimir Palant
2014/12/28 11:26:28
This is wrong. I checked https://addons.mozilla.or
Sebastian Noack
2014/12/28 12:53:15
Done.
| |
| 21 'nb-NO': 'nb', | 22 'nb-NO': 'nb', |
| 22 'rm': 'rm-CH', | 23 'rm': 'rm-CH', |
| 23 'ta-LK': 'ta', | 24 'ta-LK': 'ta', |
| 24 'wo-SN': 'wo', | 25 'wo-SN': 'wo', |
| 25 } | 26 } |
| 26 | 27 |
| 27 langMappingChrome = { | 28 langMappingChrome = { |
| 28 'es-419': 'es-MX', | 29 'es-419': 'es-MX', |
| 29 'es': 'es-ES', | 30 'es': 'es-ES', |
| 30 'sv': 'sv-SE', | 31 'sv': 'sv-SE', |
| 31 'ml': 'ml-IN', | 32 'ml': 'ml-IN', |
| 33 'gu': 'gu-IN', | |
| 32 } | 34 } |
| 33 | 35 |
| 34 chromeLocales = [ | 36 chromeLocales = [ |
| 35 "am", | 37 "am", |
| 36 "ar", | 38 "ar", |
| 37 "bg", | 39 "bg", |
| 38 "bn", | 40 "bn", |
| 39 "ca", | 41 "ca", |
| 40 "cs", | 42 "cs", |
| 41 "da", | 43 "da", |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 | 441 |
| 440 # Remove any extra files | 442 # Remove any extra files |
| 441 for dir, files in dirs.iteritems(): | 443 for dir, files in dirs.iteritems(): |
| 442 baseDir = os.path.join(localesDir, dir) | 444 baseDir = os.path.join(localesDir, dir) |
| 443 if not os.path.exists(baseDir): | 445 if not os.path.exists(baseDir): |
| 444 continue | 446 continue |
| 445 for file in os.listdir(baseDir): | 447 for file in os.listdir(baseDir): |
| 446 path = os.path.join(baseDir, file) | 448 path = os.path.join(baseDir, file) |
| 447 if os.path.isfile(path) and (file.endswith('.json') or file.endswith('.pro perties') or file.endswith('.dtd')) and not file in files: | 449 if os.path.isfile(path) and (file.endswith('.json') or file.endswith('.pro perties') or file.endswith('.dtd')) and not file in files: |
| 448 os.remove(path) | 450 os.remove(path) |
| OLD | NEW |