Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: localeTools.py

Issue 29611593: Issue 5996 - Release consistent versions across WebExtensions (Closed) Base URL: https://codereview.adblockplus.org/29609559/
Patch Set: Addressing comments Created Nov. 28, 2017, 1:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build.py ('k') | packager.py » ('j') | releaseAutomation.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: localeTools.py
diff --git a/localeTools.py b/localeTools.py
index 0f5bcc7e0e0d767d2cec65926537cbd63ec20c98..6583cbee99f422de3f27205c19897978bbe87a97 100644
--- a/localeTools.py
+++ b/localeTools.py
@@ -41,6 +41,30 @@ FIREFOX_LP_URL = 'https://addons.mozilla.org/en-US/firefox/language-tools/'
CHROMIUM_DEB_URL = 'https://packages.debian.org/sid/all/chromium-l10n/filelist'
+def read_locale_config(baseDir, platform, metadata):
+ if platform != 'generic':
+ import buildtools.packagerChrome as packager
+ localeDir = os.path.join(baseDir, '_locales')
+ localeConfig = {
+ 'default_locale': packager.defaultLocale,
+ }
+ else:
+ localeDir = os.path.join(
+ baseDir, *metadata.get('locales', 'base_path').split('/')
+ )
+ localeConfig = {
+ 'default_locale': metadata.get('locales', 'default_locale')
+ }
+
+ localeConfig['base_path'] = localeDir
+
+ locales = [(locale.replace('_', '-'), os.path.join(localeDir, locale))
+ for locale in os.listdir(localeDir)]
+ localeConfig['locales'] = dict(locales)
+
+ return localeConfig
+
+
def crowdin_request(project_name, action, key, get={}, post_data=None,
headers={}, raw=False):
"""Perform a call to crowdin and raise an Exception on failure."""
« no previous file with comments | « build.py ('k') | packager.py » ('j') | releaseAutomation.py » ('J')

Powered by Google App Engine
This is Rietveld