| Index: localeTools.py |
| diff --git a/localeTools.py b/localeTools.py |
| index e97147d48f6b980636ce0a69096a0c92f01b2877..05a1d8e4620574e0290606ad24f524a31fde284b 100644 |
| --- a/localeTools.py |
| +++ b/localeTools.py |
| @@ -318,9 +318,11 @@ def setupTranslations(localeConfig, projectName, key): |
| locales.add(mapLocale('BCP-47', match2.group(1))) |
| allowed = set() |
| - allowedLocales = urllib2.urlopen('http://crowdin.net/page/language-codes').read() |
| - for match in re.finditer(r'<tr>\s*<td\b[^<>]*>([\w\-]+)</td>', allowedLocales, re.S): |
| - allowed.add(match.group(1)) |
| + allowedLocales = json.load(urllib2.urlopen( |
| + 'https://crowdin.com/languages/languages_list?callback=' |
| + )) |
| + for locale in allowedLocales: |
| + allowed.add(locale["code"]) |
| if not allowed.issuperset(locales): |
| print "Warning, following locales aren't allowed by server: " + ', '.join(locales - allowed) |