Created
June 3, 2020 14:17
-
-
Save rail/4136d2208f6ad9e266c6e8aab22c6678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/python/mozrelease/mozrelease/l10n.py b/python/mozrelease/mozrelease/l10n.py | |
--- a/python/mozrelease/mozrelease/l10n.py | |
+++ b/python/mozrelease/mozrelease/l10n.py | |
@@ -4,18 +4,16 @@ | |
from __future__ import absolute_import | |
-from .platforms import shippedLocales2ftp | |
- | |
def getPlatformLocales(shipped_locales, platform): | |
platform_locales = [] | |
for line in shipped_locales.splitlines(): | |
- entry = line.strip().split() | |
- locale = entry[0] | |
- if len(entry) > 1: | |
- for sl_platform in entry[1:]: | |
- if platform in shippedLocales2ftp(sl_platform): | |
- platform_locales.append(locale) | |
- else: | |
- platform_locales.append(locale) | |
+ locale = line.strip().split()[0] | |
+ # ja-JP-mac locale is a MacOS only locale | |
+ if locale == "ja-JP-mac" and not platform.startswith("macos"): | |
+ continue | |
+ # Skip the "ja" locale on MacOS | |
+ if locale == "ja" and platform.startswith("macos"): | |
+ continue | |
+ platform_locales.append(locale) | |
return platform_locales | |
diff --git a/python/mozrelease/mozrelease/platforms.py b/python/mozrelease/mozrelease/platforms.py | |
--- a/python/mozrelease/mozrelease/platforms.py | |
+++ b/python/mozrelease/mozrelease/platforms.py | |
@@ -54,15 +54,5 @@ def ftp2shippedLocales(platform): | |
return sl_platform_map.get(platform, platform) | |
-def shippedLocales2ftp(platform): | |
- matches = [] | |
- try: | |
- [matches.append( | |
- k) for k, v in sl_platform_map.iteritems() if v == platform][0] | |
- return matches | |
- except IndexError: | |
- return [platform] | |
- | |
- | |
def ftp2infoFile(platform): | |
return info_file_platform_map.get(platform, platform) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment